![]() |
Blamite Game Engine - Blam (Core)
|
Namespace containing things relating to game engine globals. More...
Classes | |
struct | ScriptGlobal |
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 | |
HSC std::map< std::string, ScriptGlobal > * | GetGlobalsList () |
Retrieves the list of loaded globals. More... | |
HSC bool | LoadGlobalsFromFile () |
Loads any globals from GVARS_FILE. More... | |
HSC std::string | GetGvarTypeLabel (GvarType type) |
Retrieves a string representation of a global's type, for use in UI. More... | |
HSC bool | GlobalExists (std::string id) |
Determines whether or not a global exists. More... | |
HSC void | RegisterGvar (ScriptGlobal var) |
Registers a new engine global. More... | |
HSC void | RegisterGvar (std::string name, std::string value_raw, GvarType type) |
Registers a new engine global. More... | |
HSC void | RegisterGvar (std::string name, std::string value_raw, GvarType type, std::string info) |
Registers a new engine global. More... | |
HSC ScriptGlobal * | GetGlobal (std::string name) |
Retrieves a global with the specified ID. More... | |
HSC GvarUpdateResult | UpdateGlobalWrap (std::string name, std::string new_value) |
Updates a global's raw value. More... | |
HSC GvarUpdateResult | UpdateGlobal (std::string name, std::string new_value) |
Updates the value of a String global. More... | |
HSC GvarUpdateResult | UpdateGlobal (std::string name, bool new_value) |
Updates the value of a Boolean global. More... | |
HSC GvarUpdateResult | UpdateGlobal (std::string name, int new_value) |
Updates the value of a Integer global. More... | |
HSC GvarUpdateResult | UpdateGlobal (std::string name, short new_value) |
Updates the value of a Short global. More... | |
HSC GvarUpdateResult | UpdateGlobal (std::string name, long new_value) |
Updates the value of a Long global. More... | |
HSC GvarUpdateResult | UpdateGlobal (std::string name, float new_value) |
Updates the value of a Float global. More... | |
HSC GvarUpdateResult | UpdateGlobal (std::string name, BlamColor new_value) |
Updates the value of a Color global. More... | |
HSC bool * | GetGlobalAsBoolean (std::string name) |
Retrieves a global's value as a boolean. More... | |
HSC std::string * | GetGlobalAsString (std::string name) |
Retrieves a global's value as a string. More... | |
HSC short * | GetGlobalAsShort (std::string name) |
Retrieves a global's value as a short. More... | |
HSC long * | GetGlobalAsLong (std::string name) |
Retrieves a global's value as a long. More... | |
HSC int * | GetGlobalAsInteger (std::string name) |
Retrieves a global's value as an int. More... | |
HSC float * | GetGlobalAsFloat (std::string name) |
Retrieves a global's value as a float. More... | |
HSC 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.
ScriptGlobal * BlamScript::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 * BlamScript::Globals::GetGlobalAsBoolean | ( | std::string | name | ) |
Retrieves a global's value as a boolean.
name | - The ID of the global to retrieve. |
BlamColor * BlamScript::Globals::GetGlobalAsColor | ( | std::string | name | ) |
Retrieves a global's value as a BlamColor.
name | - The ID of the global to retrieve. |
float * BlamScript::Globals::GetGlobalAsFloat | ( | std::string | name | ) |
Retrieves a global's value as a float.
name | - The ID of the global to retrieve. |
int * BlamScript::Globals::GetGlobalAsInteger | ( | std::string | name | ) |
Retrieves a global's value as an int.
name | - The ID of the global to retrieve. |
long * BlamScript::Globals::GetGlobalAsLong | ( | std::string | name | ) |
Retrieves a global's value as a long.
name | - The ID of the global to retrieve. |
short * BlamScript::Globals::GetGlobalAsShort | ( | std::string | name | ) |
Retrieves a global's value as a short.
name | - The ID of the global to retrieve. |
std::string * BlamScript::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, ScriptGlobal > * BlamScript::Globals::GetGlobalsList | ( | ) |
Retrieves the list of loaded globals.
The key is the ID of the global. The value is the global data.
std::string BlamScript::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 BlamScript::Globals::GlobalExists | ( | std::string | id | ) |
Determines whether or not a global exists.
id | - The ID of the global to check for. |
bool BlamScript::Globals::LoadGlobalsFromFile | ( | ) |
Loads any globals from GVARS_FILE.
true
if the file was loaded, false
if the file could not be found. void BlamScript::Globals::RegisterGvar | ( | ScriptGlobal | var | ) |
Registers a new engine global.
var | - The global to add to the list. |
void BlamScript::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 BlamScript::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 BlamScript::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 BlamScript::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 BlamScript::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 BlamScript::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 BlamScript::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 BlamScript::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 BlamScript::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 BlamScript::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. |