fix 'crash when reviving shopkeeper'
[aNetHack.git] / include / qt_clust.h
blob46607c9b5b5bbcebe1d41f24d6666ccc609becd3
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. */
5 #ifndef clusterizer_H
6 #define clusterizer_H
8 #include <qrect.h>
10 class Clusterizer
12 public:
13 Clusterizer(int maxclusters);
14 ~Clusterizer();
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);
20 void clear();
21 int
22 clusters()
24 return count;
26 const QRect &operator[](int i);
28 private:
29 QRect *cluster;
30 int count;
31 const int max;
34 #endif