Skip to main content

GameObjectFactory Class

Factory class for creating and cloning GameObjects. More...

Declaration

class helios::engine::builder::gameObject::GameObjectFactory { ... }

Public Static Functions Index

static GameObjectFactory &instance ()

Returns the singleton instance of the factory. More...

static GameObjectPrototypegameObject (helios::engine::runtime::world::GameWorld &gameWorld)

Creates a new empty GameObject prototype. More...

Description

Factory class for creating and cloning GameObjects.

Provides static methods for constructing new GameObjects or creating copies from existing templates. Uses the builder pattern internally via `GameObjectPrototype` for fluent component configuration.

Example usage: ```cpp auto player = GameObjectFactory::gameObject() .withMotion([](auto& m) { m.move2D().speed(5.0f); }) .withRendering([&](auto& r) { r.renderable().shape(shape).shader(shader).build(); }) .make(true); ```

Definition at line 41 of file GameObjectFactory.ixx.

Public Static Functions

gameObject()

GameObjectPrototype helios::engine::builder::gameObject::GameObjectFactory::gameObject (helios::engine::runtime::world::GameWorld & gameWorld)
inline static

Creates a new empty GameObject prototype.

Parameters
gameWorld

The world where the GameObject lives.

Returns

A prototype for fluent configuration.

Definition at line 392 of file GameObjectFactory.ixx.

392 static GameObjectPrototype gameObject(helios::engine::runtime::world::GameWorld& gameWorld) {
393 return GameObjectPrototype(gameWorld);
394 }

instance()

GameObjectFactory & helios::engine::builder::gameObject::GameObjectFactory::instance ()
inline static

Returns the singleton instance of the factory.

Returns

Reference to the singleton factory.

Definition at line 380 of file GameObjectFactory.ixx.

381 static GameObjectFactory inst{};
382 return inst;
383 }

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.