forked from SharifAIChallenge/AIC17-Client-Cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEntity.cpp
More file actions
38 lines (30 loc) · 613 Bytes
/
Copy pathEntity.cpp
File metadata and controls
38 lines (30 loc) · 613 Bytes
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
#include "Entity.h"
Entity::Entity(int id, Cell* cell, EntityType type) :
id(id), cell(cell), entityType(type) {
creationTurn = globalTurn;
cell->setEntity(this);
}
Entity::~Entity() {
}
int Entity::getId() const
{
return this->id;
}
Cell* Entity::getPosition() const
{
return this->cell;
}
EntityType Entity::getType() const
{
return this->entityType;
}
inline bool operator == (const Entity& lhs, const Entity& rhs)
{
return lhs.getId() == rhs.getId();
}
Cell* Entity::getCell() const {
return this->cell;
}
void Entity::setPosition(int row, int col) {
this->cell->setPosition(row, col);
}