File structure
This commit is contained in:
11
gather/src/items/Archwings.js
Normal file
11
gather/src/items/Archwings.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const Item = require('./Item')
|
||||
|
||||
module.exports = class Archwings extends Item {
|
||||
constructor (name) {
|
||||
super(name)
|
||||
|
||||
this.addPart('harness')
|
||||
this.addPart('wings')
|
||||
this.addPart('systems')
|
||||
}
|
||||
}
|
||||
11
gather/src/items/Companion.js
Normal file
11
gather/src/items/Companion.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const Item = require('./Item')
|
||||
|
||||
module.exports = class Companion extends Item {
|
||||
constructor (name) {
|
||||
super(name)
|
||||
|
||||
this.addPart('carapace')
|
||||
this.addPart('cerebrum')
|
||||
this.addPart('systems')
|
||||
}
|
||||
}
|
||||
15
gather/src/items/Item.js
Normal file
15
gather/src/items/Item.js
Normal file
@@ -0,0 +1,15 @@
|
||||
const Part = require('./Part')
|
||||
|
||||
module.exports = class Item {
|
||||
constructor (name) {
|
||||
this.name = name
|
||||
this.set = new Part(name, 'set')
|
||||
|
||||
this.parts = []
|
||||
this.addPart('blueprint')
|
||||
}
|
||||
|
||||
addPart (part, amount) {
|
||||
this.parts.push(new Part(this.name, part, amount))
|
||||
}
|
||||
}
|
||||
14
gather/src/items/Part.js
Normal file
14
gather/src/items/Part.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const Api = require('../api')
|
||||
|
||||
module.exports = class Part {
|
||||
constructor (set, part, amount) {
|
||||
this.part = part
|
||||
this.url = `${set}_prime_${part}`
|
||||
this.amount = amount ?? 1
|
||||
}
|
||||
|
||||
async getPrice () {
|
||||
const orders = await Api.getSortedOrders(this.url)
|
||||
return Number(orders[0].platinum) * this.amount
|
||||
}
|
||||
}
|
||||
11
gather/src/items/Primary.js
Normal file
11
gather/src/items/Primary.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const Item = require('./Item')
|
||||
|
||||
module.exports = class Primary extends Item {
|
||||
constructor (name) {
|
||||
super(name)
|
||||
|
||||
this.addPart('barrel')
|
||||
this.addPart('receiver')
|
||||
this.addPart('stock')
|
||||
}
|
||||
}
|
||||
11
gather/src/items/Secondary.js
Normal file
11
gather/src/items/Secondary.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const Item = require('./Item')
|
||||
|
||||
module.exports = class Secondary extends Item {
|
||||
constructor (name) {
|
||||
super(name)
|
||||
|
||||
this.addPart('barrel', 2)
|
||||
this.addPart('receiver', 2)
|
||||
this.addPart('link')
|
||||
}
|
||||
}
|
||||
11
gather/src/items/Warframe.js
Normal file
11
gather/src/items/Warframe.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const Item = require('./Item')
|
||||
|
||||
module.exports = class Warframe extends Item {
|
||||
constructor (name) {
|
||||
super(name)
|
||||
|
||||
this.addPart('systems')
|
||||
this.addPart('neuroptics')
|
||||
this.addPart('chassis')
|
||||
}
|
||||
}
|
||||
26
gather/src/items/index.js
Normal file
26
gather/src/items/index.js
Normal file
@@ -0,0 +1,26 @@
|
||||
const items = require('./items.json')
|
||||
const Warframe = require('./Warframe')
|
||||
// const Primary = require('./Primary')
|
||||
// const Secondary = require('./Secondary')
|
||||
const Companion = require('./Companion')
|
||||
const Archwings = require('./Archwings')
|
||||
|
||||
const result = []
|
||||
|
||||
items.warframes.forEach((name) => {
|
||||
result.push(new Warframe(name))
|
||||
})
|
||||
|
||||
// items.primaries.forEach((name) => {
|
||||
// result.push(new Primary(name))
|
||||
// })
|
||||
|
||||
items.companions.forEach((name) => {
|
||||
result.push(new Companion(name))
|
||||
})
|
||||
|
||||
items.archwings.forEach((name) => {
|
||||
result.push(new Archwings(name))
|
||||
})
|
||||
|
||||
module.exports = result
|
||||
22
gather/src/items/items.json
Normal file
22
gather/src/items/items.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"warframes": [
|
||||
"ash", "atlas", "banshee", "chroma", "ember",
|
||||
"equinox", "frost", "gara", "harrow", "hydroid",
|
||||
"inaros", "ivara", "limbo", "loki", "mag",
|
||||
"mesa", "mirage", "nekros", "nezha", "nidus",
|
||||
"nova", "nyx", "oberon", "octavia", "rhino",
|
||||
"saryn", "titania", "trinity", "valkyr", "vauban",
|
||||
"volt", "wukong", "zephyr"
|
||||
],
|
||||
"primaries": [
|
||||
"astilla", "baza", "boar", "boltor", "braton",
|
||||
"burston", "corinth", "larton", "panthera",
|
||||
"rubico", "scourge", "soma", "stradavar",
|
||||
"strun", "sybaris", "tenora", "tiberon", "tigris",
|
||||
"vectis", "zhuge"
|
||||
],
|
||||
"companions": [
|
||||
"carrier", "dethcube", "helios", "wyrm"
|
||||
],
|
||||
"archwings": ["odonata"]
|
||||
}
|
||||
Reference in New Issue
Block a user