22 #ifndef FIFE_TRIGGER_H 23 #define FIFE_TRIGGER_H 41 class TriggerChangeListener;
103 Trigger(
const std::string& name);
140 const std::string&
getName()
const {
return m_name; };
162 const std::vector<TriggerCondition>& getTriggerConditions();
174 void enableForInstance(
Instance* instance);
178 const std::vector<Instance*>& getEnabledInstances();
184 void disableForInstance(
Instance* instance);
188 void enableForAllInstances();
192 bool isEnabledForAllInstances();
196 void disableForAllInstances();
216 void assign(
Cell* cell);
222 void remove(
Cell* cell);
226 const std::vector<Cell*>& getAssignedCells();
TriggerChangeListener * m_changeListener
main change listener (cell and instance listener)
virtual ~ITriggerListener()
std::string m_name
name of the trigger. This should be unique per Map.
Base class for all fife classes Used e.g.
const std::string & getName() const
Gets the name of the trigger.
std::vector< ITriggerListener * > m_triggerListeners
Vector of the listeners that get called.
bool m_enabledAll
true if the trigger is enabled for all instances
A basic cell on a CellCache.
std::vector< Instance * > m_enabledInstances
all enabled instances
Instance * m_attached
instance where the trigger is attached to
Instance * getAttached()
Returns pointer to instance where the trigger is attached to.
std::vector< TriggerCondition > m_triggerConditions
all trigger conditions
Trigger get triggered when a specific set of criteria are met.
bool m_triggered
true if this trigger has been triggered
virtual void onTriggered()=0
bool isTriggered()
Returns if the trigger has been triggered.
An Instance is an "instantiation" of an Object at a Location.
std::vector< Cell * > m_assigned
cells in which the trigger is assigned