isPlayerInstance

Checks if the given entity is an instance of a connected player.

@safe @nogc
bool
isPlayerInstance

Parameters

entity Entity

an instance of an entity

Return Value

Type: bool

true if the entity can be casted to Player and not to Puppet

Examples

assert(isPlayerInstance(player!"steve"));
assert(!isPlayerInstance(new Puppet(player!"steve")));

Meta