diff --git a/game/state/commands.cpp b/game/state/commands.cpp index 5dac8e0..1a64d89 100644 --- a/game/state/commands.cpp +++ b/game/state/commands.cpp @@ -66,4 +66,18 @@ namespace game { } } } + +#if 0 + bool TakeOverPlayerCommand::ready(const Player *player, const State *state) const + { + (void) state; + return state->havePlayerGrantFor(player->id, m_otherPlayerId); + } + + void TakeOverPlayerCommand::apply(Player *player, State *state) const + { + if ( + state->playerGrant(player->id, m_otherPlayerId); + } +#endif } diff --git a/game/state/commands.hpp b/game/state/commands.hpp index 4ed914f..dd88c0c 100644 --- a/game/state/commands.hpp +++ b/game/state/commands.hpp @@ -116,4 +116,25 @@ namespace game { private: float m_speed; }; + +#if 0 + /** + * Take over a session for a player that left. + * An admin must confirm this command. + */ + class TakeOverPlayerCommand : public Command { + public: + TakeOverPlayerCommand(int otherPlayerId) : m_otherPlayerId(otherPlayerId) + { + } + + std::string name() const { return ""; } + + void apply( Player *player, State *state) const; + bool ready(const Player *player, const State *state) const; + + private: + int m_otherPlayerId; + }; +#endif }