Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/common-api/gamestate.js
Show First 20 Lines • Show All 201 Lines • ▼ Show 20 Lines | for (let entity of requirement.entities) | ||||
"class": entity.class, | "class": entity.class, | ||||
"count": entity.number | "count": entity.number | ||||
}); | }); | ||||
} | } | ||||
return entityReqs; | return entityReqs; | ||||
}; | }; | ||||
m.GameState.prototype.isResearched = function(template) | m.GameState.prototype.isResearched = function(template) | ||||
wraitii: I have a hunch this might no longer be required. Needs grep-ing. | |||||
{ | { | ||||
return this.playerData.researchedTechs.has(template); | return this.playerData.researchedTechs.has(template); | ||||
}; | }; | ||||
m.GameState.prototype.areResearched = function(techs) | |||||
Not Done Inline Actionstechs.every((tech) => this.playerData.researchedTechs.has(tech)) lyv: `techs.every((tech) => this.playerData.researchedTechs.has(tech))`
TBH, I dont really see the… | |||||
Done Inline Actionsone function call instead for every tech Silier: one function call instead for every tech | |||||
{ | |||||
for (let tech of techs) { | |||||
Not Done Inline ActionsCan this be written differently ? Stan: Can this be written differently ? | |||||
Done Inline Actionsfor each loop, for loop, while, or this, I think this is the shortest way Silier: for each loop, for loop, while, or this, I think this is the shortest way | |||||
if (!this.playerData.researchedTechs.has(tech)) | |||||
return false; | |||||
} | |||||
return true; | |||||
} | |||||
/** true if started or queued */ | /** true if started or queued */ | ||||
m.GameState.prototype.isResearching = function(template) | m.GameState.prototype.isResearching = function(template) | ||||
{ | { | ||||
return this.playerData.researchStarted.has(template) || | return this.playerData.researchStarted.has(template) || | ||||
this.playerData.researchQueued.has(template); | this.playerData.researchQueued.has(template); | ||||
}; | }; | ||||
/** this is an "in-absolute" check that doesn't check if we have a building to research from. */ | /** this is an "in-absolute" check that doesn't check if we have a building to research from. */ | ||||
▲ Show 20 Lines • Show All 715 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
I have a hunch this might no longer be required. Needs grep-ing.