Documentation

SceneDescription
in package

Abstracts a scene description and provides tools to modify the text more easily.

Class SceneDescription.

Table of Contents

$description  : array<string|int, mixed>
__construct()  : mixed
SceneDescription constructor.
__toString()  : string
Converts the description to a string.
addParagraph()  : void
Adds a paragraph to the description. If the paragraph contains \n\n, it gets broken into multiple paragraphs first.
getDescriptionBack()  : string
Converts the description to a string.
splitIntoParagraphs()  : array<string|int, mixed>
Splits a given string into an array ("paragraphs").

Properties

Methods

__construct()

SceneDescription constructor.

public __construct(string $description) : mixed
Parameters
$description : string
Return values
mixed

__toString()

Converts the description to a string.

public __toString() : string
Return values
string

addParagraph()

Adds a paragraph to the description. If the paragraph contains \n\n, it gets broken into multiple paragraphs first.

public addParagraph(string $paragraph) : void
Parameters
$paragraph : string
Return values
void

getDescriptionBack()

Converts the description to a string.

public getDescriptionBack() : string
Return values
string

splitIntoParagraphs()

Splits a given string into an array ("paragraphs").

private splitIntoParagraphs(string $input) : array<string|int, mixed>

This method takes a string, normalizes line ends and then splits it at every double line break (\n\n).

Parameters
$input : string
Return values
array<string|int, mixed>

Search results