fungi-inventory.js
/*
  Adding something from the board to the inventory is done via copying values
  into an array and passing it over to the inventory - thats why add receives
  one argument that contains the pickup's type and value.
  */
Adding something from the board to the inventory is done via copying values
into an array and passing it over to the inventory - thats why add receives
one argument that contains the pickup's type and value.
Adding something from the board to the inventory is done via copying values into an array and passing it over to the inventory - thats why add receives one argument that contains the pickup ' s type and value .
add (contents) {
    let freeSlotId = this.slots.findIndex(e => e.type === null)
    if (freeSlotId > -1) {
      this.slots[freeSlotId].type = contents[0]
      this.slots[freeSlotId].stage = contents[1]
    }
    if (this.isFull() && this.slotsAllIdentical() && this.slots[0].stage < 3) {
      this.collapse()
    }
  }
add ( contents ) { let freeSlotId = this . slots . findIndex ( e => e . type === null ) if ( freeSlotId > - 1 ) { this . slots [ freeSlotId ] . type = contents [ 0 ] this . slots [ freeSlotId ] . stage = contents [ 1 ] } if ( this . isFull ( ) && this . slotsAllIdentical ( ) && this . slots [ 0 ] . stage < 3 ) { this . collapse ( ) } }
Adding something from the board to the inventory is done via copying values
into an array and passing it over to the inventory - thats why add receives
one argument that contains the pickup's type and value.
Adding something from the board to the inventory is done via copying values into an array and passing it over to the inventory - thats why add receives one argument that contains the pickup ' s type and value .