98 virtual void XMLEventPort(Element& xmlelement,
XMLPort::Mode mode)
override;
100 bool trigger(
bool triggered,
BaseObject* trigger);
101 void execute(
unsigned int clientId,
bool onLoad =
false);
125 { this->onLoad_ = onLoad; }
131 {
return this->onLoad_; }
133 void setTimes(
int times);
139 {
return this->times_; }
146 { this->needsGraphics_ = needsGraphics; }
152 {
return this->needsGraphics_; }
159 { this->forAll_ = forAll; }
165 {
return this->forAll_; }
167 virtual void clientConnected(
unsigned int clientId)
override;
193 { this->mode_ = mode; }
#define _ObjectsExport
Definition: ObjectsPrereqs.h:60
The BaseObject is the parent of all classes representing an instance in the game. ...
Definition: BaseObject.h:63
static const int INF
Definition: Script.h:174
ScriptMode
The mode a specific Script is in.
Definition: Script.h:53
bool forAll_
Whether the code is executed for all players (in a multiplayer setup) or just for the one triggering ...
Definition: Script.h:182
ScriptMode mode_
The mode the Script is in. Determines whether the code is executed the normal way or in lua...
Definition: Script.h:177
bool needsGraphics_
Whether the code to be executed needs graphics.
Definition: Script.h:181
The Scripts' code is executed through the CommandExecutor.
::std::string string
Definition: gtest-port.h:756
std::string modeStr_
The mode the Script is in, as a string. Is used for networking purposes.
Definition: Script.h:178
static const std::string NORMAL
Static variables to avoid magic strings.
Definition: Script.h:172
int getTimes(void)
Get the number of times this Script is executed at the most.
Definition: Script.h:138
bool isForAll(void)
Get whether the Script executes its code for all players or just for the player triggering the Script...
Definition: Script.h:164
static const std::string LUA
Definition: Script.h:173
virtual void clientDisconnected(unsigned int clientid) override
Definition: Script.h:168
An abstract base class.
Definition: ClientConnectionListener.h:40
The Script class lets you execute a piece of code, either the normal way or in lua, through XML.
Definition: Script.h:91
xmlelement
Definition: Super.h:519
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
void setCode(const std::string &code)
Sets the code that is executed by this Script.
Definition: Script.h:108
bool onLoad_
Whether the Scripts code is executed upon loading (creation) of this Script.
Definition: Script.h:179
Mode
Definition: CorePrereqs.h:102
Declaration of BaseObject, the base class of all objects in Orxonox.
void setMode(ScriptMode mode)
Sets the mode of the Script.
Definition: Script.h:192
Shared library macros, enums, constants and forward declarations for the objects module ...
void setNeedsGraphics(bool needsGraphics)
Set whether the code to be executed needs graphics to work.
Definition: Script.h:145
bool getNeedsGraphics(void)
Get whether the code to be executed needs graphics to work.
Definition: Script.h:151
void setForAll(bool forAll)
Set whether the code is executed for all players or just for the player triggering the Script...
Definition: Script.h:158
The Scripts' code is executed through lua.
int remainingExecutions_
The number of remainign executions. -1 denotes infinity.
Definition: Script.h:184
bool isOnLoad(void)
Get whether this Script is executed onLoad.
Definition: Script.h:130
int times_
The number of times the Scripts code is executed at the most. -1 denotes infinity.
Definition: Script.h:180
void setOnLoad(bool onLoad)
Set whether this Script is executed onLoad or not.
Definition: Script.h:124
const std::string & getCode() const
Get the code that is executed by this Script.
Definition: Script.h:114
std::string code_
The code that is executed by this Script.
Definition: Script.h:176