2024-12-02 17:47:09 +01:00
|
|
|
#include "std_lib_inc.h"
|
2024-12-17 14:22:03 +01:00
|
|
|
#include "Maze.h"
|
2024-12-14 17:32:06 +01:00
|
|
|
#include "PositionVector.h"
|
2024-12-16 23:20:04 +01:00
|
|
|
#include "MazeParser.h"
|
2024-12-17 14:22:03 +01:00
|
|
|
#include "Game.h"
|
2024-12-17 14:35:22 +01:00
|
|
|
#include "Exceptions/ExitGame.h"
|
2024-12-17 14:22:03 +01:00
|
|
|
#include "Exceptions/MalformedMaze.h"
|
|
|
|
#include "Exceptions/MovementNotPossible.h"
|
|
|
|
#include "Exceptions/UnkownAction.h"
|
2024-12-02 17:47:09 +01:00
|
|
|
|
2024-12-14 17:32:06 +01:00
|
|
|
using game::Player;
|
|
|
|
using game::PositionVector;
|
|
|
|
using game::Maze;
|
2024-12-16 23:20:04 +01:00
|
|
|
using game::MazeParser;
|
2024-12-17 14:22:03 +01:00
|
|
|
using game::Game;
|
|
|
|
|
|
|
|
using game_exceptions::MalformedMaze;
|
|
|
|
using game_exceptions::UnkownAction;
|
|
|
|
using game_exceptions::MovementNotPossible;
|
2024-12-17 14:35:22 +01:00
|
|
|
using game_exceptions::ExitGame;
|
2024-12-02 17:47:09 +01:00
|
|
|
|
2024-12-14 17:32:06 +01:00
|
|
|
// Ein Programm, welches dir erlaubt ein Labyrinth zu erkunden mit 'w', 'a', 's', und 'd'.
|
2024-12-02 17:47:09 +01:00
|
|
|
|
2024-12-14 17:32:06 +01:00
|
|
|
int main()
|
2024-12-02 17:47:09 +01:00
|
|
|
{
|
2024-12-16 23:20:04 +01:00
|
|
|
try
|
|
|
|
{
|
2024-12-17 14:22:03 +01:00
|
|
|
// Erstelle eine Variable, in der wir das eingelesene Labyrinth speichern
|
|
|
|
Game game = Game();
|
|
|
|
|
|
|
|
// Starte das Spiel
|
|
|
|
game.run_game();
|
2024-12-16 23:21:24 +01:00
|
|
|
}
|
2024-12-17 14:22:03 +01:00
|
|
|
catch (MalformedMaze& _)
|
2024-12-16 23:20:04 +01:00
|
|
|
{
|
2024-12-16 23:44:01 +01:00
|
|
|
// Das Labyrinth einlesen hat nicht geklappt. Gebe Fehlermeldung aus und beende das Programm.
|
2024-12-16 23:20:04 +01:00
|
|
|
cout << "Fehler beim Einlesen des Labyrinths.\n";
|
|
|
|
return 0;
|
2024-12-17 14:39:33 +01:00
|
|
|
} catch (ExitGame& _)
|
2024-12-17 14:35:22 +01:00
|
|
|
{
|
2024-12-17 14:39:33 +01:00
|
|
|
cout << "Schoenen Tag noch!" << "\n";
|
2024-12-16 23:20:04 +01:00
|
|
|
}
|
|
|
|
|
2024-12-14 17:32:06 +01:00
|
|
|
|
|
|
|
// Beende das Programm
|
2024-12-02 17:47:09 +01:00
|
|
|
return 0;
|
2024-12-14 17:32:06 +01:00
|
|
|
}
|