-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMapObject.cpp
33 lines (30 loc) · 863 Bytes
/
MapObject.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
#include "include/MapObject.h"
MapObject::MapObject()
{
this->pos = MatrixVector2{0, 0};
this->prev_pos = MatrixVector2{0, 0};
this->c = ' ';
this->bg = RGB{0, 0, 0};
this->fg = RGB{0, 0, 0};
this->is_null = true;
}
MapObject::MapObject(MatrixVector2 pos, char c, RGB bg, RGB fg)
{
this->pos = pos;
this->prev_pos = pos;
this->c = c;
this->bg = bg;
this->fg = fg;
this->is_null = false;
}
MatrixVector2 MapObject::GetPos() { return pos; }
MatrixVector2 MapObject::GetPrevPos() { return prev_pos; }
char MapObject::GetChar() { return c; }
RGB MapObject::GetBg() { return bg; }
RGB MapObject::GetFg() { return fg; }
bool MapObject::IsNull() { return is_null; }
void MapObject::SetPos(MatrixVector2 new_pos)
{
prev_pos = pos;
pos = new_pos;
}