Class: ClassicCard<S, R>
entities.ClassicCard
Just a classic card.
Type parameters
| Name | Type |
|---|---|
S | extends Suit = Suit |
R | extends Rank = Rank |
Hierarchy
Entity<ClassicCardOptions<S,R>>Mixin↳
ClassicCard
Constructors
constructor
• new ClassicCard<S, R>(state, options?)
Type parameters
| Name | Type |
|---|---|
S | extends Suit = Suit |
R | extends Rank = Rank |
Parameters
| Name | Type |
|---|---|
state | State<Record<string, unknown>> |
options | Partial<Partial<NonFunctionProperties<Mixin> & { rank: R ; suit: S }>> |
Inherited from
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 or undefined if this container doesn't belong to anyone
• set owner(newOwner): void
Parameters
| Name | Type |
|---|---|
newOwner | Player |
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
| Name | Type |
|---|---|
newValue | boolean |
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
| Name | Type |
|---|---|
state | State<Record<string, unknown>> |
options | Partial<NonFunctionProperties<Mixin> & { rank: R ; suit: S }> |
Returns
void
Overrides
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