Snoke
change.cpp
Go to the documentation of this file.
1 
11 #include "change.h"
12 
13 
18 {
19  this->queue[0] = *(new std::deque<Point>);
20  this->queue[1] = *(new std::deque<Point>);
21 }
22 
29 {
30  if(p.x >= 0 && p.y >= 0)
31  {
32  this->queue[0].push_back(p);
33  return true;
34  }
35  return false;
36 }
37 
44 {
45  if(p.x >= 0 && p.y >= 0)
46  {
47  this->queue[1].push_back(p);
48  return true;
49  }
50  return false;
51 }
52 
58 {
59  for(auto it = queue[0].begin(); it != queue[0].end(); ++it)
60  {
61  if(*it == p)
62  {
63  return true;
64  }
65  }
66  return false;
67 }
68 
74 {
75  for(auto it = queue[1].begin(); it != queue[1].end(); ++it)
76  {
77  if(*it == p)
78  {
79  return true;
80  }
81  }
82  return false;
83 }
84 
89 void Change::getAddQueue(std::deque<Point>* cpChange)
90 {
91  *cpChange = this->queue[0];
92 }
93 
98 void Change::getRmQueue(std::deque<Point>* cpChange)
99 {
100  *cpChange = this->queue[1];
101 }
void getRmQueue(std::deque< Point > *cpChange)
method to get a copy of removal array
Definition: change.cpp:98
bool addPoint(Point p)
adds Point to addition array if it fits the criteria
Definition: change.cpp:28
short x
Definition: common.h:55
void initQueue()
Initializes change array, by resetting it.
Definition: change.cpp:17
bool rmPoint(Point p)
adds Point to removal array if it fits the criteria
Definition: change.cpp:43
Definitions and prototypes for Change class.
void getAddQueue(std::deque< Point > *cpChange)
method to get a copy of addition array
Definition: change.cpp:89
bool inAddQueue(Point p)
Check if Points is in the addition queue.
Definition: change.cpp:57
bool inRmQueue(Point p)
Check if the Point is in the remove queue.
Definition: change.cpp:73
short y
Definition: common.h:56
std::deque< Point > queue[2]
Definition: change.h:24
Coordinates and style of the cell in console window.
Definition: common.h:52