73 void setConfigValues();
75 virtual void tick(
float dt)
override;
78 {
return this->gtinfo_; }
81 {
return this->gtinfo_->hasStarted(); }
83 {
return this->gtinfo_->hasEnded(); }
87 virtual void playerEntered(
PlayerInfo* player);
91 virtual bool playerChangedName(
PlayerInfo* player);
93 virtual void playerScored(
PlayerInfo* player,
int score = 1);
95 virtual bool allowPawnHit(
Pawn* victim,
Pawn* originator =
nullptr);
96 virtual bool allowPawnDamage(
Pawn* victim,
Pawn* originator =
nullptr);
97 virtual bool allowPawnDeath(
Pawn* victim,
Pawn* originator =
nullptr);
99 virtual void pawnKilled(
Pawn* victim,
Pawn* killer =
nullptr);
100 virtual void pawnPreSpawn(
Pawn* pawn);
101 virtual void pawnPostSpawn(
Pawn* pawn);
102 virtual void playerPreSpawn(
PlayerInfo* player);
103 virtual void playerPostSpawn(
PlayerInfo* player);
105 virtual void playerStartsControllingPawn(
PlayerInfo* player,
Pawn* pawn);
106 virtual void playerStopsControllingPawn(
PlayerInfo* player,
Pawn* pawn);
108 inline const std::map<PlayerInfo*, Player>&
getPlayers()
const 109 {
return this->players_; }
114 { this->spawnpoints_.insert(spawnpoint); }
117 {
return this->gtinfo_->isStartCountdownRunning(); }
119 {
return this->gtinfo_->getStartCountdown(); }
122 { this->gtinfo_->setHUDTemplate(name); }
124 {
return this->gtinfo_->getHUDTemplate(); }
126 virtual void addBots(
unsigned int amount);
127 void killBots(
unsigned int amount = 0);
129 virtual void addTime(
float t);
130 virtual void removeTime(
float t);
134 this->time_ = this->timeLimit_;
135 this->timerIsActive_ =
true;
139 { this->timerIsActive_ =
false; }
142 {
return this->time_; }
145 {
return timerIsActive_; }
148 { this->timeLimit_ = t; }
153 virtual void resetTimer();
154 virtual void resetTimer(
float t);
160 {
return this->players_.size(); }
167 virtual void assignDefaultPawnsIfNeeded();
168 virtual void checkStart();
170 virtual void spawnPlayerAsDefaultPawn(
PlayerInfo* player);
171 virtual void spawnPlayersIfRequested();
172 virtual void spawnDeadPlayersIfRequested();
175 virtual void importMementoState(
const std::vector<GSLevelMementoState*>& states)
override;
bool bForceSpawn_
Definition: Gametype.h:180
The BaseObject is the parent of all classes representing an instance in the game. ...
Definition: BaseObject.h:63
bool isStartCountdownRunning() const
Definition: Gametype.h:116
Everything in Orxonox that has a health attribute is a Pawn.
Definition: Pawn.h:56
Definition of SubclassIdentifier.
Definition: SpawnPoint.h:40
void startTimer()
Definition: Gametype.h:132
Declaration of the Tickable interface.
::std::string string
Definition: gtest-port.h:756
void stopTimer()
Definition: Gametype.h:138
bool bAutoEnd_
Definition: Gametype.h:181
PlayerState
Definition: Gametype.h:47
std::map< PlayerInfo *, Player > players_
Definition: Gametype.h:191
bool hasEnded() const
Definition: Gametype.h:82
float getTime()
Definition: Gametype.h:141
SubclassIdentifier< Bot > botclass_
Definition: Gametype.h:189
int frags_
Definition: Gametype.h:59
std::string sceneName_
Definition: Gametype.h:210
SubclassIdentifier< ControllableEntity > defaultControllableEntity_
Definition: Gametype.h:193
Quaternion cameraOrientation_
Definition: Gametype.h:209
WeakPtr wraps a pointer to an object, which becomes nullptr if the object is deleted.
Definition: CorePrereqs.h:236
bool timerIsActive_
Definition: Gametype.h:185
unsigned int getNumberOfPlayers() const
Get number of Players in game.
Definition: Gametype.h:159
bool hasStarted() const
Definition: Gametype.h:80
std::string scoreboardTemplate_
Definition: Gametype.h:198
Definition of the GametypeInfo class.
const std::string & getHUDTemplate() const
Definition: Gametype.h:123
Declaration of the Timer class, used to call functions after a given time-interval.
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
float timeLimit_
Definition: Gametype.h:184
Keeps position and orientation of the camera, as well as the name of current scene.
Definition: Gametype.h:206
bool getTimerIsActive()
Definition: Gametype.h:144
unsigned int numberOfBots_
Definition: Gametype.h:188
Definition: Gametype.h:63
Shared library macros, enums, constants and forward declarations for the orxonox library ...
Declaration of BaseObject, the base class of all objects in Orxonox.
This class is an interface for all instances that want to maintain a state beyond the reloading of a ...
Definition: GSLevelMemento.h:41
OverlayGroup * scoreboard_
Definition: Gametype.h:195
#define _OrxonoxExport
Definition: OrxonoxPrereqs.h:60
const std::map< PlayerInfo *, Player > & getPlayers() const
Definition: Gametype.h:108
OverlayGroup does almost exactly what it says: It groups OrxonoxOverlays together.
Definition: OverlayGroup.h:53
void registerSpawnPoint(SpawnPoint *spawnpoint)
Definition: Gametype.h:113
float time_
Definition: Gametype.h:183
Vector3 cameraPosition_
Definition: Gametype.h:208
float getStartCountdown() const
Definition: Gametype.h:118
const GametypeInfo * getGametypeInfo() const
Definition: Gametype.h:77
Definition: Gametype.h:55
float initialStartCountdown_
Definition: Gametype.h:187
void setHUDTemplate(const std::string &name)
Definition: Gametype.h:121
The GametypeInfo class keeps track of the state of the game and provides facilities to inform the pla...
Definition: GametypeInfo.h:55
int killed_
Definition: Gametype.h:60
Definition: PlayerInfo.h:39
bool bAutoStart_
Definition: Gametype.h:179
PlayerState state_
Definition: Gametype.h:58
The Tickable interface provides a tick(dt) function, that gets called every frame.
Definition: Tickable.h:52
Timer showMenuTimer_
Definition: Gametype.h:200
Timer is a helper class that executes a function after a given amount of seconds in game-time...
Definition: Timer.h:105
Represents the state of a memento.
Definition: GSLevelMemento.h:63
The SubclassIdentifier acts almost like an Identifier, but has some prerequisites.
Definition: SubclassIdentifier.h:90
WeakPtr< GametypeInfo > gtinfo_
Definition: Gametype.h:177
std::set< SpawnPoint * > spawnpoints_
Definition: Gametype.h:192
void setTimeLimit(float t)
Definition: Gametype.h:147
PlayerInfo * info_
Definition: Gametype.h:57