Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CardCollection

Basic class to represent a grouping of ICards.

Supports activities like: getting list of cards, adding cards to group, taking first card, taking multiple cards, getting count of cards, and shuffling the cards.

Hierarchy

Implements

Index

Constructors

constructor

Properties

name

name: string = ""

Friendly name of card collection that means something: "Hand", "Discard Pile", "In Play", etc.

Methods

addCard

  • addCard(card: ICard): this

addCards

  • addCards(cards: ICard[]): this

cardAtIndex

  • cardAtIndex(index: number): ICard

getCards

getCount

  • getCount(): number

hasCard

  • hasCard(card: ICard): boolean

hasCards

  • hasCards(cards: ICard[]): boolean

indexOfCard

  • indexOfCard(card: ICard): number

isEmpty

  • isEmpty(): boolean

removeCards

  • removeCards(cards: ICard[]): this

setCards

  • setCards(cards: ICard[]): this

shuffle

  • shuffle(): void

takeCard

takeCards

  • takeCards(amount: number): ICard[]

Generated using TypeDoc