Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/tests/test_Builder.js
Engine.LoadHelperScript("ValueModification.js"); | Engine.LoadHelperScript("ValueModification.js"); | ||||
Engine.LoadHelperScript("Player.js"); | Engine.LoadHelperScript("Player.js"); | ||||
Engine.LoadComponentScript("interfaces/Builder.js"); | Engine.LoadComponentScript("interfaces/Builder.js"); | ||||
Engine.LoadComponentScript("Builder.js"); | Engine.LoadComponentScript("Builder.js"); | ||||
const builderId = 6; | const builderId = 6; | ||||
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 | ||||
}); | }); | ||||
let cmpBuilder = ConstructComponent(builderId, "Builder", { | let cmpBuilder = ConstructComponent(builderId, "Builder", { | ||||
"Rate": 1.0, | "Rate": "1", | ||||
bb: trailing 0 | |||||
"Entities": { "_string": "structures/{civ}_barracks structures/{civ}_civil_centre structures/{native}_house" } | "Entities": { "_string": "structures/{civ}_barracks structures/{civ}_civil_centre structures/{native}_house" }, | ||||
Done Inline ActionsShouldn't it be a string? To catch conversion errors Stan: Shouldn't it be a string? To catch conversion errors | |||||
Done Inline ActionsIn fact that is a good idea (imo), however it is done nowhere afaik bb: In fact that is a good idea (imo), however it is done nowhere afaik | |||||
Done Inline ActionsI usually do it in test I write :D Stan: I usually do it in test I write :D | |||||
"SearchRange": "64" | |||||
}); | }); | ||||
TS_ASSERT_UNEVAL_EQUALS(cmpBuilder.GetEntitiesList(), []); | TS_ASSERT_UNEVAL_EQUALS(cmpBuilder.GetEntitiesList(), []); | ||||
AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | ||||
"GetPlayerByID": id => playerEntityID | "GetPlayerByID": id => playerEntityID | ||||
}); | }); | ||||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
trailing 0