-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSquare.cpp
56 lines (45 loc) · 995 Bytes
/
Square.cpp
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
51
52
53
54
55
56
#include "Square.h"
// ---------------------------------------------------------------------------
int CSquare::sqSize = 20.0;
// ---------------------------------------------------------------------------
CSquare::CSquare()
{
X = 0;
Y = 0;
nTrees_t0 = 0;
nSpec_t0 = 0;
nRecruits_t1 = 0;
nDeath_t1 = 0;
};
CSquare::CSquare(int ix, int iy)
{
iX = ix;
iY = iy;
X = (double) iX*sqSize;
Y = (double) iY*sqSize;
nTrees_t0 = 0;
nRecruits_t1 = 0;
nDeath_t1 = 0;
};
// ---------------------------------------------------------------------------
CSquare::~CSquare()
{
TreeList.clear();
RecruitList.clear();
SpecMap.clear();
};
// ---------------------------------------------------------------------------
void CSquare::InitSquare(int ix, int iy)
{
iX = ix;
iY = iy;
X = (double) iX*sqSize;
Y = (double) iY*sqSize;
nTrees_t0 = 0;
nSpec_t0 = 0;
nRecruits_t1 = 0;
nDeath_t1 = 0;
TreeList.clear();
RecruitList.clear();
SpecMap.clear();
};