|
@@ -51,34 +51,35 @@ public:
|
|
|
/// Class which manages slots of upper and lower garrison, splitting of units
|
|
|
class CGarrisonInt :public CIntObject
|
|
|
{
|
|
|
- CGarrisonSlot *highlighted; //chosen slot. Should be changed only via selectSlot
|
|
|
+ /// Chosen slot. Should be changed only via selectSlot.
|
|
|
+ CGarrisonSlot *highlighted;
|
|
|
bool inSplittingMode;
|
|
|
|
|
|
public:
|
|
|
- void selectSlot(CGarrisonSlot * slot); //null = deselect
|
|
|
+ void selectSlot(CGarrisonSlot * slot); ///< @param slot null = deselect
|
|
|
const CGarrisonSlot * getSelection();
|
|
|
|
|
|
void setSplittingMode(bool on);
|
|
|
bool getSplittingMode();
|
|
|
|
|
|
- int interx; //space between slots
|
|
|
- Point garOffset; //offset between garrisons (not used if only one hero)
|
|
|
- std::vector<CButton *> splitButtons; //may be empty if no buttons
|
|
|
+ int interx; ///< Space between slots
|
|
|
+ Point garOffset; ///< Offset between garrisons (not used if only one hero)
|
|
|
+ std::vector<CButton *> splitButtons; ///< May be empty if no buttons
|
|
|
|
|
|
- SlotID p2; //TODO: comment me
|
|
|
- int shiftPos;//1st slot of the second row, set shiftPoint for effect
|
|
|
+ SlotID p2; ///< TODO: comment me
|
|
|
+ int shiftPos; ///< 1st slot of the second row, set shiftPoint for effect
|
|
|
bool pb,
|
|
|
- smallIcons, //true - 32x32 imgs, false - 58x64
|
|
|
- removableUnits,//player can remove units from up
|
|
|
- twoRows,//slots will be placed in 2 rows
|
|
|
- owned[2];//player owns up or down army [0] upper, [1] lower
|
|
|
+ smallIcons, ///< true - 32x32 imgs, false - 58x64
|
|
|
+ removableUnits, ///< player Can remove units from up
|
|
|
+ twoRows, ///< slots Will be placed in 2 rows
|
|
|
+ owned[2]; ///< player Owns up or down army ([0] upper, [1] lower)
|
|
|
|
|
|
-// const CCreatureSet *set1; //top set of creatures
|
|
|
-// const CCreatureSet *set2; //bottom set of creatures
|
|
|
+// const CCreatureSet *set1; ///< Top set of creatures
|
|
|
+// const CCreatureSet *set2; ///< Bottom set of creatures
|
|
|
|
|
|
- std::vector<CGarrisonSlot*> slotsUp, slotsDown; //slots of upper and lower garrison
|
|
|
- const CArmedInstance *armedObjs[2]; //[0] is upper, [1] is down
|
|
|
- //const CArmedInstance *oup, *odown; //upper and lower garrisons (heroes or towns)
|
|
|
+ std::vector<CGarrisonSlot*> slotsUp, slotsDown; ///< Slots of upper and lower garrison
|
|
|
+ const CArmedInstance *armedObjs[2]; ///< [0] is upper, [1] is down
|
|
|
+ //const CArmedInstance *oup, *odown; ///< Upper and lower garrisons (heroes or towns)
|
|
|
|
|
|
void setArmy(const CArmedInstance *army, bool bottomGarrison);
|
|
|
void addSplitBtn(CButton * button);
|
|
@@ -87,16 +88,26 @@ public:
|
|
|
void createSlots();
|
|
|
void recreateSlots();
|
|
|
|
|
|
- void splitClick(); //handles click on split button
|
|
|
- void splitStacks(int amountLeft, int amountRight); //TODO: comment me
|
|
|
- //x, y - position;
|
|
|
- //inx - distance between slots;
|
|
|
- //pomsur, SurOffset - UNUSED
|
|
|
- //s1, s2 - top and bottom armies;
|
|
|
- //removableUnits - you can take units from top;
|
|
|
- //smallImgs - units images size 64x58 or 32x32;
|
|
|
- //twoRows - display slots in 2 row (1st row = 4 slots, 2nd = 3 slots)
|
|
|
- CGarrisonInt(int x, int y, int inx, const Point &garsOffset, SDL_Surface *pomsur, const Point &SurOffset, const CArmedInstance *s1, const CArmedInstance *s2=nullptr, bool _removableUnits = true, bool smallImgs = false, bool _twoRows=false); //c-tor
|
|
|
+ void splitClick(); ///< handles click on split button
|
|
|
+ void splitStacks(int amountLeft, int amountRight); ///< TODO: comment me
|
|
|
+
|
|
|
+ /// Constructor
|
|
|
+ /// @param x, y Position
|
|
|
+ /// @param inx Distance between slots;
|
|
|
+ /// @param garsOffset
|
|
|
+ /// @param pomsur, SurOffset UNUSED
|
|
|
+ /// @param s1, s2 Top and bottom armies
|
|
|
+ /// @param _removableUnits You can take units from top
|
|
|
+ /// @param smallImgs Units images size 64x58 or 32x32
|
|
|
+ /// @param _twoRows Display slots in 2 row (1st row = 4 slots, 2nd = 3 slots)
|
|
|
+ CGarrisonInt(int x, int y,
|
|
|
+ int inx,
|
|
|
+ const Point &garsOffset,
|
|
|
+ SDL_Surface *pomsur, const Point &SurOffset,
|
|
|
+ const CArmedInstance *s1, const CArmedInstance *s2=nullptr,
|
|
|
+ bool _removableUnits = true,
|
|
|
+ bool smallImgs = false,
|
|
|
+ bool _twoRows=false);
|
|
|
};
|
|
|
|
|
|
class CGarrisonHolder
|