Elaztek Developer Hub
Blamite Game Engine - blam!  00406.12.10.23.1457.blamite
The core library for the Blamite Game Engine.
Blam::Globals Namespace Reference

Namespace containing functions relating to game engine globals. More...

Functions

BLAM std::map< std::string, BlamEngineGlobal > * GetGlobalsList ()
 Retrieves the list of loaded globals. More...
 
BLAM bool LoadGlobalsFromFile ()
 Loads any globals from #GVARS_FILE. More...
 
BLAM std::string GetGlobalTypeLabel (BlamGlobalType type)
 Retrieves a string representation of a global's type, for use in UI. More...
 
BLAM bool GlobalExists (std::string id)
 Determines whether or not a global exists. More...
 
BLAM void RegisterGlobal (BlamEngineGlobal var)
 Registers a new engine global. More...
 
BLAM void RegisterGlobal (std::string name, std::string value_raw, BlamGlobalType type)
 Registers a new engine global. More...
 
BLAM void RegisterGlobal (std::string name, std::string value_raw, BlamGlobalType type, std::string info)
 Registers a new engine global. More...
 
BLAM BlamEngineGlobalGetGlobal (std::string name)
 Retrieves a global with the specified ID. More...
 
BLAM BlamGlobalUpdateResult UpdateGlobalWrap (std::string name, std::string new_value)
 Updates a global's raw value. More...
 
BLAM BlamGlobalUpdateResult UpdateGlobal (std::string name, std::string new_value)
 Updates the value of a String global. More...
 
BLAM BlamGlobalUpdateResult UpdateGlobal (std::string name, bool new_value)
 Updates the value of a Boolean global. More...
 
BLAM BlamGlobalUpdateResult UpdateGlobal (std::string name, int new_value)
 Updates the value of a Integer global. More...
 
BLAM BlamGlobalUpdateResult UpdateGlobal (std::string name, short new_value)
 Updates the value of a Short global. More...
 
BLAM BlamGlobalUpdateResult UpdateGlobal (std::string name, long new_value)
 Updates the value of a Long global. More...
 
BLAM BlamGlobalUpdateResult UpdateGlobal (std::string name, float new_value)
 Updates the value of a Float global. More...
 
BLAM BlamGlobalUpdateResult UpdateGlobal (std::string name, BlamColor new_value)
 Updates the value of a Color global. More...
 
BLAM bool * GetGlobalAsBoolean (std::string name)
 Retrieves a global's value as a boolean. More...
 
BLAM std::string * GetGlobalAsString (std::string name)
 Retrieves a global's value as a string. More...
 
BLAM short * GetGlobalAsShort (std::string name)
 Retrieves a global's value as a short. More...
 
BLAM long * GetGlobalAsLong (std::string name)
 Retrieves a global's value as a long. More...
 
BLAM int * GetGlobalAsInteger (std::string name)
 Retrieves a global's value as an int. More...
 
BLAM float * GetGlobalAsFloat (std::string name)
 Retrieves a global's value as a float. More...
 
BLAM BlamColor * GetGlobalAsColor (std::string name)
 Retrieves a global's value as a BlamColor. More...
 

Detailed Description

Namespace containing functions relating to game engine globals.

Function Documentation

◆ GetGlobal()

BlamEngineGlobal * Blam::Globals::GetGlobal ( std::string  name)

Retrieves a global with the specified ID.

Parameters
name- The ID of the desired global.
Returns
A pointer to the specified global, or nullptr if it could not be found.
+ Here is the caller graph for this function:

◆ GetGlobalAsBoolean()

bool * Blam::Globals::GetGlobalAsBoolean ( std::string  name)

Retrieves a global's value as a boolean.

Parameters
name- The ID of the global to retrieve.
Returns
A pointer to the global's boolean value.
+ Here is the caller graph for this function:

◆ GetGlobalAsColor()

BlamColor * Blam::Globals::GetGlobalAsColor ( std::string  name)

Retrieves a global's value as a BlamColor.

Parameters
name- The ID of the global to retrieve.
Returns
A pointer to the global's color information.
+ Here is the caller graph for this function:

◆ GetGlobalAsFloat()

float * Blam::Globals::GetGlobalAsFloat ( std::string  name)

Retrieves a global's value as a float.

Parameters
name- The ID of the global to retrieve.
Returns
A pointer to the global's float value.
+ Here is the caller graph for this function:

◆ GetGlobalAsInteger()

int * Blam::Globals::GetGlobalAsInteger ( std::string  name)

Retrieves a global's value as an int.

Parameters
name- The ID of the global to retrieve.
Returns
A pointer to the global's int value.
+ Here is the caller graph for this function:

◆ GetGlobalAsLong()

long * Blam::Globals::GetGlobalAsLong ( std::string  name)

Retrieves a global's value as a long.

Parameters
name- The ID of the global to retrieve.
Returns
A pointer to the global's long value.

◆ GetGlobalAsShort()

short * Blam::Globals::GetGlobalAsShort ( std::string  name)

Retrieves a global's value as a short.

Parameters
name- The ID of the global to retrieve.
Returns
A pointer to the global's short value.

◆ GetGlobalAsString()

