00001 //////////////////////////////////////////////////////////////////////////////// 00002 // Scorched3D (c) 2000-2009 00003 // 00004 // This file is part of Scorched3D. 00005 // 00006 // Scorched3D is free software; you can redistribute it and/or modify 00007 // it under the terms of the GNU General Public License as published by 00008 // the Free Software Foundation; either version 2 of the License, or 00009 // (at your option) any later version. 00010 // 00011 // Scorched3D is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 // GNU General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU General Public License 00017 // along with Scorched3D; if not, write to the Free Software 00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 //////////////////////////////////////////////////////////////////////////////// 00020 00021 #if !defined(AFX_TankAICurrentTarget_H__5F21C9C7_0F71_4CCC_ABB9_976CF0A5C5EC__INCLUDED_) 00022 #define AFX_TankAICurrentTarget_H__5F21C9C7_0F71_4CCC_ABB9_976CF0A5C5EC__INCLUDED_ 00023 00024 #include <list> 00025 #include <map> 00026 00027 class Target; 00028 class Tank; 00029 class XMLNode; 00030 class TankAICurrentTarget 00031 { 00032 public: 00033 TankAICurrentTarget(); 00034 virtual ~TankAICurrentTarget(); 00035 00036 virtual bool parseConfig(XMLNode *node); 00037 00038 void clear(); 00039 void getTargets(Tank *tank, std::list<Tank *> &targets); 00040 00041 void gaveDamage(Tank *tank, float damage); 00042 void tookDamage(Tank *tank, float damage); 00043 void shotAt(Tank *tank); 00044 00045 float getTotalDamageTaken(); 00046 00047 protected: 00048 std::map<Tank *, float> damageGiven_; 00049 std::map<Tank *, float> damageTaken_; 00050 std::map<Tank *, float> shotAt_; 00051 00052 float health_; 00053 float random_; 00054 float score_; 00055 float damagedone_; 00056 float damagetaken_; 00057 float shield_; 00058 float repeat_; 00059 float player_; 00060 float distance_; 00061 00062 float rankPlayer(std::list<Tank *> &players, Tank *player); 00063 float rankPlayer(std::multimap<float, Tank *> &players, Tank *player); 00064 }; 00065 00066 #endif // !defined(AFX_TankAICurrentTarget_H__5F21C9C7_0F71_4CCC_ABB9_976CF0A5C5EC__INCLUDED_)
1.5.3