Elaztek Developer Hub
Blamite Game Engine - blam!  00406.12.10.23.1457.blamite
The core library for the Blamite Game Engine.
globals.h File Reference
#include <string>
#include <map>
#include <vector>
#include <Strings/components/resources/color/BlamColor.h>
#include <Strings/components/utils/string/string.h>
+ Include dependency graph for globals.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  BlamEngineGlobal
 Structure containing data for a game engine global. More...
 

Namespaces

 Blam
 Namespace surrounding all major engine components.
 
 Blam::Globals
 Namespace containing functions relating to game engine globals.
 

Macros

#define GLOBALS_FILE   "globals.xml"
 The file to read globals from. More...
 
#define BLAM
 

Enumerations

enum  BlamGlobalUpdateResult {
  BlamGlobalUpdateResult::InvalidType, BlamGlobalUpdateResult::UnknownGlobal, BlamGlobalUpdateResult::Ok, BlamGlobalUpdateResult::InvalidArgs,
  BlamGlobalUpdateResult::OutOfBounds, BlamGlobalUpdateResult::GlobalIsProtected
}
 Enumerator for the result of a global update attempt. More...
 
enum  BlamGlobalType {
  Boolean, Real, Short, Long,
  String, Int, Color
}
 Enumerator for the type of global variable. More...
 

Functions

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

Macro Definition Documentation

◆ BLAM

#define BLAM

◆ GLOBALS_FILE

#define GLOBALS_FILE   "globals.xml"

The file to read globals from.

Enumeration Type Documentation

◆ BlamGlobalType

Enumerator for the type of global variable.

Enumerator
Boolean 

Represents a boolean. Can be true or false.

Real 
Short 

!< Represents a float.

Represents a short.

Long 

Represents a long.

String 

Represents a std::string.

Int 

Represents an int.

Color 

Represents a BlamColor. See #BlamColor for details.

◆ BlamGlobalUpdateResult

Enumerator for the result of a global update attempt.

Enumerator
InvalidType 

The provided value was of an invalid type.

UnknownGlobal 

The specified global does not exist.

Ok 

The global was updated successfully.

InvalidArgs 

The provided arguments were invalid.

OutOfBounds 

The provided value was too small or too large for the globals' data type.

GlobalIsProtected 

The specified global is protected and cannot be modified during runtime.