Documentation

GameBuilder
in package

The GameBuilder class is used to build a Game object with all dependencies that are needed.

You must provide $cwd, $configuration, $entityManager and a logger instance using the with* methods. You can provide additional class names for additional dependency injections using the use* methods.

Table of Contents

$composerManagerClass  : string
$configuration  : Configuration
$cwd  : string
$diceBagClass  : string
$entityManager  : EntityManagerInterface
$eventManagerClass  : string
$logger  : Logger
$messageManagerClass  : string
$moduleManagerClass  : string
$sceneRendererClass  : string
create()  : Game
Creates the game instance with the prepared parameters.
useComposerManager()  : self
Sets the fqcn for the composer manager to be used.
useDiceBag()  : GameBuilder
Sets the fqcn for the dice bag to be used.
useEventManager()  : GameBuilder
Sets the fqcn for the event manager to be used.
useModuleManager()  : self
Sets the fqcn for the module manager to be used.
useSceneRenderer()  : $this
Sets the class name for the scene renderer to be used.
withConfiguration()  : self
Configuration.
withCwd()  : self
Adds current working directory argument.
withEntityManager()  : self
Sets the logger for the game instance.
withLogger()  : self
Sets the logger for the game instance.
withMessageManager()  : self
Sets the fqcn for the message manager to be used.

Properties

$composerManagerClass

private string $composerManagerClass

$entityManager

private EntityManagerInterface $entityManager

$eventManagerClass

private string $eventManagerClass

$messageManagerClass

private string $messageManagerClass

$moduleManagerClass

private string $moduleManagerClass

$sceneRendererClass

private string $sceneRendererClass

Methods

create()

Creates the game instance with the prepared parameters.

public create() : Game
Tags
throws
BuilderException

if at least one of cwd, configuration, entityManager or logger as not been set.

Return values
Game

useComposerManager()

Sets the fqcn for the composer manager to be used.

public useComposerManager(string $composerManagerFqcn) : self
Parameters
$composerManagerFqcn : string
Return values
self

useDiceBag()

Sets the fqcn for the dice bag to be used.

public useDiceBag(string $diceBagFqcn) : GameBuilder
Parameters
$diceBagFqcn : string
Return values
GameBuilder

useEventManager()

Sets the fqcn for the event manager to be used.

public useEventManager(string $eventManagerFqcn) : GameBuilder
Parameters
$eventManagerFqcn : string
Return values
GameBuilder

useModuleManager()

Sets the fqcn for the module manager to be used.

public useModuleManager(string $moduleManagerFqcn) : self
Parameters
$moduleManagerFqcn : string
Return values
self

useSceneRenderer()

Sets the class name for the scene renderer to be used.

public useSceneRenderer(string $sceneRendererFqcn) : $this
Parameters
$sceneRendererFqcn : string
Return values
$this

withCwd()

Adds current working directory argument.

public withCwd(string $cwd) : self
Parameters
$cwd : string
Return values
self

withEntityManager()

Sets the logger for the game instance.

public withEntityManager(EntityManagerInterface $em) : self
Parameters
$em : EntityManagerInterface
Return values
self

withLogger()

Sets the logger for the game instance.

public withLogger(Logger $logger) : self
Parameters
$logger : Logger
Return values
self

withMessageManager()

Sets the fqcn for the message manager to be used.

public withMessageManager(string $messageManagerFqcn) : self
Parameters
$messageManagerFqcn : string
Return values
self

Search results