Differential D270 Diff 12027 binaries/data/mods/public/simulation/components/tests/test_ProductionQueue.js
Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/tests/test_ProductionQueue.js
Show All 15 Lines | |||||
const playerId = 1; | const playerId = 1; | ||||
const playerEntityID = 2; | const playerEntityID = 2; | ||||
AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | ||||
"TemplateExists": () => true, | "TemplateExists": () => true, | ||||
"GetTemplate": name => ({}) | "GetTemplate": name => ({}) | ||||
}); | }); | ||||
Engine.RegisterGlobal("ApplyValueModificationsToEntity", (prop, oVal, ent) => oVal); | |||||
let cmpProductionQueue = ConstructComponent(productionQueueId, "ProductionQueue", { | let cmpProductionQueue = ConstructComponent(productionQueueId, "ProductionQueue", { | ||||
"Entities": { "_string": "units/{civ}_cavalry_javelinist_b " + | "Entities": { "_string": "units/{civ}_cavalry_javelinist_b " + | ||||
"units/{civ}_infantry_swordsman_b " + | "units/{civ}_infantry_swordsman_b " + | ||||
"units/{native}_support_female_citizen" }, | "units/{native}_support_female_citizen" }, | ||||
"Technologies": { "_string": "gather_fishing_net " + | "Technologies": { "_string": "gather_fishing_net " + | ||||
"phase_town_{civ} " + | "phase_town_{civ} " + | ||||
"phase_city_{civ}" } | "phase_city_{civ}" } | ||||
}); | }); | ||||
▲ Show 20 Lines • Show All 117 Lines • ▼ Show 20 Lines | |||||
Engine.LoadComponentScript("interfaces/Trigger.js"); | Engine.LoadComponentScript("interfaces/Trigger.js"); | ||||
Engine.LoadComponentScript("EntityLimits.js"); | Engine.LoadComponentScript("EntityLimits.js"); | ||||
Engine.LoadComponentScript("TrainingRestrictions.js"); | Engine.LoadComponentScript("TrainingRestrictions.js"); | ||||
Engine.LoadHelperScript("Sound.js"); | Engine.LoadHelperScript("Sound.js"); | ||||
Engine.RegisterGlobal("ApplyValueModificationsToEntity", (_, value) => value); | Engine.RegisterGlobal("ApplyValueModificationsToEntity", (_, value) => value); | ||||
Engine.RegisterGlobal("ApplyValueModificationsToTemplate", (_, value) => value); | Engine.RegisterGlobal("ApplyValueModificationsToTemplate", (_, value) => value); | ||||
function regression_test_d1879() | function regression_test_d1879() | ||||
Freagarach: One can seperate logical parts in the test using comments instead of creating a function and… | |||||
Done Inline ActionsMh, I would disagree on the grounds that this creates some weird global state. I don't really care what "testEntitiesList" does in my own test below. wraitii: Mh, I would disagree on the grounds that this creates some weird global state. I don't really… | |||||
Done Inline Actionser -> I say that but I keep the global state since things don't get magically cleaned up -__- Still... wraitii: er -> I say that but I keep the global state since things don't get magically cleaned up -__… | |||||
Not Done Inline Actions
Yes? :P Freagarach: > Still...
Yes? :P | |||||
Done Inline ActionsPoint is I don't think this is much worse or much better :p wraitii: Point is I don't think this is much worse or much better :p
I'm leaving as is | |||||
{ | { | ||||
// Setup | // Setup | ||||
let playerEnt = 2; | let playerEnt = 2; | ||||
let playerID = 1; | let playerID = 1; | ||||
let testEntity = 3; | let testEntity = 3; | ||||
let spawedEntityIDs = [4, 5, 6, 7, 8]; | let spawedEntityIDs = [4, 5, 6, 7, 8]; | ||||
let spawned = 0; | let spawned = 0; | ||||
▲ Show 20 Lines • Show All 118 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
One can seperate logical parts in the test using comments instead of creating a function and calling it once (agreeing with @bb here).