X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fgame_session.hpp;h=d2cd2dc37cc30c849089a022d816ae4c775e2cb2;hb=5c386075212cf48cba4f940b90ba6e013b179edb;hp=c5ed8259f8089128046e34f37fe94de34357cb80;hpb=5cf95aefef3362677c57c81f3f723c4a0aa7051f;p=supertux.git diff --git a/src/game_session.hpp b/src/game_session.hpp index c5ed8259f..d2cd2dc37 100644 --- a/src/game_session.hpp +++ b/src/game_session.hpp @@ -26,6 +26,7 @@ #include "timer.hpp" #include "statistics.hpp" #include "math/vector.hpp" +#include "console.hpp" /* GameLoop modes */ enum GameSessionMode { @@ -52,7 +53,7 @@ class CodeController; /** The GameSession class controlls the controll flow of a World, ie. present the menu on specifc keypresses, render and update it while keeping the speed and framerate sane, etc. */ -class GameSession +class GameSession : public ConsoleCommandReceiver { public: enum ExitStatus { ES_NONE, ES_LEVEL_FINISHED, ES_GAME_OVER, ES_LEVEL_ABORT }; @@ -90,15 +91,14 @@ public: { return level; } void start_sequence(const std::string& sequencename); - /// called by JoystickKeyboardController after an ascii key has been pressed - void try_cheats(); /** returns the "working directory" usually this is the directory where the * currently played level resides. This is used when locating additional * resources for the current level/world */ std::string get_working_directory(); - + bool consoleCommand(std::string command); /**< callback from Console; return false if command was unknown, true otherwise */ + private: void restart_level(); @@ -156,6 +156,7 @@ private: std::string capture_file; std::istream* playback_demo_stream; CodeController* demo_controller; + Console* console; }; std::string slotinfo(int slot);