blob: af2e69842643e7f94bdffd5d10aa628500f40f21 (
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
42
43
44
45
46
47
48
|
#ifndef _FIELD_H
#define _FIELD_H
#include <vector>
#include <stdexcept>
#include "types.h"
#include "Cell.h"
const PlayerColor emptyColors[] = { 0x000000, 0x404040, 0xAAAAAA};
const uint gridSize = 10;
class Field
{
public:
Field(uint width = 0, uint height = 0);
virtual ~Field(void);
public:
/**
* Inits the fields at a givens size and empties it.
**/
void init(uint width, uint height);
/**
* Draw all players for several cycles. Initial, final AND intermediate positions will be drawn.
**/
bool drawAllPlayers(uint numCycles);
/**
* Returns a specific cell given its coordinates.
**/
Cell& getCell(Coordinates c);
/**
* Returns the size of the field
**/
Coordinates getMaxCoordinates();
/**
* Redefines the value of a cell.
**/
void setCell(Coordinates coord, Cell cell);
private:
int m_width;
int m_height;
std::vector<Cell> m_fieldCells;
};
#endif
|