diff --git a/Exceptions/ExitGame.h b/Exceptions/ExitGame.h index 29cabc3..c06a808 100644 --- a/Exceptions/ExitGame.h +++ b/Exceptions/ExitGame.h @@ -1,7 +1,3 @@ -// -// Created by moonleay on 12/17/24. -// - #ifndef EXITGAME_H #define EXITGAME_H diff --git a/Exceptions/MalformedMaze.h b/Exceptions/MalformedMaze.h index 2f0b0f0..01cfa46 100644 --- a/Exceptions/MalformedMaze.h +++ b/Exceptions/MalformedMaze.h @@ -1,7 +1,3 @@ -// -// Created by moonleay on 12/17/24. -// - #ifndef MALFORMEDMAZE_H #define MALFORMEDMAZE_H diff --git a/Exceptions/MovementNotPossible.h b/Exceptions/MovementNotPossible.h index b6db2f0..54e4f6c 100644 --- a/Exceptions/MovementNotPossible.h +++ b/Exceptions/MovementNotPossible.h @@ -1,7 +1,3 @@ -// -// Created by moonleay on 12/17/24. -// - #ifndef MOVEMENTNOTPOSSIBLE_H #define MOVEMENTNOTPOSSIBLE_H diff --git a/Exceptions/UnkownAction.h b/Exceptions/UnkownAction.h index 6be05b0..32f2f2a 100644 --- a/Exceptions/UnkownAction.h +++ b/Exceptions/UnkownAction.h @@ -1,7 +1,3 @@ -// -// Created by moonleay on 12/17/24. -// - #ifndef UNKOWNACTION_H #define UNKOWNACTION_H diff --git a/Game.cpp b/Game.cpp index 6f7a28c..56bad6d 100644 --- a/Game.cpp +++ b/Game.cpp @@ -82,16 +82,11 @@ namespace game try { movement_vector = handle_user_input(game_input); + player.move(this->maze, movement_vector); } catch (UnkownAction& err) { cout << err.what() << "\n"; - } - - try - { - player.move(this->maze, movement_vector); - } - catch (MovementNotPossible& err) + } catch (MovementNotPossible& err) { cout << err.what() << "\n"; } diff --git a/Maze.h b/Maze.h index 9a4cb0d..2c75141 100644 --- a/Maze.h +++ b/Maze.h @@ -29,7 +29,7 @@ namespace game bool was_player_killed_by_ghost(const Player& player) const; /// Kontrolliere, ob der Spieler am Ziel ist - /// @param pos Die Position des Spielers + /// @param player Der Spieler /// @return Ob der Spieler am Ziel ist bool is_player_at_goal(const Player& player) const; @@ -40,7 +40,7 @@ namespace game bool is_pos_free(const PositionVector& pos, const bool& player_has_key) const; /// Zeige das Spielfeld in der Konsole an - /// @param pos Die Position des Spielers + /// @param player Der Spieler void render(const Player& player) const; /// Kriege den Wert einer Position @@ -49,7 +49,7 @@ namespace game char get_field(const PositionVector& pos) const; /// Ersetze den Wert von einer Position - /// @param target_pos Die Position die ersetzt werden soll + /// @param pos Die Position die ersetzt werden soll /// @param target Der Wert, auf den die Position gesetzt werden soll void update_field(const PositionVector& pos, const char& target);