35 #ifndef _MultiTrigger_H__ 36 #define _MultiTrigger_H__ 105 virtual void tick(
float dt);
112 {
return this->isActive(
nullptr); }
113 bool isActive(
BaseObject* triggerer =
nullptr)
const;
120 {
if(triggerers >= 0 || triggerers ==
TriggerBase::INF_s) this->maxNumSimultaneousTriggerers_ = triggerers; }
126 {
return this->maxNumSimultaneousTriggerers_; }
133 { this->bBroadcast_ = bBroadcast; }
139 {
return this->bBroadcast_; }
147 {
if(target ==
nullptr)
return true;
else return targetMask_.isIncluded(target->
getIdentifier()); }
152 virtual std::queue<MultiTriggerState*>* letTrigger(
void);
156 bool isModeTriggered(
BaseObject* triggerer =
nullptr);
157 bool isTriggered(
BaseObject* triggerer =
nullptr);
169 {
return this->targetMask_; }
185 {
return this->active_; }
202 #endif // _MultiTrigger_H__ #define _ObjectsExport
Definition: ObjectsPrereqs.h:60
ClassTreeMask & getTargetMask(void)
Get the target mask used to identify the targets of this MultiTrigger.
Definition: MultiTrigger.h:168
The BaseObject is the parent of all classes representing an instance in the game. ...
Definition: BaseObject.h:63
The ClassTreeMask is a set of rules, containing the information for each class whether it's included ...
Definition: ClassTreeMask.h:187
Identifier * getIdentifier() const
Returns the Identifier of the object.
Definition: Identifiable.h:60
static const int INF_s
Magic number for infinity.
Definition: TriggerBase.h:177
bool bTriggered
Definition: MultiTrigger.h:60
void setSimultaneousTriggerers(int triggerers)
Set the number of objects that are allowed to simultaneously trigger this MultiTrigger.
Definition: MultiTrigger.h:119
::std::string string
Definition: gtest-port.h:756
Declaration of the ClassTreeMask, ClassTreeMaskNode, and ClassTreeMaskIterator classes.
void setBroadcast(bool bBroadcast)
Set the broadcast-mode of the MultiTrigger.
Definition: MultiTrigger.h:132
std::set< BaseObject * > & getActive(void)
Get the objects for which this MultiTrigger is active.
Definition: MultiTrigger.h:184
ClassTreeMask targetMask_
The target mask, masking all objects that can trigger this MultiTrigger.
Definition: MultiTrigger.h:196
bool isTarget(BaseObject *target)
Get whether the input object is a target of the MultiTrigger.
Definition: MultiTrigger.h:146
xmlelement
Definition: Super.h:519
std::deque< std::pair< float, MultiTriggerState * > > stateQueue_
The queue of states waiting to become active.
Definition: MultiTrigger.h:194
The TriggerBase class is a base class for the two types of triggers, the (normal) Triggers and the Mu...
Definition: TriggerBase.h:70
std::set< BaseObject * > active_
The set of all objects the MultiTrigger is active for.
Definition: MultiTrigger.h:191
bool bBroadcast_
Bool for the broadcast-mode, if true all triggers go to all possible targets.
Definition: MultiTrigger.h:189
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
bool isActive(void) const
Check whether the MultiTrigger is active.
Definition: MultiTrigger.h:111
Mode
Definition: CorePrereqs.h:102
BaseObject * originator
Definition: MultiTrigger.h:59
Declaration of BaseObject, the base class of all objects in Orxonox.
std::set< BaseObject * > triggered_
The set of all objects the MultiTrigger is triggered for.
Definition: MultiTrigger.h:192
bool getBroadcast(void)
Get the broadcast-mode of the MultiTrigger.
Definition: MultiTrigger.h:138
Shared library macros, enums, constants and forward declarations for the objects module ...
void status(const std::string &text)
Prints output with status level.
Definition: ConsoleCommandCompilation.cc:153
int maxNumSimultaneousTriggerers_
The maximum number of objects simultaneously trigggering this MultiTrigger.
Definition: MultiTrigger.h:187
Struct to handle MultiTrigger states internally.
Definition: MultiTrigger.h:57
Definition of the TriggerBase class.
int getSimultaneousTriggerers(void)
Get the number of objects that are allowed to simultaneously trigger this MultiTriggger.
Definition: MultiTrigger.h:125
The MultiTrigger class implements a trigger that has a distinct state for each object triggering it...
Definition: MultiTrigger.h:98