OSDN Git Service

ifdef-ed official patches
[jnethack/source.git] / include / qt_clust.h
1 /* NetHack 3.6  qt_clust.h      $NHDT-Date: 1432512779 2015/05/25 00:12:59 $  $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */
2 /* Copyright (c) Warwick Allison, 1999. */
3 /* NetHack may be freely redistributed.  See license for details. */
4
5 #ifndef clusterizer_H
6 #define clusterizer_H
7
8 #include <qrect.h>
9
10 class Clusterizer
11 {
12   public:
13     Clusterizer(int maxclusters);
14     ~Clusterizer();
15
16     void add(int x, int y); // 1x1 rectangle (point)
17     void add(int x, int y, int w, int h);
18     void add(const QRect &rect);
19
20     void clear();
21     int
22     clusters()
23     {
24         return count;
25     }
26     const QRect &operator[](int i);
27
28   private:
29     QRect *cluster;
30     int count;
31     const int max;
32 };
33
34 #endif