Skip to main content

Class: ClassicCard<S, R>

entities.ClassicCard

Just a classic card.

Type parameters

NameType
Sextends Suit = Suit
Rextends Rank = Rank

Hierarchy

  • Entity<ClassicCardOptions<S, R>>

  • Mixin

    ClassicCard

Constructors

constructor

new ClassicCard<S, R>(state, options?)

Type parameters

NameType
Sextends Suit = Suit
Rextends Rank = Rank

Parameters

NameType
stateState<Record<string, unknown>>
optionsPartial<Partial<NonFunctionProperties<Mixin> & { rank: R ; suit: S }>>

Inherited from

Entity.constructor

ChildTrait Properties

idx

idx: number


parent

parent: ParentTrait


ClassicCard Properties

rank

rank: R


suit

suit: S


LabelTrait Properties

name

name: string


type

type: string

Type should be unique to schema object! If you're extending this schema and adding new fields - set the new type string!


LocationTrait Properties

angle

angle: number

Rotation in degrees


x

x: number

X offset relative to entity's parent


y

y: number

Y offset relative to entity's parent


Other Properties

id

Readonly id: number


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.


TwoSidedTrait Properties

faceUp

faceUp: boolean

ChildTrait Accessors

idxPath

get idxPath(): number[]

Returns

number[]

array of indexes for this entity access


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

ChildTrait Methods

isInteractive

isInteractive(): boolean

Points out if this element can be target of any interaction

Returns

boolean


Other Methods

create

create(state, options?): void

Parameters

NameType
stateState<Record<string, unknown>>
optionsPartial<NonFunctionProperties<Mixin> & { rank: R ; suit: S }>

Returns

void

Overrides

Entity.create


TwoSidedTrait Methods

flip

flip(): void

Flip the entity on to the other side

Returns

void


flipDown

flipDown(): void

Flip the entity to reveal its back side

Returns

void


flipUp

flipUp(): void

Flip the entity to reveal its face

Returns

void