Menu

## Game
in package

Game.php : 27

The main game class.

### Table of Contents

$character : Character|null
$composerManager : ComposerManager
$configuration : Configuration
$cwd : string
$diceBag : DiceBag
$entityManager : EntityManagerInterface
$eventManager : EventManager
$logger : Logger
$messageManager : MessageManager
$moduleManager : ModuleManager
$sceneRenderer : TwigSceneRenderer
$timeKeeper : TimeKeeper|null
__construct() : mixed
  Construct a game. You probably want to use Bootstrap to do this.
getCharacter() : Character
  Returns the currently configured user character.
getComposerManager() : ComposerManager
  Returns the game's composer manager.
getConfiguration() : Configuration
  Returns the game's configuration.
getCWD() : string
  Returns the current working directory, or root directory where the Composer configuration is based.
getDiceBag() : DiceBag
  Returns the game's dice bag.
getEntityManager() : EntityManagerInterface
  Returns the game's entity manager.
getEventManager() : EventManager
  Returns the game's event manager.
getLogger() : Logger
  Returns the logger instance to write logs.
getMessageManager() : MessageManager
  Returns the Message manager.
getModuleManager() : ModuleManager
  Returns the game's module manager.
getSceneRenderer() : TwigSceneRenderer
  Returns the default scene renderer.
getTimeKeeper() : TimeKeeper
  Returns the time keeper.
getVersion() : string
  Return the current version of the core, conforming to Semantic Versioning.
getViewpoint() : Viewpoint
  Return the viewpoint for the current user.
setCharacter() : mixed
  Sets the currently configured user character.
setComposerManager() : void
  Sets the game's composer manager.
setDiceBag() : void
  Sets the game's dice bag.
setEventManager() : void
  Sets the game's event manager.
setMessageManager() : void
  Sets the Message Manager.
setModuleManager() : void
  Sets the game's module manager.
setSceneRenderer() : void
  Sets a scene renderer.
takeAction() : mixed
  Take the specified navigation action for the currently configured user. This action must be present in the current user's viewpoint.
navigateToScene() : mixed
  Starting with the current viewpoint, navigate to the specified scene, calling the hook `h/lotgd/core/navigate-to/[scene template]` to set up the proper viewpoint values, and following any redirects specified by the hook.

### Properties

#### $character

Game.php : 33
`private Character|null $character = null`

#### $composerManager

Game.php : 30
`private ComposerManager $composerManager`

#### $configuration

Game.php : 46
`private Configuration $configuration`

#### $cwd

Game.php : 49
`private string $cwd`

#### $diceBag

Game.php : 34
`private DiceBag $diceBag`

#### $entityManager

Game.php : 48
`private EntityManagerInterface $entityManager`

#### $eventManager

Game.php : 29
`private EventManager $eventManager`

#### $logger

Game.php : 47
`private Logger $logger`

#### $messageManager

Game.php : 32
`private MessageManager $messageManager`

#### $moduleManager

Game.php : 31
`private ModuleManager $moduleManager`

#### $sceneRenderer

Game.php : 36
`private TwigSceneRenderer $sceneRenderer`

#### $timeKeeper

Game.php : 35
`private TimeKeeper|null $timeKeeper = null`

### Methods

#### __construct()

Game.php : 45

Construct a game. You probably want to use Bootstrap to do this.

`public __construct(Configuration $configuration, Logger $logger, EntityManagerInterface $entityManager, string $cwd) : mixed`

##### Parameters

$configuration : Configuration
$logger : Logger
$entityManager : EntityManagerInterface
$cwd : string

##### Return values

mixed —

#### getCharacter()

Game.php : 227

Returns the currently configured user character.

`public getCharacter() : Character`

##### Tags

throws
  CharacterNotFoundException

##### Return values

Character —

#### getComposerManager()

Game.php : 103

Returns the game's composer manager.

`public getComposerManager() : ComposerManager`

##### Return values

ComposerManager —

The game's composer manager.

#### getConfiguration()

Game.php : 66

Returns the game's configuration.

`public getConfiguration() : Configuration`

##### Return values

Configuration —

The game's configuration.

#### getCWD()

Game.php : 76

Returns the current working directory, or root directory where the Composer configuration is based.

