-
Notifications
You must be signed in to change notification settings - Fork 0
/
BodyPart.cpp
29 lines (21 loc) · 966 Bytes
/
BodyPart.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
//
// Created by Daniel Eidlin on 01/08/2020.
//
#include "BodyPart.h"
std::map<Direction, char> BodyPart::directionSymbols = {{Direction::Right, '>'},
{Direction::Left, '<'},
{Direction::Up, '^'},
{Direction::Down, 'v'}};
BodyPart::BodyPart(const std::pair<int, int> &coordinates) : coordinates(coordinates) {}
BodyPart::BodyPart(const std::pair<int, int> &coordinates, Direction direction) : coordinates(coordinates),
direction(direction) {}
BodyPart::~BodyPart() {}
std::pair<int, int> BodyPart::getCoordinates() const {
return coordinates;
}
Direction BodyPart::getDirection() const {
return direction;
}
void BodyPart::setDirection(Direction newDirection) {
direction = newDirection;
}