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(__INCLUDE_TankModelh_INCLUDE__) 00022 #define __INCLUDE_TankModelh_INCLUDE__ 00023 00024 #include <common/ModelID.h> 00025 #include <common/ImageID.h> 00026 #include <common/Vector.h> 00027 #include <set> 00028 #include <string> 00029 00030 class ScorchedContext; 00031 class TankType; 00032 class TankModel 00033 { 00034 public: 00035 TankModel(); 00036 virtual ~TankModel(); 00037 00038 bool initFromXML(ScorchedContext &context, XMLNode *node); 00039 00040 virtual bool lessThan(TankModel *other); 00041 void clear(); 00042 00043 const char *getName() { return tankName_.c_str(); } 00044 const char *getTypeName() { return typeName_.c_str(); } 00045 ModelID &getTankModelID() { return modelId_; } 00046 ModelID &getProjectileModelID() { return projectileModelId_; } 00047 ImageID &getTracksVId() { return tracksVId_; } 00048 ImageID &getTracksHId() { return tracksHId_; } 00049 ImageID &getTracksVHId() { return tracksVHId_; } 00050 ImageID &getTracksHVId() { return tracksHVId_; } 00051 std::set<std::string> &getCatagories() { return catagories_; } 00052 bool getAiOnly() { return aiOnly_; } 00053 bool getMovementSmoke() { return movementSmoke_; } 00054 00055 bool isOfAi(bool ai); 00056 bool isOfCatagory(const char *catagory); 00057 bool isOfTeam(int team); 00058 00059 protected: 00060 bool init_; 00061 bool aiOnly_; 00062 bool movementSmoke_; 00063 std::string tankName_; 00064 std::string typeName_; 00065 ModelID modelId_; 00066 ModelID projectileModelId_; 00067 ImageID tracksVId_; 00068 ImageID tracksHId_; 00069 ImageID tracksVHId_; 00070 ImageID tracksHVId_; 00071 std::set<std::string> catagories_; 00072 std::set<int> teams_; 00073 00074 bool loadImage(XMLNode *node, const char *nodeName, 00075 ImageID &image, const char *backupImage); 00076 }; 00077 00078 #endif
1.5.3