![]() |
Blamite Game Engine - blam!
00296.01.12.21.0102.blamite
The core library for the Blamite Game Engine.
|
Namespace containing things relating to game engine globals. More...
Classes | |
struct | EngineGlobal |
Structure containing data for a game engine global. More... | |
Enumerations | |
enum | GvarUpdateResult { InvalidType, UnknownGlobal, Ok, InvalidArgs, OutOfBounds, GlobalIsProtected } |
Enumerator for the result of a global update attempt. More... | |
enum | GvarType { Boolean, Real, Short, Long, Object, String, Int, Float, Color } |
Enumerator for the type of global variable. More... | |
Functions | |
BLAM std::map< std::string, EngineGlobal > * | GetGlobalsList () |
Retrieves the list of loaded globals. More... | |
BLAM bool | LoadGlobalsFromFile () |
Loads any globals from GVARS_FILE. More... | |
BLAM std::string | GetGvarTypeLabel (GvarType 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 | RegisterGvar (EngineGlobal var) |
Registers a new engine global. More... | |
BLAM void | RegisterGvar (std::string name, std::string value_raw, GvarType type) |
Registers a new engine global. More... | |
BLAM void | RegisterGvar (std::string name, std::string value_raw, GvarType type, std::string info) |
Registers a new engine global. More... | |
BLAM EngineGlobal * | GetGlobal (std::string name) |
Retrieves a global with the specified ID. More... | |
BLAM GvarUpdateResult | UpdateGlobalWrap (std::string name, std::string new_value) |
Updates a global's raw value. More... | |
BLAM GvarUpdateResult | UpdateGlobal (std::string name, std::string new_value) |
Updates the value of a String global. More... | |
BLAM GvarUpdateResult | UpdateGlobal (std::string name, bool new_value) |
Updates the value of a Boolean global. More... | |
BLAM GvarUpdateResult | UpdateGlobal (std::string name, int new_value) |
Updates the value of a Integer global. More... | |
BLAM GvarUpdateResult | UpdateGlobal (std::string name, short new_value) |
Updates the value of a Short global. More... | |
BLAM GvarUpdateResult | UpdateGlobal (std::string name, long new_value) |
Updates the value of a Long global. More... | |
BLAM GvarUpdateResult | UpdateGlobal (std::string name, float new_value) |
Updates the value of a Float global. More... | |
BLAM GvarUpdateResult | 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... | |
Namespace containing things relating to game engine globals.
Enumerator for the type of global variable.
Enumerator for the result of a global update attempt.
EngineGlobal * Blam::Globals::GetGlobal | ( | std::string | name | ) |
Retrieves a global with the specified ID.
name | - The ID of the desired global. |
nullptr
if it could not be found. bool * Blam::Globals::GetGlobalAsBoolean | ( | std::string | name | ) |
Retrieves a global's value as a boolean.
name | - The ID of the global to retrieve. |
BlamColor * Blam::Globals::GetGlobalAsColor | ( | std::string | name | ) |
Retrieves a global's value as a BlamColor.
name | - The ID of the global to retrieve. |
float * Blam::Globals::GetGlobalAsFloat | ( | std::string | name | ) |
Retrieves a global's value as a float.
name | - The ID of the global to retrieve. |
int * Blam::Globals::GetGlobalAsInteger | ( | std::string | name | ) |
Retrieves a global's value as an int.
name | - The ID of the global to retrieve. |
long * Blam::Globals::GetGlobalAsLong | ( | std::string | name | ) |
Retrieves a global's value as a long.
name | - The ID of the global to retrieve. |
short * Blam::Globals::GetGlobalAsShort | ( | std::string | name | ) |
Retrieves a global's value as a short.
name | - The ID of the global to retrieve. |
std::string * Blam::Globals::GetGlobalAsString | ( | std::string | name | ) |
Retrieves a global's value as a string.
name | - The ID of the global to retrieve. |
std::map< std::string, EngineGlobal > * Blam::Globals::GetGlobalsList | ( | ) |
Retrieves the list of loaded globals.
The key is the ID of the global. The value is the global data.
std::string Blam::Globals::GetGvarTypeLabel | ( | GvarType | type | ) |
Retrieves a string representation of a global's type, for use in UI.
type | - The type of the global to evaluate. |
bool Blam::Globals::GlobalExists | ( | std::string | id | ) |
Determines whether or not a global exists.
id | - The ID of the global to check for. |
bool Blam::Globals::LoadGlobalsFromFile | ( | ) |
Loads any globals from GVARS_FILE.
true
if the file was loaded, false
if the file could not be found. void Blam::Globals::RegisterGvar | ( | EngineGlobal | var | ) |
Registers a new engine global.
var | - The global to add to the list. |
void Blam::Globals::RegisterGvar | ( | std::string | name, |
std::string | value_raw, | ||
GvarType | type | ||
) |
Registers a new engine global.
name | - The ID of the new global. |
value_raw | - The raw string value of the global. |
type | - The type of the global. |
void Blam::Globals::RegisterGvar | ( | std::string | name, |
std::string | value_raw, | ||
GvarType | type, | ||
std::string | info | ||
) |
Registers a new engine global.
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. |
GvarUpdateResult Blam::Globals::UpdateGlobal | ( | std::string | name, |
BlamColor | new_value | ||
) |
Updates the value of a Color global.
name | - The ID of the global to update. |
new_value | - The new value to apply to the global. |
GvarUpdateResult Blam::Globals::UpdateGlobal | ( | std::string | name, |
bool | new_value | ||
) |
Updates the value of a Boolean global.
name | - The ID of the global to update. |
new_value | - The new value to apply to the global. |
GvarUpdateResult Blam::Globals::UpdateGlobal | ( | std::string | name, |
float | new_value | ||
) |
Updates the value of a Float global.
name | - The ID of the global to update. |
new_value | - The new value to apply to the global. |
GvarUpdateResult Blam::Globals::UpdateGlobal | ( | std::string | name, |
int | new_value | ||
) |
Updates the value of a Integer global.
name | - The ID of the global to update. |
new_value | - The new value to apply to the global. |
GvarUpdateResult Blam::Globals::UpdateGlobal | ( | std::string | name, |
long | new_value | ||
) |
Updates the value of a Long global.
name | - The ID of the global to update. |
new_value | - The new value to apply to the global. |
GvarUpdateResult Blam::Globals::UpdateGlobal | ( | std::string | name, |
short | new_value | ||
) |
Updates the value of a Short global.
name | - The ID of the global to update. |
new_value | - The new value to apply to the global. |
GvarUpdateResult Blam::Globals::UpdateGlobal | ( | std::string | name, |
std::string | new_value | ||
) |
Updates the value of a String global.
name | - The ID of the global to update. |
new_value | - The new value to apply to the global. |
GvarUpdateResult Blam::Globals::UpdateGlobalWrap | ( | std::string | name, |
std::string | new_value | ||
) |
Updates a global's raw value.
Can be used with globals of any type.
name | - The ID of the global to update. |
new_value | - The new value to apply to the global. |