SHARE
TWEET

Untitled

a guest Aug 13th, 2017 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #ifndef _GRID_H_
  2. #define _GRID_H
  3.  
  4. #include <set>
  5. #include "shapes.h"
  6.  
  7. using namespace std;
  8.  
  9. template <class T>
  10. class Grid {
  11.     set<T*> *cells;
  12.     int cellSize;
  13.     int rows, columns;
  14.     int width, height;
  15.  
  16. public:
  17.     Grid(int width, int height, int cellSize);
  18.     ~Grid();
  19.  
  20.     void registerObject(T *anObject, Point rect[]);
  21.     void clearGrid();
  22.     set<T*> queryGrid(Point rect[]);
  23. };
  24.  
  25. #endif
RAW Paste Data
Top