`public getCWD() : string`

##### Return values

string —

#### getDiceBag()

Game.php : 148

Returns the game's dice bag.

`public getDiceBag() : DiceBag`

##### Return values

DiceBag —

#### getEntityManager()

Game.php : 121

Returns the game's entity manager.

`public getEntityManager() : EntityManagerInterface`

##### Return values

EntityManagerInterface —

The game's database entity manager.

#### getEventManager()

Game.php : 130

Returns the game's event manager.

`public getEventManager() : EventManager`

##### Return values

EventManager —

The game's event manager.

#### getLogger()

Game.php : 166

Returns the logger instance to write logs.

`public getLogger() : Logger`

##### Return values

Logger —

#### getMessageManager()

Game.php : 190

Returns the Message manager.

`public getMessageManager() : MessageManager`

##### Return values

MessageManager —

#### getModuleManager()

Game.php : 85

Returns the game's module manager.

`public getModuleManager() : ModuleManager`

##### Return values

ModuleManager —

The game's module manager.

#### getSceneRenderer()

Game.php : 208

Returns the default scene renderer.

`public getSceneRenderer() : TwigSceneRenderer`

##### Return values

TwigSceneRenderer —

#### getTimeKeeper()

Game.php : 175

Returns the time keeper.

`public getTimeKeeper() : TimeKeeper`

##### Return values

TimeKeeper —

#### getVersion()

Game.php : 57

Return the current version of the core, conforming to Semantic Versioning.

`public static getVersion() : string`

##### Return values

string —

The current version, in x.y.z format.

#### getViewpoint()

Game.php : 249

Return the viewpoint for the current user.

`public getViewpoint() : Viewpoint`

##### Tags

throws
  InvalidConfigurationException|CharacterNotFoundException

##### Return values

Viewpoint —

#### setCharacter()

Game.php : 239

Sets the currently configured user character.

`public setCharacter(Character $c) : mixed`

##### Parameters

$c : Character

##### Return values

mixed —

#### setComposerManager()

Game.php : 112

Sets the game's composer manager.

`public setComposerManager(ComposerManager $composerManager) : void`

##### Parameters

$composerManager : ComposerManager

##### Return values

void —

#### setDiceBag()

Game.php : 157

Sets the game's dice bag.

`public setDiceBag(DiceBag $diceBag) : void`

##### Parameters

$diceBag : DiceBag

##### Return values

void —

#### setEventManager()

Game.php : 139

Sets the game's event manager.

`public setEventManager(EventManager $eventManager) : void`

##### Parameters

$eventManager : EventManager

##### Return values

void —

#### setMessageManager()

Game.php : 199

Sets the Message Manager.

`public setMessageManager(MessageManager $messageManager) : void`

##### Parameters

$messageManager : MessageManager

##### Return values

void —

#### setModuleManager()

Game.php : 94

Sets the game's module manager.

`public setModuleManager(ModuleManager $moduleManager) : void`

##### Parameters

$moduleManager : ModuleManager

##### Return values

void —

#### setSceneRenderer()

Game.php : 217

Sets a scene renderer.

`public setSceneRenderer(TwigSceneRenderer $sceneRenderer) : void`

##### Parameters

$sceneRenderer : TwigSceneRenderer

##### Return values

void —

#### takeAction()

Game.php : 408

Take the specified navigation action for the currently configured user. This action must be present in the current user's viewpoint.

`public takeAction(string $actionId[, array<string|int, mixed> $parameters = [] ]) : mixed`

##### Parameters

$actionId : string

  The identifier of the action to take.

$parameters : array<string|int, mixed> = []

##### Tags

throws
  ActionNotFoundException
throws
  SceneNotFoundException

##### Return values

mixed —

#### navigateToScene()

Game.php : 290

Starting with the current viewpoint, navigate to the specified scene, calling the hook `h/lotgd/core/navigate-to/[scene template]` to set up the proper viewpoint values, and following any redirects specified by the hook.

`private navigateToScene(Scene $scene, array<string|int, mixed> $parameters) : mixed`

##### Parameters

$scene : Scene
$parameters : array<string|int, mixed>

##### Tags

throws
  CharacterNotFoundException

##### Return values

mixed —

## Search results