std::string * Blam::Globals::GetGlobalAsString ( std::string  name)

Retrieves a global's value as a string.

Parameters
name- The ID of the global to retrieve.
Returns
A pointer to the global's string value.

◆ GetGlobalsList()

std::map< std::string, BlamEngineGlobal > * Blam::Globals::GetGlobalsList ( )

Retrieves the list of loaded globals.

The key is the ID of the global. The value is the global data.

Returns
A pointer to the list of loaded globals.
+ Here is the caller graph for this function:

◆ GetGlobalTypeLabel()

std::string Blam::Globals::GetGlobalTypeLabel ( BlamGlobalType  type)

Retrieves a string representation of a global's type, for use in UI.

Parameters
type- The type of the global to evaluate.
Returns
The specified global type as a string.
+ Here is the caller graph for this function:

◆ GlobalExists()

bool Blam::Globals::GlobalExists ( std::string  id)

Determines whether or not a global exists.

Parameters
id- The ID of the global to check for.
Returns
Whether or not the specified global exists.
+ Here is the caller graph for this function:

◆ LoadGlobalsFromFile()

bool Blam::Globals::LoadGlobalsFromFile ( )

Loads any globals from #GVARS_FILE.

Returns
true if the file was loaded, false if the file could not be found.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RegisterGlobal() [1/3]

void Blam::Globals::RegisterGlobal ( BlamEngineGlobal  var)

Registers a new engine global.

Parameters
var- The global to add to the list.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RegisterGlobal() [2/3]

void Blam::Globals::RegisterGlobal ( std::string  name,
std::string  value_raw,
BlamGlobalType  type 
)

Registers a new engine global.

Parameters
name- The ID of the new global.
value_raw- The raw string value of the global.
type- The type of the global.

◆ RegisterGlobal() [3/3]

void Blam::Globals::RegisterGlobal ( std::string  name,
std::string  value_raw,
BlamGlobalType  type,
std::string  info 
)

Registers a new engine global.

Parameters
name- The ID of the new global.
value_raw- The raw string value of the global.
type- The type of the global.
info- A description of the global.

◆ UpdateGlobal() [1/7]

BlamGlobalUpdateResult Blam::Globals::UpdateGlobal ( std::string  name,
BlamColor  new_value 
)

Updates the value of a Color global.

Parameters
name- The ID of the global to update.
new_value- The new value to apply to the global.
Returns
The result of the update attempt. See #BlamScript::Globals::GvarUpdateResult for details.

◆ UpdateGlobal() [2/7]

BlamGlobalUpdateResult Blam::Globals::UpdateGlobal ( std::string  name,
bool  new_value 
)

Updates the value of a Boolean global.

Parameters
name- The ID of the global to update.
new_value- The new value to apply to the global.
Returns
The result of the update attempt. See #BlamScript::Globals::GvarUpdateResult for details.

◆ UpdateGlobal() [3/7]

BlamGlobalUpdateResult Blam::Globals::UpdateGlobal ( std::string  name,
float  new_value 
)

Updates the value of a Float global.

Parameters
name- The ID of the global to update.
new_value- The new value to apply to the global.
Returns
The result of the update attempt. See #BlamScript::Globals::GvarUpdateResult for details.

◆ UpdateGlobal() [4/7]

BlamGlobalUpdateResult Blam::Globals::UpdateGlobal ( std::string  name,
int  new_value 
)

Updates the value of a Integer global.

Parameters
name- The ID of the global to update.
new_value- The new value to apply to the global.
Returns
The result of the update attempt. See #BlamScript::Globals::GvarUpdateResult for details.

◆ UpdateGlobal() [5/7]

BlamGlobalUpdateResult Blam::Globals::UpdateGlobal ( std::string  name,
long  new_value 
)

Updates the value of a Long global.

Parameters
name- The ID of the global to update.
new_value- The new value to apply to the global.
Returns
The result of the update attempt. See #BlamScript::Globals::GvarUpdateResult for details.

◆ UpdateGlobal() [6/7]

BlamGlobalUpdateResult Blam::Globals::UpdateGlobal ( std::string  name,
short  new_value 
)

Updates the value of a Short global.

Parameters
name- The ID of the global to update.
new_value- The new value to apply to the global.
Returns
The result of the update attempt. See #BlamScript::Globals::GvarUpdateResult for details.

◆ UpdateGlobal() [7/7]

BlamGlobalUpdateResult Blam::Globals::UpdateGlobal ( std::string  name,
std::string  new_value 
)

Updates the value of a String global.

Parameters
name- The ID of the global to update.
new_value- The new value to apply to the global.
Returns
The result of the update attempt. See #BlamScript::Globals::GvarUpdateResult for details.
+ Here is the caller graph for this function:

◆ UpdateGlobalWrap()

BlamGlobalUpdateResult Blam::Globals::UpdateGlobalWrap ( std::string  name,
std::string  new_value 
)

Updates a global's raw value.

Can be used with globals of any type.

Parameters
name- The ID of the global to update.
new_value- The new value to apply to the global.
Returns
The result of the update attempt. See #BlamScript::Globals::GvarUpdateResult for details.
+ Here is the caller graph for this function: