-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathWorldBoard.h
38 lines (33 loc) · 1.25 KB
/
WorldBoard.h
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
#pragma once
#include "CellGrid.h"
#include "DataParser.h"
#include "AbstractDoco.h"
#include "Doco.h"
#include <vector>
// The world board is responsible for holding all the entities
// of the DOCO simulation. Creating it will create the other objects.
class WorldBoard
{
private:
int width;
int height;
std::vector<std::pair<int, int> > food_positions;
std::vector<std::pair<int, int> > obstacle_positions;
void generateFoodLocations(int x_range, int y_range, int foodCount=NULL);
void readFile(char* inFile);
public:
CellGrid* worldCellGrid; // will hold the CellGrid Object which contains all the Cells and GridSize
DataParser* myParser; // the DataParser obejct for the class.
std::vector<Doco> doco_vect; // will hold a vector of all the current DOCO�s on the board.
WorldBoard();
WorldBoard(char* file_name);
~WorldBoard();
void updateCellsWithNewFood();
void setCellWithNewFood(int x, int y);
int setCellWithNoFood(int x, int y); // return the number of foods eaten, set new food to zero
void setCellWithObstacle(int x, int y);
void updateDocos();
int updateCellWithADoco(int x, int y); // helper function to set cell status for cells with DOCOs, return food amount
void updateWorldState(); // x and y range to update.
void printWorld();
};