00001 #ifndef WEAPONTYPE_H 00002 #define WEAPONTYPE_H 00003 #include <string> 00004 #include <set> 00005 #include <ExplosionType.h> 00006 00007 namespace FastEcslent 00008 { 00009 class WeaponType 00010 { 00011 public: 00012 WeaponType(); 00013 WeaponType(int id); 00014 WeaponType(const WeaponType& other); 00015 WeaponType& operator=(const WeaponType& other); 00016 bool operator==(const WeaponType& other) const; 00017 bool operator!=(const WeaponType& other) const; 00018 bool operator<(const WeaponType& other) const; 00019 00021 int getID() const; 00022 00024 std::string getName() const; 00025 00027 //UnitType whatUses() const; 00028 00030 int damageAmount() const; 00031 00032 // TODO: add doc 00033 int damageBonus() const; 00034 00036 int damageCooldown() const; 00037 00040 int damageFactor() const; 00041 00043 ExplosionType explosionType() const; 00044 00047 int minRange() const; 00048 00050 int maxRange() const; 00051 00053 int innerSplashRadius() const; 00054 00056 int medianSplashRadius() const; 00057 00059 int outerSplashRadius() const; 00060 00062 bool targetsAir() const; 00063 00064 // TODO: group these methods 00066 bool targetsGround() const; 00067 bool targetsOwn() const; 00068 private: 00069 int id; 00070 }; 00071 00072 namespace WeaponTypes 00073 { 00075 WeaponType getWeaponType(std::string name); 00076 00078 std::set<WeaponType>& allWeaponTypes(); 00079 00081 std::set<WeaponType>& normalWeaponTypes(); 00082 00084 std::set<WeaponType>& specialWeaponTypes(); 00085 void init(); 00086 extern const WeaponType Fusion_Cutter; 00087 extern const WeaponType Rifle; 00088 extern const WeaponType Hellfire; 00089 extern const WeaponType Cannon; 00090 extern const WeaponType None; 00091 extern const WeaponType Unknown; 00092 } 00093 } 00094 #endif