Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/Researcher.js
Show First 20 Lines • Show All 141 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
Researcher.prototype.Init = function() | Researcher.prototype.Init = function() | ||||
{ | { | ||||
this.nextID = 1; | this.nextID = 1; | ||||
this.queue = new Map(); | this.queue = new Map(); | ||||
}; | }; | ||||
Researcher.prototype.Update = function(newTemplate) | |||||
{ | |||||
this.template = newTemplate; | |||||
// TODO: what to do if the queue now contains invalid items ? | |||||
}; | |||||
Researcher.prototype.Serialize = function() | Researcher.prototype.Serialize = function() | ||||
{ | { | ||||
const queue = []; | const queue = []; | ||||
for (const [id, item] of this.queue) | for (const [id, item] of this.queue) | ||||
queue.push(item.Serialize(id)); | queue.push(item.Serialize(id)); | ||||
return { | return { | ||||
"nextID": this.nextID, | "nextID": this.nextID, | ||||
▲ Show 20 Lines • Show All 224 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator