Nebula
Loading...
Searching...
No Matches
Game::LevelExtensionRegistry Class Reference

#include <levelextension.h>

Detailed Description

The extensions the level formats write and read.

Registered by feature units, which is what keeps the formats from knowing anything about what a feature serializes.

Static Public Member Functions

static void Register (const LevelExtension &extension)
 register an extension. The name is what the formats use to find it again
static const LevelExtension * GetExtension (Util::StringAtom name)
 the extension registered under a name, or null when there is none
static const Util::Array< LevelExtension > & GetAllExtensions ()
 all extensions, in the order they were registered, which is the order the formats write them in

Private Member Functions

 LevelExtensionRegistry ()
 ~LevelExtensionRegistry ()

Static Private Member Functions

static LevelExtensionRegistry * Instance ()
 The registry's constructor is called by the Instance() method, and nobody else.
static void Destroy ()
 This static method is used to destroy the registry object and should be called right before the main function exits.

Private Attributes

Util::Array< LevelExtension > extensions
Util::Dictionary< Util::StringAtom, IndexT > byName

Static Private Attributes

static LevelExtensionRegistry * Singleton = nullptr

Constructor & Destructor Documentation

◆ LevelExtensionRegistry()

Game::LevelExtensionRegistry::LevelExtensionRegistry ( )
private

◆ ~LevelExtensionRegistry()

Game::LevelExtensionRegistry::~LevelExtensionRegistry ( )
private

Member Function Documentation

◆ Destroy()

void Game::LevelExtensionRegistry::Destroy ( )
staticprivate

This static method is used to destroy the registry object and should be called right before the main function exits.

It will make sure that no accidental memory leaks are reported by the debug heap.

◆ GetAllExtensions()

const Util::Array< LevelExtension > & Game::LevelExtensionRegistry::GetAllExtensions ( )
static

all extensions, in the order they were registered, which is the order the formats write them in

◆ GetExtension()

const LevelExtension * Game::LevelExtensionRegistry::GetExtension ( Util::StringAtom name)
static

the extension registered under a name, or null when there is none

◆ Instance()

LevelExtensionRegistry * Game::LevelExtensionRegistry::Instance ( )
staticprivate

The registry's constructor is called by the Instance() method, and nobody else.

◆ Register()

void Game::LevelExtensionRegistry::Register ( const LevelExtension & extension)
static

register an extension. The name is what the formats use to find it again

An extension is registered by name, and the name is what a file carries, so two extensions cannot share one.

The order they are registered in is the order the formats write them in, which is what keeps a saved level from moving its extension nodes between builds.

Member Data Documentation

◆ byName

Util::Dictionary<Util::StringAtom, IndexT> Game::LevelExtensionRegistry::byName
private

◆ extensions

Util::Array<LevelExtension> Game::LevelExtensionRegistry::extensions
private

◆ Singleton

LevelExtensionRegistry * Game::LevelExtensionRegistry::Singleton = nullptr
staticprivate

The documentation for this class was generated from the following files: