1 /***************************************************************************
2 unittype.h - description
4 begin : Tue Jan 22 2002
5 copyright : (C) 2002 by Michael Andreen
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
25 //!This class contains a unittype, with all it's attributes + the number you got.
27 /**This class contains a unittype, with all it's attributes + the number you got.
28 * 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.
29 * It got some data need need to be taken care of which makes me put it as a class.
30 *@author Michael Andreen <whale@linux.nu>
40 /*! This function sets the name for this unittype (ie. interceptor) */
41 void setName(std::string sName);
42 /** Returns the name of this unittype */
45 /** This functions sets which race this unittype is, the race is represented with a integer. */
46 void setRace(int iRace);
47 /** Returns the race this unittype belongs to*/
50 /** Sets the class for the unittype, it's represented as a integer */
51 void setClass(int iClass);
54 /** Sets the classes that this unittype targets. a vector is used. */
55 void setTarget(std::vector<int> Target);
56 /** This function adds a target class to the end of the target list. */
57 void addTarget(int iTarget);
58 /** This function inserts a target class into the target list. The default is in the beginning.
59 * \param iTarget an integer that represents the target's class.
60 * \param index where to place the target. 0 being the default and first place. */
61 void insTarget(int iTarget, int index = 0);
62 /** Returns all targets from the target list */
63 std::vector<int> Target();
64 /** Returns a specific target
65 * \param index An index value that represents the target. 0 being the first*/
66 int Target(int index);
68 /** Sets the initiatve, the lower it is the earlier the unit shots */
69 void setInitiative(int iInit);
72 /** Sets the agility, the higher it is the harder it is to hit the unit */
73 void setAgility (int iAgil);
76 /** Sets the weaponspeed.. just a simple integer that shows how good it is at hitting things */
77 void setWeaponSpeed(int iWPSP);
80 /** Sets the number of guns. */
81 void setGuns(int iGuns);
84 /** Sets the how much power the guns have.. or in other words: the damage they do. */
85 void setPower(int iPower);
88 /** Sets the armor, this is how much damage the unittype can take before it's destroyed */
89 void setArmor(int iArmor);
92 /** Sets the emp resistance, the lower value the easier it is to block it */
93 void setEMP(int iEMP);
96 /** Sets the resource cost for this unittype. Used for example for score calculation and so on. */
97 void setTotalResources(int iTR);
98 /** Returns the number of total resources this unittype cost. */
101 /** Sets the fuelcost for this unittype */
102 void setFuel(int iFuel);
103 /** Returns the fuelcost */
106 /** Sets the ETA, the speed in a sort of inverted form.. the lower ETA, the faster is the unit */
107 void setETA(int iETA);
110 /** Sets the type of the unit. What the types do must be specified in the real battle engine (Fleet) though.
111 * \param iType An integer to symbolise the type. */
112 void setType(int iType);
113 /** What type of ship this is. */
117 int m_iRace; //!< Not really the race, but an indiaction on what race can use it..
119 std::vector<int> m_vTarget;
127 int m_iTotalResources;
128 int m_iType; //!< normal,emp,cloak,steal,pod