Planeshift
Autoexec Class Reference

class handling autoexecution of commands at the startup. More...

#include <autoexec.h>

Public Member Functions

void addCommand (csString name, csString cmd)
 Adds commands to the autoexec list. More...
 
 Autoexec ()
 Constructor. More...
 
void execute ()
 Triggers the autoexec to run the commands. More...
 
csString getCommands (csString name)
 Gets commands of one character name. More...
 
bool GetEnabled ()
 Gets if the autoexec is enabled and will trigger. More...
 
void LoadDefault ()
 Overrides the current autoexec data with default. More...
 
void SaveCommands ()
 Save all the autoexec data to file. More...
 
void SetEnabled (const bool en)
 Sets if the autoexec is enabled and will trigger. More...
 
 ~Autoexec ()
 Destructor. More...
 

Protected Member Functions

void LoadCommands (const char *fileName)
 Loads the autoexec data with the provided file name. More...
 

Protected Attributes

csArray< AutoexecCommandcmds
 Stores all the commands which are in the data file. More...
 
bool enabled
 Stores if the autoexec functionality is enabled. More...
 

Detailed Description

class handling autoexecution of commands at the startup.

Definition at line 36 of file autoexec.h.

Constructor & Destructor Documentation

Autoexec::Autoexec ( )

Constructor.

Autoexec::~Autoexec ( )

Destructor.

Member Function Documentation

void Autoexec::addCommand ( csString  name,
csString  cmd 
)

Adds commands to the autoexec list.

Parameters
nameThe character name for which the cmd string will be executed.
cmdThe string of commands to execute automatically.
void Autoexec::execute ( )

Triggers the autoexec to run the commands.

csString Autoexec::getCommands ( csString  name)

Gets commands of one character name.

Parameters
nameThe name for which to search for the commands. An empty string for the general ones.
Returns
The string with all the commands of the requested type.
bool Autoexec::GetEnabled ( )
inline

Gets if the autoexec is enabled and will trigger.

Returns
True if the autoexec functionality is enabled.

Definition at line 45 of file autoexec.h.

void Autoexec::LoadCommands ( const char *  fileName)
protected

Loads the autoexec data with the provided file name.

Parameters
fileNameThe vfs filename where to find the command list
void Autoexec::LoadDefault ( )

Overrides the current autoexec data with default.

void Autoexec::SaveCommands ( )

Save all the autoexec data to file.

void Autoexec::SetEnabled ( const bool  en)
inline

Sets if the autoexec is enabled and will trigger.

Parameters
enSet this true if you want to activate the autoexec functionality.

Definition at line 49 of file autoexec.h.

Member Data Documentation

csArray<AutoexecCommand> Autoexec::cmds
protected

Stores all the commands which are in the data file.

Definition at line 69 of file autoexec.h.

bool Autoexec::enabled
protected

Stores if the autoexec functionality is enabled.

Definition at line 68 of file autoexec.h.


The documentation for this class was generated from the following file: