Zed. The source code to build a world.

TravelPlace
in package

TravelPlace class

The TravelPlace class is a set of rules determining what moves are valid in a specific place.

Tags
see
Place

Table of Contents

Properties

$code  : string
The place code
$freeLocalMove  : bool
Determines if any local location move is valid
$globalTravelTo  : array<string|int, mixed>
Array of strings, each item another place reachable
$localMoves  : array<string|int, mixed>
Array of array, containing [location, alias, name] entries
$rewriteRules  : array<string|int, mixed>
Array of array, containing [expression, global_location, local_location] entries

Methods

from_xml()  : TravelPlace
Initializes a new TravelPlace instance, from the specified XML fragment

Properties

$code

The place code

public string $code

$freeLocalMove

Determines if any local location move is valid

public bool $freeLocalMove = \false

$globalTravelTo

Array of strings, each item another place reachable

public array<string|int, mixed> $globalTravelTo = []

This matches GlobalTravelTo XML tags.

$localMoves

Array of array, containing [location, alias, name] entries

public array<string|int, mixed> $localMoves = []

This matches LocalMove XML tags.

$rewriteRules

Array of array, containing [expression, global_location, local_location] entries

public array<string|int, mixed> $rewriteRules = []

This matches RewriteRule XML tags.

Methods

from_xml()

Initializes a new TravelPlace instance, from the specified XML fragment

public static from_xml(string $xml) : TravelPlace
Parameters
$xml : string

the XML fragment to parse

Return values
TravelPlace

the TravelPlace instance matching the specified XML fragment


        
On this page

Search results