Slot
in package
FinalYes
One concrete slot in a slot space, or the special `nil` boundary slot.
Table of Contents
Properties
- $attributes : array<string|int, mixed>
- $dimensions : array<string|int, mixed>|null
- $key : string
- $space : SlotSpace
Methods
- __construct() : mixed
- __toString() : non-empty-string
- Return the serialized slot key.
- dimension() : non-empty-string
- Get the value of a specific dimension by name.
- equals() : bool
- Compare two slots by their serialized key.
- isNil() : bool
- Return true when this is the special out-of-space nil slot.
- outgoingEdges() : array<non-empty-string, MovementEdge>
- Return the currently valid outgoing edges from this slot.
- with() : array<string|int, Slot>
- Return slots produced by overriding dimensions on this slot.
- withMeta() : self
- Return a copy of the slot with additional metadata attributes.
Properties
$attributes read-only
public
array<string|int, mixed>
$attributes
= []
$dimensions read-only
public
array<string|int, mixed>|null
$dimensions
$key read-only
public
string
$key
$space read-only
public
SlotSpace
$space
Methods
__construct()
public
__construct(non-empty-string $key, array<non-empty-string, non-empty-string>|null $dimensions, SlotSpace $space[, array<string, mixed> $attributes = [] ]) : mixed
Parameters
- $key : non-empty-string
- $dimensions : array<non-empty-string, non-empty-string>|null
- $space : SlotSpace
- $attributes : array<string, mixed> = []
__toString()
Return the serialized slot key.
public
__toString() : non-empty-string
Return values
non-empty-stringdimension()
Get the value of a specific dimension by name.
public
dimension(non-empty-string $name) : non-empty-string
Parameters
- $name : non-empty-string
Return values
non-empty-stringequals()
Compare two slots by their serialized key.
public
equals(Slot $other) : bool
Parameters
- $other : Slot
Return values
boolisNil()
Return true when this is the special out-of-space nil slot.
public
isNil() : bool
Return values
booloutgoingEdges()
Return the currently valid outgoing edges from this slot.
public
outgoingEdges() : array<non-empty-string, MovementEdge>
Return values
array<non-empty-string, MovementEdge>with()
Return slots produced by overriding dimensions on this slot.
public
with(array<non-empty-string, non-empty-string> $overrides) : array<string|int, Slot>
May return an empty array if the overridden slot does not exist. If this is the nil slot, the overrides are treated as a partial pattern match.
Parameters
- $overrides : array<non-empty-string, non-empty-string>
Return values
array<string|int, Slot>withMeta()
Return a copy of the slot with additional metadata attributes.
public
withMeta(array<string, mixed> $attributes) : self
Existing attributes keep precedence over newly provided ones.
Parameters
- $attributes : array<string, mixed>