-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWorld.h
45 lines (41 loc) · 908 Bytes
/
World.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
39
40
41
42
43
44
45
#pragma once
#include <Windows.h>
#include <vector>
#include <fstream>
#include <string>
#include "Cell.h"
using std::vector;
class World
{
public:
World(int w, int h);
World() : World(1, 1) {}
void DrawGrid(HDC, RECT);
void DrawCells(HDC, RECT);
bool ReadFromFile(char* filepath);
bool WriteToFile(char* filepath);
void SetCell(int, int, Cell*);
void Update();
void ResetState();
int GetRowsCount();
int GetColsCount();
int GetSquare();
int GetTotalCellsCount();
int GetCellsCountByRace(Cell::Race race);
int GetGeneration();
int GetCellsBorn();
int GetCellsDied();
~World();
private:
int rowsCount;
int colsCount;
vector<vector<Cell*>> matrix;
int generation;
int square;
int totalCellsCount;
int racesCellsCount[RACES_COUNT];
int cellsBorn;
int cellsDied;
void CloneMatrix(const vector<vector<Cell*>>, vector<vector<Cell*>>*);
void DeleteMatrix(vector<vector<Cell*>>*);
};