]> ruin.nu Git - hbs.git/blobdiff - bs/unittype.h
hbs now handles salvage.. not fully correctly yet though, need to fix
[hbs.git] / bs / unittype.h
index cbb73bac9ebdd4dfd2f21791bd1c1554d4b4ec1b..ccff1d1a958a34a7162ca2df70b6f2a31c0b39b5 100644 (file)
@@ -27,9 +27,9 @@
 /**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.. 
+ * \todo need to add some more constructors.., maybe not.. 
   *@author Michael Andreen <whale@linux.nu>
-  *@see Fleet
+  *\sa Fleet Planet
   */
 
 class UnitType 
@@ -43,43 +43,82 @@ public:
        /** 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. */
+       /** This functions sets which race this unittype is
+        * \param iRace the race is represented with a integer.
+        */
        void setRace(int iRace);
-       /** Returns the race this unittype belongs to*/
+       /** Used to get what type of race this is
+        * \returns returns the race as an integer
+        */
        int race() const;
 
-       /** Sets the class for the unittype, it's represented as a integer */
+       /** Sets the class for the unittype
+        * \param sClass the class represented as a string
+        */
        void setUnitClass(std::string sClass);
+       /**  used to get what type of class this unit is
+        * \returns the class as a string
+        */
        std::string unitClass() const;
 
-       /** Sets the classes that this unittype targets. a vector is used. */
+       /** Sets the classes that this unittype targets 
+        * \param Target the target list, as a vector of strings
+        */
        void setTarget(std::vector<std::string> Target);
-       /** This function adds a target class to the end of the target list. */
+
+       /** This function adds a target class to the end of the target list.
+        * \param target the target you want to add, as a string.
+        */
        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. */
+        * \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 */
+       /** Used to get the full target list.
+        * \returns all targets as a vector of strings.
+        * */
        std::vector<std::string> target() const;
        /** Returns a specific target 
-        * \param index An index value that represents the target. 0 being the first*/
+        * \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 */
+       /** Used to set the initiatve, the lower it is the earlier the unit shots
+        * \param iInit the initiative as an int
+        */
        void setInitiative(int iInit);
+       /** Used to get the initiative this unittype got, lower shots first.
+        * \returns the initiative as an int
+        */
        int      initiative() const;
 
-       /** Sets the agility, the higher it is the harder it is to hit the unit */
+       /** Used to set the agility, the higher it is the harder it is to hit the unit
+        * \param iAgil the agility represnted as an int
+        */
        void setAgility (int iAgil);
+       /** used to get this unittype's agility, higher is equal to hard to hit.
+        * \returns the agility as an int
+        */
        int  agility() const;
 
-       /** Sets the weaponspeed.. just a simple integer that shows how good it is at hitting things */
+       /** Used to set the weaponspeed.. Higher is equal to better at hitting
+        * \param iWPSP the weaponspeed represented as an int.
+        */
        void setWeaponSpeed(int iWPSP);
+       /** Used to get what weaponspeed this unittype has
+        * \returns the weaponspeed as an int
+        */
        int  weaponSpeed() const;
 
-       /** Sets the number of guns. */
+       /** Sets the number of guns for this unittype
+        * \param iGuns the number of guns represented as an int
+        */
        void setGuns(int iGuns);
+       /** used to get the number of guns this unittype has
+        * \returns the number of guns as an int
+        */
        int guns() const;
 
        /** Sets the how much power the guns have.. or in other words: the damage they do. */
@@ -95,10 +134,13 @@ public:
        int  EMP() const;
 
        /** Sets the resource cost for this unittype. Used for example for score calculation and so on. */
-       void setTotalResources(int iTR);
+       void setResources(std::string type, int i);
+       void setResources(std::map<std::string, int> res);
        /** Returns the number of total resources this unittype cost. */
        int totRes() const;
 
+       std::map<std::string, int> resources();
+
        /** Sets the fuelcost for this unittype */
        void setFuel(int iFuel);
        /** Returns the fuelcost */
@@ -119,17 +161,17 @@ protected:
        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;
+       int                       m_iInitiative;
+       int                       m_iAgility;
+       int                       m_iWeaponSpeed;
+       int                       m_iGuns;
+       int                       m_iPower;
+       int                       m_iArmor;
+       int                   m_iEMP;
+       std::map<std::string, int> m_Resources;
+       std::string   m_sType;            //!< normal,emp,cloak,steal,pod
+       int                       m_iETA;
+       int                       m_iFuel;
 };
 
 #endif