Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/common-api/gamestate.js
Show First 20 Lines • Show All 720 Lines • ▼ Show 20 Lines | for (let trainable of allTrainable) | ||||
if (this.isTemplateDisabled(trainable)) | if (this.isTemplateDisabled(trainable)) | ||||
continue; | continue; | ||||
let template = this.getTemplate(trainable); | let template = this.getTemplate(trainable); | ||||
if (!template || !template.available(this)) | if (!template || !template.available(this)) | ||||
continue; | continue; | ||||
let limit = template.matchLimit(); | let limit = template.matchLimit(); | ||||
if (matchCounts && limit && matchCounts[trainable] >= limit) | if (matchCounts && limit && matchCounts[trainable] >= limit) | ||||
continue; | continue; | ||||
if (classes.some(c => !template.hasClass(c))) | if (!template.hasClasses(classes) || template.hasClasses(anticlasses)) | ||||
continue; | |||||
if (anticlasses.some(c => template.hasClass(c))) | |||||
continue; | continue; | ||||
let category = template.trainingCategory(); | let category = template.trainingCategory(); | ||||
if (category && limits[category] && current[category] >= limits[category]) | if (category && limits[category] && current[category] >= limits[category]) | ||||
continue; | continue; | ||||
ret.push([trainable, template]); | ret.push([trainable, template]); | ||||
} | } | ||||
return ret; | return ret; | ||||
▲ Show 20 Lines • Show All 194 Lines • ▼ Show 20 Lines | if (supportTraderTemplate) | ||||
ret.landGainMultiplier = norm * supportTraderTemplate.gainMultiplier(); | ret.landGainMultiplier = norm * supportTraderTemplate.gainMultiplier(); | ||||
if (shipMerchantTemplate) | if (shipMerchantTemplate) | ||||
ret.navalGainMultiplier = norm * shipMerchantTemplate.gainMultiplier(); | ret.navalGainMultiplier = norm * shipMerchantTemplate.gainMultiplier(); | ||||
return ret; | return ret; | ||||
}; | }; | ||||
return m; | return m; | ||||
}(API3); | }(API3); | ||||
Lint: no-use-before-define: 'API3' was used before it was defined. | |||||
Wildfire Games · Phabricator
'API3' was used before it was defined.