35 #ifndef _PickupSpawner_H__ 36 #define _PickupSpawner_H__ 85 virtual void tick(
float dt)
override;
92 {
return this->triggerDistance_; }
98 { this->triggerDistance_ = value; }
104 {
return this->respawnTime_; }
110 { this->respawnTime_ = time; }
116 {
return this->maxSpawnedItems_; }
117 void setMaxSpawnedItems(
int items);
123 {
return this->pickupTemplateName_; }
128 {
return this->pickupTemplate_; }
130 void setPickupTemplateName(
const std::string& name);
131 void setPickupTemplate(
Template* temp);
134 void initialize(
void);
137 void respawnTimerCallback();
139 void decrementSpawnsRemaining(
void);
140 void startRespawnTimer(
void);
148 { this->blocked_.insert(std::pair<PickupCarrier*, std::time_t>(carrier, std::time(0)+time)); }
169 static const int INF = -1;
170 static const unsigned int DEFAULT_BLOCKED_TIME = 5;
#define _PickupExport
Definition: PickupPrereqs.h:60
StaticEntity * representation_
The active representation of the spawner.
Definition: PickupSpawner.h:154
The StaticEntity is the simplest derivative of the orxonox::WorldEntity class.
Definition: StaticEntity.h:50
Definition: Template.h:50
Declaration of the Tickable interface.
float getTriggerDistance() const
Get the distance in which to trigger.
Definition: PickupSpawner.h:91
An Interface (or more precisely an abstract class) to model and represent different (all kinds of) pi...
Definition: Pickupable.h:60
::std::string string
Definition: gtest-port.h:756
Template * getPickupTemplate() const
Returns the template which is used to create a pickup for this spawner.
Definition: PickupSpawner.h:127
float respawnTime_
Time after which this gets re-actived.
Definition: PickupSpawner.h:163
const std::string & getPickupTemplateName() const
Returns the name of the template which is used to create a pickup for this spawner.
Definition: PickupSpawner.h:122
int getMaxSpawnedItems(void) const
Get the maximum number of items that will be spawned by this PickupSpawner.
Definition: PickupSpawner.h:115
xmlelement
Definition: Super.h:519
Declaration of the Timer class, used to call functions after a given time-interval.
float triggerDistance_
Distance in which this gets triggered.
Definition: PickupSpawner.h:161
int spawnsRemaining_
Number of items that can be spawned by this PickupSpawner until it selfdestructs. ...
Definition: PickupSpawner.h:159
float getRespawnTime() const
Get the time to respawn.
Definition: PickupSpawner.h:103
std::string pickupTemplateName_
The name of the pickup template.
Definition: PickupSpawner.h:155
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Timer respawnTimer_
Timer used for re-activating.
Definition: PickupSpawner.h:164
Mode
Definition: CorePrereqs.h:102
bool selfDestruct_
True if the PickupSpawner is selfdestructing.
Definition: PickupSpawner.h:167
void block(PickupCarrier *carrier, unsigned int time=DEFAULT_BLOCKED_TIME)
Helper method.
Definition: PickupSpawner.h:147
The PickupSpawner class is responsible for spawning @ref orxonox::Pickupable "Pickupables" of a speci...
Definition: PickupSpawner.h:76
Pickupable * pickup_
The pickup to be spawned.
Definition: PickupSpawner.h:153
The PickupCarrier interface provides the means, for any class implementing it, to possess Pickupables...
Definition: PickupCarrier.h:68
int maxSpawnedItems_
Maximum number of items spawned by this PickupSpawner.
Definition: PickupSpawner.h:158
Shared library macros, enums, constants and forward declarations for the questsystem module ...
std::map< PickupCarrier *, std::time_t > blocked_
Definition: PickupSpawner.h:165
The Tickable interface provides a tick(dt) function, that gets called every frame.
Definition: Tickable.h:52
void setRespawnTime(float time)
Set the time to respawn.
Definition: PickupSpawner.h:109
Timer is a helper class that executes a function after a given amount of seconds in game-time...
Definition: Timer.h:105
Template * pickupTemplate_
The template to be used to create a pickupable.
Definition: PickupSpawner.h:156
void setTriggerDistance(float value)
Set the distance in which to trigger.
Definition: PickupSpawner.h:97
Definition of the Pickupable class.