Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/petra/queueplanTraining.js
var PETRA = function(m) | (function(m) | ||||
{ | { | ||||
m.TrainingPlan = function(gameState, type, metadata, number = 1, maxMerge = 5) | m.TrainingPlan = function(gameState, type, metadata, number = 1, maxMerge = 5) | ||||
{ | { | ||||
if (!m.QueuePlan.call(this, gameState, type, metadata)) | if (!m.QueuePlan.call(this, gameState, type, metadata)) | ||||
{ | { | ||||
API3.warn(" Plan training " + type + " canceled"); | API3.warn(" Plan training " + type + " canceled"); | ||||
return false; | return false; | ||||
▲ Show 20 Lines • Show All 174 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
for (let key in data) | for (let key in data) | ||||
this[key] = data[key]; | this[key] = data[key]; | ||||
this.cost = new API3.Resources(); | this.cost = new API3.Resources(); | ||||
this.cost.Deserialize(data.cost); | this.cost.Deserialize(data.cost); | ||||
}; | }; | ||||
return m; | }(PETRA)); | ||||
}(PETRA); |
Wildfire Games · Phabricator