Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IChipService

Provides services for Chip management

Hierarchy

  • IChipService

Implemented by

Index

Methods

colorUp

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

createChips

  • createChips(amount: number, canBeSingleChip?: undefined | false | true, chipType?: typeof Chip): IChip[]
  • Given an amount, and a Chip class that has a specified IChip.valueMap, return an IChip[] that has a value to match requested amount

    Parameters

    • amount: number
    • Optional canBeSingleChip: undefined | false | true
    • Optional chipType: typeof Chip

    Returns IChip[]

makeChange

  • 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
    • needValue: number
    • Optional chipType: typeof Chip

    Returns IChip[]

removeChipsFromStack

sortByValue

valueOfChips

  • valueOfChips(chips: IChip[]): number

Generated using TypeDoc