equal
deleted
inserted
replaced
|
1 |
|
2 #include "GameState.hh" |
|
3 |
|
4 bool Player::updatePosition (Coordinate p) { |
|
5 if (!state.isValidCoordinate(p)) { |
|
6 // out-of-bounds |
|
7 return false; |
|
8 |
|
9 } else { |
|
10 // valid |
|
11 position = p; |
|
12 |
|
13 return true; |
|
14 } |
|
15 } |
|
16 |
|
17 |
|
18 |