Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
Show All 9 Lines | |||||
Engine.LoadComponentScript("interfaces/Formation.js"); | Engine.LoadComponentScript("interfaces/Formation.js"); | ||||
Engine.LoadComponentScript("interfaces/Heal.js"); | Engine.LoadComponentScript("interfaces/Heal.js"); | ||||
Engine.LoadComponentScript("interfaces/Health.js"); | Engine.LoadComponentScript("interfaces/Health.js"); | ||||
Engine.LoadComponentScript("interfaces/Pack.js"); | Engine.LoadComponentScript("interfaces/Pack.js"); | ||||
Engine.LoadComponentScript("interfaces/ResourceSupply.js"); | Engine.LoadComponentScript("interfaces/ResourceSupply.js"); | ||||
Engine.LoadComponentScript("interfaces/ResourceGatherer.js"); | Engine.LoadComponentScript("interfaces/ResourceGatherer.js"); | ||||
Engine.LoadComponentScript("interfaces/Timer.js"); | Engine.LoadComponentScript("interfaces/Timer.js"); | ||||
Engine.LoadComponentScript("interfaces/UnitAI.js"); | Engine.LoadComponentScript("interfaces/UnitAI.js"); | ||||
Engine.LoadComponentScript("interfaces/Upgrade.js"); | |||||
Engine.LoadComponentScript("Formation.js"); | Engine.LoadComponentScript("Formation.js"); | ||||
Engine.LoadComponentScript("UnitAI.js"); | Engine.LoadComponentScript("UnitAI.js"); | ||||
/** | /** | ||||
* Fairly straightforward test that entity renaming is handled | * Fairly straightforward test that entity renaming is handled | ||||
* by unitAI states. These ought to be augmented with integration tests, ideally. | * by unitAI states. These ought to be augmented with integration tests, ideally. | ||||
*/ | */ | ||||
function TestTargetEntityRenaming(init_state, post_state, setup) | function TestTargetEntityRenaming(init_state, post_state, setup) | ||||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | function TestFormationExiting(mode) | ||||
var playerEntity = 5; | var playerEntity = 5; | ||||
var unit = 10; | var unit = 10; | ||||
var enemy = 20; | var enemy = 20; | ||||
var controller = 30; | var controller = 30; | ||||
AddMock(SYSTEM_ENTITY, IID_Timer, { | AddMock(SYSTEM_ENTITY, IID_Timer, { | ||||
SetInterval: function() { }, | SetInterval: function() { }, | ||||
Lint: ESLintBear (quote-props): `Unquoted property 'SetInterval' found.` | |||||
SetTimeout: function() { }, | SetTimeout: function() { }, | ||||
Lint: ESLintBear (quote-props) Unquoted property 'SetTimeout' found. Lint: ESLintBear (quote-props): `Unquoted property 'SetTimeout' found.` | |||||
}); | }); | ||||
AddMock(SYSTEM_ENTITY, IID_RangeManager, { | AddMock(SYSTEM_ENTITY, IID_RangeManager, { | ||||
CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | ||||
Lint: ESLintBear (quote-props) Unquoted property 'CreateActiveQuery' found. Lint: ESLintBear (quote-props): `Unquoted property 'CreateActiveQuery' found.` | |||||
return 1; | return 1; | ||||
}, | }, | ||||
EnableActiveQuery: function(id) { }, | EnableActiveQuery: function(id) { }, | ||||
ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | ||||
DisableActiveQuery: function(id) { }, | DisableActiveQuery: function(id) { }, | ||||
GetEntityFlagMask: function(identifier) { }, | GetEntityFlagMask: function(identifier) { }, | ||||
}); | }); | ||||
▲ Show 20 Lines • Show All 315 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Unquoted property 'SetInterval' found.