Ejemplo n.º 1
0
/* Returns the IPlayer that matches the IService [s]; overwize returns 0 */
IPlayer *		RoomManager::operator()(IService * s) const
{

	std::deque<IPlayer *> players = this->hall_->getAllPlayers();

	for (std::deque<IPlayer *>::const_iterator it = players.begin() ;
		it != players.end() ; ++it)
	{
		IPlayer *tmp = *it;

		if (tmp && tmp->getService() == s)
			return tmp;
	}
	return 0;
}
Ejemplo n.º 2
0
void	GameplayEngine::treatPlayersCommands(std::queue<ICommand *>	& cmds)
{
	for (std::deque<IPlayer *>::iterator it = this->players_.begin() ;
				it != this->players_.end() ; ++it)
		{
			IPlayer *fetch = *it;

			ICommand *tmp = dynamic_cast<IClientService *>(fetch->getService())->Zpull();

			if (tmp && tmp->getType() == CommandType::MOVE)
			{
				DEBUG << "MOVE PLAYER" << std::endl;
			}
			else if (tmp && tmp->getType() == CommandType::FIRE)
			{
				DEBUG << "FIRE IN DA F****N HOLE" << std::endl;
			}
		}
}