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.

The factory supports domain-specific builders for different component categories: motion, rendering, collision, transform, effects, spawn, AI, combat, lifecycle, health, scoring, observer, and menu.

## Usage

```cpp auto player = GameObjectFactory::gameObject(gameWorld) .withMotion([](auto& m) { m.move2D().speed(5.0f); }) .withRendering([&](auto& r) { r.renderable().shape(shape).shader(shader).build(); }) .withCollision([](auto& c) { c.aabb().layer(CollisionLayer::Player); }) .make(true); ```

See Also

GameObjectPrototype

See Also

MotionBuilder

See Also

RenderingBuilder

See Also

CollisionBuilder

Definition at line 55 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 448 of file GameObjectFactory.ixx.

448 static GameObjectPrototype gameObject(helios::engine::runtime::world::GameWorld& gameWorld) {
449 return GameObjectPrototype(gameWorld);
450 }

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 436 of file GameObjectFactory.ixx.

437 static GameObjectFactory inst{};
438 return inst;
439 }

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.