#ifndef CLASS_FACTION_ELEMENT #define CLASS_FACTION_ELEMENT #include #include "Element.h" /* FACTIONS */ #define F_NO_FACTION 0 #define F_MERCENARIES 1 #define F_NGG 2 #define F_SWA 3 /// Element that could belong to a faction class FactionElement : public virtual Element { private: /// id of the faction int _faction; /// flag that is true if the object is selected bool _selected; /// icon image of the element graphic::Image * _icon; public: /// Constructor that specify a faction FactionElement(int r, int c, std::vector < graphic::Image * > images, int faction = F_NO_FACTION) { // set faction _faction = faction; // not selected by default _selected = false; // set the icon for the element _icon = images[(images.size() - 1)]; }; /// Destroyer virtual ~FactionElement() { }; /// return the faction id int GetFaction() { return _faction; }; /// set the faction id void SetFaction(int faction) { _faction = faction; }; /// set selected flag to true void Select() { _selected = true; }; /// set the selected flag to false void Deselect() { _selected = false; }; /// return true if the element is selected bool IsSelected() { return _selected; }; /// return the icon image graphic::Image * GetIcon() { return _icon; }; }; #endif