Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/petra/queue.js
Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | |||||
m.Queue.prototype.countQueuedUnits = function() | m.Queue.prototype.countQueuedUnits = function() | ||||
{ | { | ||||
let count = 0; | let count = 0; | ||||
for (let plan of this.plans) | for (let plan of this.plans) | ||||
count += plan.number; | count += plan.number; | ||||
return count; | return count; | ||||
}; | }; | ||||
m.Queue.prototype.hasQueuedUnitsWithClass = function(classe) | m.Queue.prototype.hasQueuedUnitsWithClass = function(classes) | ||||
{ | { | ||||
return this.plans.some(plan => plan.template && plan.template.hasClass(classe)); | return this.plans.some(plan => plan.template && MatchesClassList(plan.template.classes(), classes)); | ||||
}; | }; | ||||
m.Queue.prototype.countQueuedUnitsWithClass = function(classe) | m.Queue.prototype.countQueuedUnitsWithClass = function(classes) | ||||
{ | { | ||||
let count = 0; | let count = 0; | ||||
for (let plan of this.plans) | for (let plan of this.plans) | ||||
if (plan.template && plan.template.hasClass(classe)) | if (plan.template && MatchesClassList(plan.template.classes(), classes)) | ||||
count += plan.number; | count += plan.number; | ||||
return count; | return count; | ||||
}; | }; | ||||
m.Queue.prototype.countQueuedUnitsWithMetadata = function(data, value) | m.Queue.prototype.countQueuedUnitsWithMetadata = function(data, value) | ||||
{ | { | ||||
let count = 0; | let count = 0; | ||||
for (let plan of this.plans) | for (let plan of this.plans) | ||||
Show All 40 Lines |
Wildfire Games · Phabricator