Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ChipService

Hierarchy

  • ChipService

Implements

Index

Methods

colorUp

  • colorUp(chips: IChip[], chipType?: typeof Chip): IChip[]

createChips

  • createChips(amount: number, canBeSingleChip?: boolean, chipType?: typeof Chip): IChip[]
  • Parameters

    • amount: number
    • Default value canBeSingleChip: boolean = true
    • Default value chipType: typeof Chip = StandardChip

    Returns IChip[]

hasCombinationOfAmount

  • hasCombinationOfAmount(amount: number, chips: IChip[]): IChip[]

makeChange

  • makeChange(chipCollection: IChipCollection, needValue: number, chipType?: typeof Chip, colorUp?: boolean): IChip[]
  • The service should accept an IChipCollection and a requested specific amount of chip value, and be able to "break" or "make change" to swap out chips to meet that exact need. These chips are removed from the incoming chipCollection and the return value are chips that match the needValue requested.

    Parameters

    • chipCollection: IChipCollection

      Chips to create needValue from

    • needValue: number

      Amount requested from chips

    • Default value chipType: typeof Chip = StandardChip

      Class of Chip to return

    • Default value colorUp: boolean = false

    Returns IChip[]

removeChipsFromStack

sortByValue

valueOfChips

  • valueOfChips(chips: IChip[]): number

Generated using TypeDoc