const Part = require('./Part')

function capitalize (string) {
  return string.charAt(0).toUpperCase() + string.slice(1)
}

module.exports = class Item {
  constructor (name) {
    this.name = name
    this.fullName = capitalize(name) + ' Prime'
    this.set = new Part(name, 'set')

    this.parts = []
    this.addPart('blueprint')
  }

  addPart (part, amount) {
    this.parts.push(new Part(this.name, part, amount))
  }
}
