blob: 2b0710355e0097f1ffa61612abd754751889f607 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
#ifndef quadtree_h
#define quadtree_h
#include <list>
#include <vector>
#include "constants.hpp"
#include "creature.hpp"
#include "resource.hpp"
#include "entity.hpp"
#include "rectangle.hpp"
#include "opengl/graphicsdata.hpp"
#include "sdl/window.hpp"
class Quadtree {
public:
Quadtree();
Quadtree(int pLevel,Rectangle pBounds);
void clear();
void insert(Entity* iter);
std::list<Entity*> retrieve(std::list<Entity*> returnObject, GraphicsData obj);
std::list<Entity*> objects;
Quadtree* nodes;
std::vector<GraphicsData> Draw();
private:
void split();
int getIndex(GraphicsData object);
int level;
bool isNull = true;
GraphicsData gfxDataRect;
Rectangle bounds;
};
#endif
|