added not complete take over playeer command.
This commit is contained in:
parent
1b3702db8a
commit
bfa7be68a9
2 changed files with 35 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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 "<take over player>"; }
|
||||
|
||||
void apply( Player *player, State *state) const;
|
||||
bool ready(const Player *player, const State *state) const;
|
||||
|
||||
private:
|
||||
int m_otherPlayerId;
|
||||
};
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue