diff options
Diffstat (limited to 'frontend/cmd/go.cpp')
-rw-r--r-- | frontend/cmd/go.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/frontend/cmd/go.cpp b/frontend/cmd/go.cpp index 9565e99..6a5f3b2 100644 --- a/frontend/cmd/go.cpp +++ b/frontend/cmd/go.cpp @@ -1,7 +1,7 @@ #include "backend/Location.h" #include "backend/print.h" -#include "../Player.h" +#include "../GameController.h" #include "../strings.h" using namespace std; @@ -13,7 +13,7 @@ static const unordered_map<string, Direction> direction_map = { { "west", Direction::WEST }, }; -FollowupAction Player::cmd_go(string & argv) { +FollowupAction GameController::cmd_go(string & argv) { string direction_str = str_consume_arg(argv); if (direction_str.size() == 0 || !direction_map.contains(direction_str)) { lprtf("Fout, gebruik: Ga <noord|zuid|oost|west>\n"); @@ -21,13 +21,13 @@ FollowupAction Player::cmd_go(string & argv) { } Direction direction = direction_map.at(direction_str); - Location * next_location = this->location.get_exit(direction); + Location * next_location = this->player.get_location().get_exit(direction); if (next_location == nullptr) { lprtf("Er is geen uitgang in deze richting!\n"); return FollowupAction::NONE; } - this->location = *next_location; + this->player.set_location(*next_location); return FollowupAction::UPDATE; } |