Documentation

GameMode
in package
Uses EnumTrait

This doc-block is generated automatically, do not modify it manually.

This must be regenerated whenever registry members are added, removed or changed.

Tags
see

build/generate-registry-annotations.php

generate-registry-docblock

Table of Contents

$aliasMap  : array<string|int, self>
$aliases  : array<string|int, string>
$englishName  : string
$enumName  : string
$nextId  : int|null
$runtimeId  : int
$translatableName  : Translatable
ADVENTURE()  : GameMode
CREATIVE()  : GameMode
equals()  : bool
Returns whether the two objects are equivalent.
fromString()  : self|null
getAliases()  : array<string|int, string>
getAll()  : array<string|int, self>
Returns all members of the enum.
getEnglishName()  : string
getTranslatableName()  : Translatable
id()  : int
Returns a runtime-only identifier for this enum member. This will be different with each run, so don't try to hardcode it.
name()  : string
SPECTATOR()  : GameMode
SURVIVAL()  : GameMode
register()  : void
registerAll()  : void
setup()  : void
__construct()  : mixed

Properties

$aliasMap

protected static array<string|int, self> $aliasMap = []

$aliases

private array<string|int, string> $aliases

$englishName

private string $englishName

$nextId

private static int|null $nextId = null

Methods

equals()

Returns whether the two objects are equivalent.

public equals(self $other) : bool
Parameters
$other : self
Return values
bool

fromString()

public static fromString(string $str) : self|null
Parameters
$str : string
Return values
self|null

getAliases()

public getAliases() : array<string|int, string>
Return values
array<string|int, string>

getAll()

Returns all members of the enum.

public static getAll() : array<string|int, self>

This is overridden to change the return typehint.

Return values
array<string|int, self>

getEnglishName()

public getEnglishName() : string
Return values
string

id()

Returns a runtime-only identifier for this enum member. This will be different with each run, so don't try to hardcode it.

public id() : int

This can be useful for switches or array indexing.

Return values
int

name()

public name() : string
Return values
string

register()

protected static register(self $member) : void
Parameters
$member : self
Return values
void

registerAll()

protected static registerAll(self ...$members) : void
Parameters
$members : self
Return values
void

setup()

protected static setup() : void
Return values
void

__construct()

private __construct(string $enumName, string $englishName, Translatable $translatableName[, array<string|int, string> $aliases = [] ]) : mixed
Parameters
$enumName : string
$englishName : string
$translatableName : Translatable
$aliases : array<string|int, string> = []
Return values
mixed

Search results