class PlayerStatus;
class Sector;
class Statistics;
-class WorldState;
+class Savegame;
/**
* Screen that runs a Level, where Players run and jump through Sectors.
public Currenton<GameSession>
{
public:
- GameSession(const std::string& levelfile, WorldState& world_state, Statistics* statistics = NULL);
+ GameSession(const std::string& levelfile, Savegame& savegame, Statistics* statistics = NULL);
~GameSession();
void record_demo(const std::string& filename);
void draw(DrawingContext& context);
void update(float frame_ratio);
- void setup();
+ void setup() override;
+ void leave() override;
/// ends the current level
void finish(bool win = true);
* resources for the current level/world
*/
std::string get_working_directory();
- int restart_level();
+ int restart_level(bool after_death = false);
void toggle_pause();
void abort_level();
+ bool is_active() const;
/**
* Enters or leaves level editor mode
*/
void force_ghost_mode();
- WorldState& get_world_state() { return m_world_state; }
+ Savegame& get_savegame() { return m_savegame; }
private:
void check_end_conditions();
int levelnb;
int pause_menu_frame;
- EndSequence* end_sequence;
+ std::shared_ptr<EndSequence> end_sequence;
bool game_pause;
float speed_before_pause;
std::string newspawnpoint;
Statistics* best_level_statistics;
- WorldState& m_world_state;
+ Savegame& m_savegame;
std::ostream* capture_demo_stream;
std::string capture_file;
BonusType bonus_at_start; /** What bonuses does the player have at the start */
int max_fire_bullets_at_start; /** How many fire bullets does the player have */
int max_ice_bullets_at_start; /** How many ice bullets does the player have */
+
+ bool active; /** Game active? **/
private:
GameSession(const GameSession&);