resetGame() {
    this.setState(st => ({
      halflingDice: Array.from({ length: NUM_DICE }).fill(6),
      locked: Array(NUM_DICE).fill(true),
      giantDie: Array.from({ length: G_DICE }).fill(5),
      giantLock: Array(G_DICE).fill(true),
      split: false,
      legendary: false,
      coins: {
        // House has unlimited funds, so giantHoard is how much Giant has
        // gained or lost this game and is not reset.
        giantHoard: st.coins.giantHoard,
        halflingLoot: STARTING_FUNDS,
        pot: 0,
      },
      isShowing: false,
      modalContent: {
        btnText: 'CONTINUE',
        header: 'Ready for another round of Giants and Halflings?',
        gold: STARTING_FUNDS,
        message: `You will be loaned another ${STARTING_FUNDS} gold pieces.`,
        close: this.toggleModal,
      }
    }));
    this.toggleModal();
    return this.state.coins;
  }
/**
   * Resets game with an initial loan of 30 gold, but giant hoard unchanged.
   * @returns this.state.coins // so we can confirm player at zero and giant unchanged.
   */
Resets game with an initial loan of 30 gold, but giant hoard unchanged.
@returns this.state.coins // so we can confirm player at zero and giant unchanged.
Resets game with an initial loan of 30 gold but giant hoard unchanged . @returns this . state . coins // so we can confirm player at zero and giant unchanged .
resetGame() {
    this.setState(st => ({
      halflingDice: Array.from({ length: NUM_DICE }).fill(6),
      locked: Array(NUM_DICE).fill(true),
      giantDie: Array.from({ length: G_DICE }).fill(5),
      giantLock: Array(G_DICE).fill(true),
      split: false,
      legendary: false,
      coins: {
        giantHoard: st.coins.giantHoard,
        halflingLoot: STARTING_FUNDS,
        pot: 0,
      },
      isShowing: false,
      modalContent: {
        btnText: 'CONTINUE',
        header: 'Ready for another round of Giants and Halflings?',
        gold: STARTING_FUNDS,
        message: `You will be loaned another ${STARTING_FUNDS} gold pieces.`,
        close: this.toggleModal,
      }
    }));
    this.toggleModal();
    return this.state.coins;
  }
resetGame ( ) { this . setState ( st => ( { halflingDice : Array . from ( { length : NUM_DICE } ) . fill ( 6 ) , locked : Array ( NUM_DICE ) . fill ( true ) , giantDie : Array . from ( { length : G_DICE } ) . fill ( 5 ) , giantLock : Array ( G_DICE ) . fill ( true ) , split : false , legendary : false , coins : { giantHoard : st . coins . giantHoard , halflingLoot : STARTING_FUNDS , pot : 0 , } , isShowing : false , modalContent : { btnText : 'CONTINUE' , header : 'Ready for another round of Giants and Halflings?' , gold : STARTING_FUNDS , message : ` ${ STARTING_FUNDS } ` , close : this . toggleModal , } } ) ) ; this . toggleModal ( ) ; return this . state . coins ; }
Resets game with an initial loan of 30 gold, but giant hoard unchanged.
Resets game with an initial loan of 30 gold but giant hoard unchanged .
// House has unlimited funds, so giantHoard is how much Giant has // gained or lost this game and is not reset.