added not complete take over playeer command.

This commit is contained in:
Andreas Ortmann 2016-09-27 23:50:44 +02:00
parent 1b3702db8a
commit bfa7be68a9
2 changed files with 35 additions and 0 deletions

View file

@ -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
} }

View file

@ -116,4 +116,25 @@ namespace game {
private: private:
float m_speed; 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 "<take over player>"; }
void apply( Player *player, State *state) const;
bool ready(const Player *player, const State *state) const;
private:
int m_otherPlayerId;
};
#endif
} }