Nebula
|
#include <blueprintmanager.h>
Loads the 'data:tables/blueprint.json' file and subsequently sets up categories based on the blueprints in the entity manager.
You can instantiate entities from blueprints via the entity interface.
Inherits Game::Manager.
Classes | |
struct | Blueprint |
an entity blueprint More... | |
struct | ComponentEntry |
Private Member Functions | |
__DeclareClass(BlueprintManager) __DeclareSingleton(BlueprintManager) public | BlueprintManager () |
constructor | |
~BlueprintManager () | |
destructor | |
void | OnActivate () override |
void | OnDeactivate () override |
called when removed from game server | |
EntityMapping | Instantiate (World *const world, BlueprintId blueprint) |
create an instance from blueprint. Note that this does not tie it to an entity! It's not recommended to create entities this way. | |
EntityMapping | Instantiate (World *const world, TemplateId templateId) |
create an instance from template. Note that this does not tie it to an entity! It's not recommended to create entities this way. | |
bool | ParseBlueprint (Util::String const &blueprintsPath) |
parse entity blueprints file | |
bool | LoadTemplateFolder (Util::String const &path) |
load a template folder | |
bool | ParseTemplate (Util::String const &templatePath) |
parse blueprint template file | |
void | SetupBlueprints () |
setup blueprint database | |
MemDb::TableId | CreateCategory (World *const world, BlueprintId bid) |
create a table in the world db | |
Static Private Member Functions | |
static void | SetBlueprintsFilename (const Util::String &name, const Util::String &folder) |
set a optional blueprints.xml, which is used instead of standard blueprint.xml | |
static BlueprintId const | GetBlueprintId (Util::StringAtom name) |
get a blueprint id | |
static TemplateId const | GetTemplateId (Util::StringAtom name) |
get a template id | |
static Util::StringAtom const | GetTemplateName (TemplateId const templateId) |
get template name | |
static Util::Array< Template > const & | ListTemplates () |
Private Attributes | |
Util::Array< Template > | templates |
Util::Array< Blueprint > | blueprints |
contains all blueprints and their information. | |
Ids::IdGenerationPool | templateIdPool |
Util::HashTable< Util::StringAtom, TemplateId > | templateMap |
maps from template name to template id | |
Util::HashTable< Util::StringAtom, BlueprintId > | blueprintMap |
maps from blueprint name to blueprint id, which is the index in the blueprints array. | |
Static Private Attributes | |
static Util::String | blueprintFolder |
static Util::String | templatesFolder |
Additional Inherited Members | |
Public Member Functions inherited from Core::RefCounted | |
RefCounted () | |
constructor | |
int | GetRefCount () const |
get the current refcount | |
void | AddRef () |
increment refcount by one | |
void | Release () |
decrement refcount and destroy object if refcount is zero | |
bool | IsInstanceOf (const Rtti &rtti) const |
return true if this object is instance of given class | |
bool | IsInstanceOf (const Util::String &className) const |
return true if this object is instance of given class by string | |
bool | IsInstanceOf (const Util::FourCC &classFourCC) const |
return true if this object is instance of given class by fourcc | |
bool | IsA (const Rtti &rtti) const |
return true if this object is instance of given class, or a derived class | |
bool | IsA (const Util::String &rttiName) const |
return true if this object is instance of given class, or a derived class, by string | |
bool | IsA (const Util::FourCC &rttiFourCC) const |
return true if this object is instance of given class, or a derived class, by fourcc | |
const Util::String & | GetClassName () const |
get the class name | |
Util::FourCC | GetClassFourCC () const |
get the class FourCC code | |
Static Public Member Functions inherited from Core::RefCounted | |
static void | DumpRefCountingLeaks () |
dump refcounting leaks, call at end of application (NEBULA_DEBUG builds only!) | |
Protected Member Functions inherited from Core::RefCounted | |
virtual | ~RefCounted () |
destructor (called when refcount reaches zero) | |
|
private |
constructor
|
private |
destructor
|
private |
create a table in the world db
|
staticprivate |
get a blueprint id
|
staticprivate |
get a template id
|
staticprivate |
get template name
|
private |
create an instance from blueprint. Note that this does not tie it to an entity! It's not recommended to create entities this way.
|
private |
create an instance from template. Note that this does not tie it to an entity! It's not recommended to create entities this way.
|
staticprivate |
|
private |
load a template folder
|
overrideprivatevirtual |
Reimplemented from Game::Manager.
|
overrideprivatevirtual |
called when removed from game server
Reimplemented from Game::Manager.
|
private |
parse entity blueprints file
This method parses the file data:tables/blueprints.json into the blueprints array.
|
private |
parse blueprint template file
|
staticprivate |
set a optional blueprints.xml, which is used instead of standard blueprint.xml
|
private |
setup blueprint database
|
staticprivate |
|
private |
maps from blueprint name to blueprint id, which is the index in the blueprints array.
|
private |
contains all blueprints and their information.
|
private |
|
private |
maps from template name to template id
|
private |
|
staticprivate |