Source:NetHack 3.3.0/qt clust.h

From NetHackWiki
(Redirected from NetHack 3.3.0/qt clust.h)
Jump to: navigation, search

Below is the full text to qt_clust.h from the source code of NetHack 3.3.0. To link to a particular line, write [[NetHack 3.3.0/qt_clust.h#line123]], for example.

Warning! This is the source code from an old release. For the latest release, see Source code

The NetHack General Public License applies to screenshots, source code and other content from NetHack.

This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.

1.    /*	SCCS Id: @(#)qt_clust.h	3.3	1999/11/19	*/
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 {
11.   public:
12.   	Clusterizer(int maxclusters);
13.   	~Clusterizer();
15.   	void add(int x, int y); // 1x1 rectangle (point)
16.   	void add(int x, int y, int w, int h);
17.   	void add(const QRect& rect);
19.   	void clear();
20.   	int clusters() { return count; }
21.   	const QRect& operator[](int i);
23.   private:
24.   	QRect* cluster;
25.   	int count;
26.   	const int max;
27.   };
29.   #endif