#ifndef UNITTYPE_H
#define UNITTYPE_H
+#include <map>
+#include <vector>
+#include <string>
-/**
- *@author Michael Andreen
+//!This class contains a unittype, with all it's attributes + the number you got.
+//
+/**This class contains a unittype, with all it's attributes + the number you got.
+ * Maybe this actually should be a struct, since this class doen't have much to do, since i want it to be as generic as possible.
+ * It got some data need need to be taken care of which makes me put it as a class.
+ * \todo need to add some more constructors..
+ *@author Michael Andreen <whale@linux.nu>
+ *@see Fleet
*/
-class UnitType {
+class UnitType
+{
public:
UnitType();
~UnitType();
+
+ /*! This function sets the name for this unittype (ie. interceptor) */
+ void setName(std::string sName);
+ /** Returns the name of this unittype */
+ std::string Name() const;
+
+ /** This functions sets which race this unittype is, the race is represented with a integer. */
+ void setRace(int iRace);
+ /** Returns the race this unittype belongs to*/
+ int race() const;
+
+ /** Sets the class for the unittype, it's represented as a integer */
+ void setUnitClass(std::string sClass);
+ std::string unitClass() const;
+
+ /** Sets the classes that this unittype targets. a vector is used. */
+ void setTarget(std::vector<std::string> Target);
+ /** This function adds a target class to the end of the target list. */
+ void addTarget(std::string target);
+ /** This function inserts a target class into the target list. The default is in the beginning.
+ * \param iTarget an integer that represents the target's class.
+ * \param index where to place the target. 0 being the default and first place. */
+ void insTarget(std::string iTarget, int index = 0);
+ /** Returns all targets from the target list */
+ std::vector<std::string> target() const;
+ /** Returns a specific target
+ * \param index An index value that represents the target. 0 being the first*/
+ std::string target(int index) const;
+
+ /** Sets the initiatve, the lower it is the earlier the unit shots */
+ void setInitiative(int iInit);
+ int initiative() const;
+
+ /** Sets the agility, the higher it is the harder it is to hit the unit */
+ void setAgility (int iAgil);
+ int agility() const;
+
+ /** Sets the weaponspeed.. just a simple integer that shows how good it is at hitting things */
+ void setWeaponSpeed(int iWPSP);
+ int weaponSpeed() const;
+
+ /** Sets the number of guns. */
+ void setGuns(int iGuns);
+ int guns() const;
+
+ /** Sets the how much power the guns have.. or in other words: the damage they do. */
+ void setPower(int iPower);
+ int power() const;
+
+ /** Sets the armor, this is how much damage the unittype can take before it's destroyed */
+ void setArmor(int iArmor);
+ int armor() const;
+
+ /** Sets the emp resistance, the lower value the easier it is to block it */
+ void setEMP(int iEMP);
+ int EMP() const;
+
+ /** Sets the resource cost for this unittype. Used for example for score calculation and so on. */
+ void setTotalResources(int iTR);
+ /** Returns the number of total resources this unittype cost. */
+ int totRes() const;
+
+ /** Sets the fuelcost for this unittype */
+ void setFuel(int iFuel);
+ /** Returns the fuelcost */
+ int fuel() const;
+
+ /** Sets the ETA, the speed in a sort of inverted form.. the lower ETA, the faster is the unit */
+ void setETA(int iETA);
+ int ETA() const;
+
+ /** Sets the type of the unit. What the types do must be specified in the real battle engine (Fleet) though.
+ * \param iType An integer to symbolise the type. */
+ void setType(std::string type);
+ /** What type of ship this is. */
+ std::string type() const;
+
+protected:
+ std::string m_sName;
+ int m_iRace; //!< Not really the race, but an indiaction on what race can use it..
+ std::string m_sClass;
+ std::vector<std::string> m_vTarget;
+ int m_iInitiative;
+ int m_iAgility;
+ int m_iWeaponSpeed;
+ int m_iGuns;
+ int m_iPower;
+ int m_iArmor;
+ int m_iEMP;
+ int m_iTotalResources;
+ std::string m_sType; //!< normal,emp,cloak,steal,pod
+ int m_iETA;
+ int m_iFuel;
};
#endif