Source:NetHack 3.6.0/include/qt clust.h

From NetHackWiki
(Redirected from Source:Qt clust.h)
Jump to: navigation, search

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

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.  /* 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