Viewpoint
in package
implements
CreateableInterface
Uses
Creator, SceneBasics
A Viewpoint is the current Scene a character is experiencing with all changes from modules included.
Tags
Interfaces, Classes and Traits
- CreateableInterface
- Interface for createable models.
Table of Contents
- $_description : SceneDescription|null
- $actionGroups : array<string|int, mixed>
- $attachments : array<string|int, mixed>
- $data : array<string|int, mixed>
- $description : string
- $fillable : array<string|int, mixed>
- $owner : Character
- $scene : Scene|null
- $template : SceneTemplate|null
- $title : string
- $twigSceneRenderer : TwigSceneRenderer|null
- addActionGroup() : void
- Adds a new action group to a viewpoint.
- addActionToGroupId() : mixed
- Add the specified action to the group with the provided id. Does nothing if the id is not present.
- addAttachment() : mixed
- Adds an attachment
- addDescriptionParagraph() : mixed
- Adds a paragraph to the existing description.
- changeFromScene() : mixed
- Copies the static data from a scene to this Viewpoint entity.
- changeFromSnapshot() : mixed
- Changes the current viewpoint to the state saved in the given restoration point.
- clearDescription() : void
- Clears the description.
- create() : CreateableInterface
- Creates and returns an entity instance and fills values.
- findActionById() : Action|null
- Returns the action that corresponds to the given ID, if present.
- findActionGroupById() : ActionGroup|null
- Returns an action group by id or fails.
- getActionGroups() : array<string|int, ActionGroup>
- Returns all action groups.
- getAttachments() : array<string|int, AttachmentInterface>
- Returns all attachments.
- getData() : array<string|int, mixed>
- Returns all data.
- getDataField() : mixed
- Returns a single data field.
- getDescription() : string
- Returns the current description as a string.
- getOwner() : Character
- Returns the owner.
- getRenderedDescription() : string
- Returns the rendered version of the description
- getRenderedTitle() : string
- Returns the rendered version of the title
- getScene() : Scene|null
- Returns the template scene used to create this viewpoint.
- getSnapshot() : ViewpointSnapshot
- Returns a restoration point that can be used to reconstruct the current viewpoint.
- getTemplate() : SceneTemplate|null
- Returns scene template.
- getTitle() : string
- Returns scene title.
- getTwigSceneRenderer() : TwigSceneRenderer|null
- onLoad() : mixed
- removeActionsWithSceneId() : mixed
- Removes any actions that correspond to a given scene ID, if present.
- setActionGroups() : mixed
- Sets action groups.
- setAttachments() : mixed
- Sets attachments.
- setData() : mixed
- Sets all data.
- setDataField() : mixed
- Sets a single data field.
- setDescription() : void
- Sets the description of this viewpoint.
- setOwner() : mixed
- Sets the owner.
- setScene() : mixed
- Sets the template scene used to create this viewpoint.
- setTemplate() : mixed
- Sets scene template.
- setTitle() : mixed
- Sets scene title.
- setTwigSceneRenderer() : mixed
Properties
$_description
private
SceneDescription|null
$_description
= null
$actionGroups
private
array<string|int, mixed>
$actionGroups
= []
Tags
$attachments
private
array<string|int, mixed>
$attachments
= []
Tags
$data
private
array<string|int, mixed>
$data
= []
Tags
$description
private
string
$description
= "{No scene set}"
Tags
$fillable
private
static array<string|int, mixed>
$fillable
= ["owner"]
$owner
private
Character
$owner
Tags
$scene
private
Scene|null
$scene
= null
Tags
$template
private
SceneTemplate|null
$template
Tags
$title
private
string
$title
= "{No scene set}"
Tags
$twigSceneRenderer
private
TwigSceneRenderer|null
$twigSceneRenderer
= null
Methods
addActionGroup()
Adds a new action group to a viewpoint.
public
addActionGroup(ActionGroup $group[, string|null $after = null ]) : void
Parameters
- $group : ActionGroup
-
The new group to add.
- $after : string|null = null
-
Optional group id that comes before.
Tags
Return values
void —addActionToGroupId()
Add the specified action to the group with the provided id. Does nothing if the id is not present.
public
addActionToGroupId(Action $action, string $actionGroupId) : mixed
Parameters
- $action : Action
- $actionGroupId : string
Return values
mixed —addAttachment()
Adds an attachment
public
addAttachment(AttachmentInterface $attachment) : mixed
Parameters
- $attachment : AttachmentInterface
Return values
mixed —addDescriptionParagraph()
Adds a paragraph to the existing description.
public
addDescriptionParagraph(string $paragraph) : mixed
Parameters
- $paragraph : string
Return values
mixed —changeFromScene()
Copies the static data from a scene to this Viewpoint entity.
public
changeFromScene(Scene $scene) : mixed
Parameters
- $scene : Scene
Return values
mixed —changeFromSnapshot()
Changes the current viewpoint to the state saved in the given restoration point.
public
changeFromSnapshot(EntityManager $entityManager, ViewpointSnapshot $snapshot) : mixed
Parameters
- $entityManager : EntityManager
- $snapshot : ViewpointSnapshot
Return values
mixed —clearDescription()
Clears the description.
public
clearDescription() : void
Return values
void —create()
Creates and returns an entity instance and fills values.
public
static create(array<string|int, mixed> $arguments) : CreateableInterface
Parameters
- $arguments : array<string|int, mixed>
-
The values the instance should get
Tags
Return values
CreateableInterface —The created Entity
findActionById()
Returns the action that corresponds to the given ID, if present.
public
findActionById(string $id) : Action|null
Parameters
- $id : string
Return values
Action|null —findActionGroupById()
Returns an action group by id or fails.
public
findActionGroupById(string $actionGroupId) : ActionGroup|null
Parameters
- $actionGroupId : string
Return values
ActionGroup|null —getActionGroups()
Returns all action groups.
public
getActionGroups() : array<string|int, ActionGroup>
Return values
array<string|int, ActionGroup> —getAttachments()
Returns all attachments.
public
getAttachments() : array<string|int, AttachmentInterface>
Return values
array<string|int, AttachmentInterface> —getData()
Returns all data.
public
getData() : array<string|int, mixed>
Return values
array<string|int, mixed> —getDataField()
Returns a single data field.
public
getDataField(string $fieldname[, mixed $default = null ]) : mixed
Parameters
- $fieldname : string
-
Fieldname
- $default : mixed = null
-
Default value
Return values
mixed —getDescription()
Returns the current description as a string.
public
getDescription() : string
Return values
string —getOwner()
Returns the owner.
public
getOwner() : Character
Return values
Character —getRenderedDescription()
Returns the rendered version of the description
public
getRenderedDescription() : string
Return values
string —getRenderedTitle()
Returns the rendered version of the title
public
getRenderedTitle() : string
Return values
string —getScene()
Returns the template scene used to create this viewpoint.
public
getScene() : Scene|null
Return values
Scene|null —getSnapshot()
Returns a restoration point that can be used to reconstruct the current viewpoint.
public
getSnapshot() : ViewpointSnapshot
Return values
ViewpointSnapshot —getTemplate()
Returns scene template.
public
getTemplate() : SceneTemplate|null
Return values
SceneTemplate|null —getTitle()
Returns scene title.
public
getTitle() : string
Return values
string —getTwigSceneRenderer()
public
getTwigSceneRenderer() : TwigSceneRenderer|null
Return values
TwigSceneRenderer|null —onLoad()
public
onLoad() : mixed
Tags
Return values
mixed —removeActionsWithSceneId()
Removes any actions that correspond to a given scene ID, if present.
public
removeActionsWithSceneId(int $id) : mixed
Parameters
- $id : int
Return values
mixed —setActionGroups()
Sets action groups.
public
setActionGroups(array<string|int, ActionGroup> $actionGroups) : mixed
Parameters
- $actionGroups : array<string|int, ActionGroup>
Return values
mixed —setAttachments()
Sets attachments.
public
setAttachments(array<string|int, AttachmentInterface> $attachments) : mixed
Parameters
- $attachments : array<string|int, AttachmentInterface>
Return values
mixed —setData()
Sets all data.
public
setData(array<string|int, mixed> $data) : mixed
Parameters
- $data : array<string|int, mixed>
Return values
mixed —setDataField()
Sets a single data field.
public
setDataField(string $fieldname, mixed $value) : mixed
Parameters
- $fieldname : string
- $value : mixed
Return values
mixed —setDescription()
Sets the description of this viewpoint.
public
setDescription(string $description) : void
Parameters
- $description : string
Return values
void —setOwner()
Sets the owner.
public
setOwner(Character $owner) : mixed
Parameters
- $owner : Character
Return values
mixed —setScene()
Sets the template scene used to create this viewpoint.
public
setScene(Scene $scene) : mixed
Parameters
- $scene : Scene
Return values
mixed —setTemplate()
Sets scene template.
public
setTemplate(SceneTemplate|null $template) : mixed
Parameters
- $template : SceneTemplate|null
Return values
mixed —setTitle()
Sets scene title.
public
setTitle(string $title) : mixed
Parameters
- $title : string
Return values
mixed —setTwigSceneRenderer()
public
setTwigSceneRenderer(TwigSceneRenderer $twigSceneRenderer) : mixed
Parameters
- $twigSceneRenderer : TwigSceneRenderer