Menu

## GameBuilder
in package

GameBuilder.php : 18

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

GameBuilder.php : 26
`private string $composerManagerClass`

#### $configuration

GameBuilder.php : 21
`private Configuration $configuration`

#### $cwd

GameBuilder.php : 20
`private string $cwd`

#### $diceBagClass

GameBuilder.php : 28
`private string $diceBagClass`

#### $entityManager

GameBuilder.php : 22
`private EntityManagerInterface $entityManager`

#### $eventManagerClass

GameBuilder.php : 27
`private string $eventManagerClass`

#### $logger

GameBuilder.php : 23
`private Logger $logger`

#### $messageManagerClass

GameBuilder.php : 29
`private string $messageManagerClass`

#### $moduleManagerClass

GameBuilder.php : 25
`private string $moduleManagerClass`

#### $sceneRendererClass

GameBuilder.php : 30
`private string $sceneRendererClass`

### Methods

#### create()

GameBuilder.php : 37

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()

GameBuilder.php : 146

Sets the fqcn for the composer manager to be used.

`public useComposerManager(string $composerManagerFqcn) : self`

##### Parameters

$composerManagerFqcn : string

##### Return values

self —

#### useDiceBag()

GameBuilder.php : 168

Sets the fqcn for the dice bag to be used.

`public useDiceBag(string $diceBagFqcn) : GameBuilder`

##### Parameters

$diceBagFqcn : string

##### Return values

GameBuilder —

#### useEventManager()

GameBuilder.php : 157

Sets the fqcn for the event manager to be used.

`public useEventManager(string $eventManagerFqcn) : GameBuilder`

##### Parameters

$eventManagerFqcn : string

##### Return values

GameBuilder —

#### useModuleManager()

GameBuilder.php : 135

Sets the fqcn for the module manager to be used.

`public useModuleManager(string $moduleManagerFqcn) : self`

##### Parameters

$moduleManagerFqcn : string

##### Return values

self —

#### useSceneRenderer()

GameBuilder.php : 179

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

`public useSceneRenderer(string $sceneRendererFqcn) : $this`

##### Parameters

$sceneRendererFqcn : string

##### Return values

$this —

#### withConfiguration()

GameBuilder.php : 91

Configuration.

`public withConfiguration(Configuration $conf) : self`

##### Parameters

$conf : Configuration

##### Return values

self —

#### withCwd()

GameBuilder.php : 80

Adds current working directory argument.

`public withCwd(string $cwd) : self`

##### Parameters

$cwd : string

##### Return values

self —

#### withEntityManager()

GameBuilder.php : 102

Sets the logger for the game instance.

`public withEntityManager(EntityManagerInterface $em) : self`

##### Parameters

$em : EntityManagerInterface

##### Return values

self —

#### withLogger()

GameBuilder.php : 113

Sets the logger for the game instance.

`public withLogger(Logger $logger) : self`

##### Parameters

$logger : Logger

##### Return values

self —

#### withMessageManager()

GameBuilder.php : 124

Sets the fqcn for the message manager to be used.

`public withMessageManager(string $messageManagerFqcn) : self`

##### Parameters

$messageManagerFqcn : string

##### Return values

self —

## Search results