feat: added GameRoot::get_game_mode and a get_game_state shorthand
parent
c85947f187
commit
51c9090d10
|
@ -138,6 +138,14 @@ void GameRoot::set_game_mode(Ref<GameMode> prototype) {
|
|||
} while(new_player_id != 0);
|
||||
}
|
||||
|
||||
Ref<GameMode> GameRoot::get_game_mode() const {
|
||||
return this->game_mode;
|
||||
}
|
||||
|
||||
Ref<GameState> GameRoot::get_game_state() const {
|
||||
return this->game_mode->get_game_state();
|
||||
}
|
||||
|
||||
IPlayer *GameRoot::spawn_player(uint32_t id) {
|
||||
UtilityFunctions::push_error("GameRoot::spawn_player not implemented");
|
||||
return nullptr;
|
||||
|
|
|
@ -45,6 +45,8 @@ public:
|
|||
// override the current gamemode
|
||||
// force-respawns all players
|
||||
void set_game_mode(Ref<GameMode> prototype);
|
||||
Ref<GameMode> get_game_mode() const;
|
||||
Ref<GameState> get_game_state() const;
|
||||
protected:
|
||||
// attempt to make 'this' the current singleton instance
|
||||
void grab_singleton();
|
||||
|
|
Loading…
Reference in New Issue