00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00030 #if !defined(BattlePlan_h)
00031 #define BattlePlan_h
00032
00033 class TiXmlNode;
00034 class Player;
00035
00036 typedef unsigned long BPTactic;
00037
00043 class BattlePlan {
00044 public:
00045 BattlePlan(bool defined);
00046
00047 virtual ~BattlePlan();
00048 void SetDefault();
00049
00050 bool ParseNode(const TiXmlNode * node, Player * owner);
00051 void WriteNode(TiXmlNode * node) const;
00052 void WriteNodeBattle(TiXmlNode * node) const;
00053 bool IsDefined() const { return mDefined; }
00054 void Undefine() { mDefined = false; }
00055 unsigned long GetEnemy() const { return mEnemy; }
00056 HullType GetPrimary() const { return mPrimary; }
00057 HullType GetSecondary() const { return mSecondary; }
00058 BPTactic GetTactic() const { return mTactic; }
00059
00060 bool WillFight(const Player * attacker, const Player * defender) const;
00061
00062 protected:
00063 static HullType GetTarget(const char *ptr);
00064 static const char * WriteTarget(HullType target);
00065 string mName;
00066 HullType mPrimary;
00067 HullType mSecondary;
00068 BPTactic mTactic;
00069 unsigned long mEnemy;
00070 bool mDumpCargo;
00071 bool mDefined;
00072 };
00073
00074
00075 const BPTactic BPT_DISENGAGE = 0x0001;
00076 const BPTactic BPT_DISIFHIT = 0x0002;
00077 const BPTactic BPT_MINDAM = 0x0004;
00078 const BPTactic BPT_MAXNET = 0x0008;
00079 const BPTactic BPT_MAXRATIO = 0x0010;
00080 const BPTactic BPT_MAXDAM = 0x0020;
00081
00082
00083 const unsigned long BPE_NONE = ULONG_MAX - 1;
00084 const unsigned long BPE_ENEMY = ULONG_MAX - 2;
00085 const unsigned long BPE_ENEMYNEUTRAL = ULONG_MAX - 3;
00086 const unsigned long BPE_ALL = ULONG_MAX - 4;
00087
00088 #endif // !defined(BattlePlan_h)