File: section.h

package info (click to toggle)
rafkill 1.2.2-3.3
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 13,268 kB
  • sloc: cpp: 13,508; makefile: 64; sh: 14
file content (50 lines) | stat: -rw-r--r-- 946 bytes parent folder | download | duplicates (12)
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
42
43
44
45
46
47
48
49
50
#ifndef _section_h
#define _section_h

class SpaceObject;

using namespace std;

#include <vector>
#include <map>

#define MAX_SECTION_LIST_Y 20
#define MAX_SECTION_OBJ_Y 30
#define MIN_SECTION_Y 100

#define MAX_SECTION_LIST_X 40
#define MAX_SECTION_OBJ_X 40
#define MIN_SECTION_X 100

class Section{
public:

	Section();

	void add( SpaceObject * who, int x, int y );
	void reset();
	int spacerY();
	int spacerX();
	void clear();
	
	vector< SpaceObject * > * getNext();

	void dispose( SpaceObject * who );
	
	//debug
	void print();

	~Section();

protected:
	//vector< SpaceObject * > container_list[ MAX_SECTION_LIST ];
	// vector< SpaceObject * > * container_list[ MAX_SECTION_LIST ];
	vector< SpaceObject * > container_list[ MAX_SECTION_LIST_Y ][ MAX_SECTION_LIST_X ];
	map< int, vector< SpaceObject * > * > lists;
	map< int, vector< SpaceObject * > * >::iterator current_list;
	int section_y, section_x;
	// int internal_list;

};

#endif