Documentation

Game
in package

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

$cwd

private string $cwd

$entityManager

private EntityManagerInterface $entityManager

$logger

private Logger $logger

Methods

__construct()

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

getCWD()

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

public getCWD() : string
Return values
string

getDiceBag()

Returns the game's dice bag.

public getDiceBag() : DiceBag
Return values
DiceBag

getEntityManager()

Returns the game's entity manager.

public getEntityManager() : EntityManagerInterface
Return values
EntityManagerInterface

The game's database entity manager.

getEventManager()

Returns the game's event manager.

public getEventManager() : EventManager
Return values
EventManager

The game's event manager.

getLogger()

Returns the logger instance to write logs.

public getLogger() : Logger
Return values
Logger

getModuleManager()

Returns the game's module manager.

public getModuleManager() : ModuleManager
Return values
ModuleManager

The game's module manager.

getVersion()

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.

setCharacter()

Sets the currently configured user character.

public setCharacter(Character $c) : mixed
Parameters
$c : Character
Return values
mixed

setComposerManager()

Sets the game's composer manager.

public setComposerManager(ComposerManager $composerManager) : void
Parameters
$composerManager : ComposerManager
Return values
void

setDiceBag()

Sets the game's dice bag.

public setDiceBag(DiceBag $diceBag) : void
Parameters
$diceBag : DiceBag
Return values
void

setEventManager()

Sets the game's event manager.

public setEventManager(EventManager $eventManager) : void
Parameters
$eventManager : EventManager
Return values
void

setMessageManager()

Sets the Message Manager.

public setMessageManager(MessageManager $messageManager) : void
Parameters
$messageManager : MessageManager
Return values
void

setModuleManager()

Sets the game's module manager.

public setModuleManager(ModuleManager $moduleManager) : void
Parameters
$moduleManager : ModuleManager
Return values
void

takeAction()

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

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