Skip to main content

Class: OwnershipTrait

traits.OwnershipTrait

Entity with this trait can have a reference to Player, who "owns" this entity.

Constructors​

constructor​

• new OwnershipTrait()

OwnershipTrait Properties​

ownerID​

• ownerID: string

ID of the player owning this entity. Synced with client-side and automatically parsed after changing entity.owner from the server-side.

OwnershipTrait Accessors​

owner​

• get owner(): Player

Get the real owner of this thing, by traversing this.parent chain. Owner could be set on an element or container, meaning every element in such container belongs to one owner.

Returns​

Player

Player or undefined if this container doesn't belong to anyone

• set owner(newOwner): void

Parameters​

NameType
newOwnerPlayer

Returns​

void


ownersMainFocus​

• get ownersMainFocus(): boolean

Is this entity/container to be the main focus for this player? To be used by client-side implementation.

Returns​

boolean

• set ownersMainFocus(newValue): void

Parameters​

NameType
newValueboolean

Returns​

void