From: <geo...@us...> - 2013-06-02 09:19:01
|
Revision: 6100 http://freeorion.svn.sourceforge.net/freeorion/revision/?rev=6100&view=rev Author: geoffthemedio Date: 2013-06-02 09:18:55 +0000 (Sun, 02 Jun 2013) Log Message: ----------- Implemented a couple small "to do" functions in AIInterface.cpp Modified Paths: -------------- trunk/FreeOrion/AI/AIInterface.cpp Modified: trunk/FreeOrion/AI/AIInterface.cpp =================================================================== --- trunk/FreeOrion/AI/AIInterface.cpp 2013-06-02 09:18:19 UTC (rev 6099) +++ trunk/FreeOrion/AI/AIInterface.cpp 2013-06-02 09:18:55 UTC (rev 6100) @@ -57,9 +57,8 @@ return default_state_string; } -void AIBase::SetAggression(int aggr){ - m_aggression = aggr; -} +void AIBase::SetAggression(int aggr) +{ m_aggression = aggr; } ////////////////////////////////// @@ -152,12 +151,15 @@ return player_ids; } - bool PlayerIsAI(int player_id) { - return false; // TODO: implement this - } + bool PlayerIsAI(int player_id) + { return AIClientApp::GetApp()->GetPlayerClientType(player_id) == Networking::CLIENT_TYPE_AI_PLAYER; } bool PlayerIsHost(int player_id) { - return false; // TODO: implement this + const std::map<int, PlayerInfo>& players = AIClientApp::GetApp()->Players(); + std::map<int, PlayerInfo>::const_iterator it = players.find(player_id); + if (it == players.end()) + return false; + return it->second.host; } const Universe& GetUniverse() |