fungi-renderer.js
/*
  Functions below deal with slots, both in the inventory or on the board.
  All of them depend primarily on the renderSlot function.
  */
Functions below deal with slots, both in the inventory or on the board.
All of them depend primarily on the renderSlot function.
Functions below deal with slots both in the inventory or on the board . All of them depend primarily on the renderSlot function .
createSlot (slotData, slotId, containerDOMElement) {
    let slotDOMElement = document.createElement('div')
    slotDOMElement.id = slotId
    slotDOMElement.classList.add('slot')
    let slotImage = document.createElement('img')
    slotDOMElement.append(slotImage)
    slotDOMElement.setAttribute('type', 'null')
    slotDOMElement.setAttribute('stage', 'null')
    containerDOMElement.append(slotDOMElement)
    if (containerDOMElement == this.boardDOMElement) {
      slotDOMElement.setAttribute('style', this.getGrassBackgroundRule())
    }
    this.renderSlot(slotData, slotDOMElement, true)
  }
createSlot ( slotData , slotId , containerDOMElement ) { let slotDOMElement = document . createElement ( 'div' ) slotDOMElement . id = slotId slotDOMElement . classList . add ( 'slot' ) let slotImage = document . createElement ( 'img' ) slotDOMElement . append ( slotImage ) slotDOMElement . setAttribute ( 'type' , 'null' ) slotDOMElement . setAttribute ( 'stage' , 'null' ) containerDOMElement . append ( slotDOMElement ) if ( containerDOMElement == this . boardDOMElement ) { slotDOMElement . setAttribute ( 'style' , this . getGrassBackgroundRule ( ) ) } this . renderSlot ( slotData , slotDOMElement , true ) }
Functions below deal with slots, both in the inventory or on the board.
Functions below deal with slots both in the inventory or on the board .
// Initialize empty slot // Generate and add grassy background for board slots // Render the slot's contents