Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
Show First 20 Lines • Show All 111 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, accountForSize) { | CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags, accountForSize) { | ||||
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 64 Lines • ▼ Show 20 Lines | function TestFormationExiting(mode) | ||||
unitAI.SetupAttackRangeQuery(1); | unitAI.SetupAttackRangeQuery(1); | ||||
if (mode == 1) | if (mode == 1) | ||||
{ | { | ||||
AddMock(enemy, IID_Health, { | AddMock(enemy, IID_Health, { | ||||
GetHitpoints: function() { return 10; }, | GetHitpoints: function() { return 10; }, | ||||
}); | }); | ||||
AddMock(enemy, IID_UnitAI, { | AddMock(enemy, IID_UnitAI, { | ||||
Done Inline ActionsRedundant. Freagarach: Redundant. | |||||
IsAnimal: function() { return false; } | "IsAnimal": () => "false", | ||||
"IsDangerousAnimal": () => "false" | |||||
}); | }); | ||||
} | } | ||||
else if (mode == 2) | else if (mode == 2) | ||||
AddMock(enemy, IID_Health, { | AddMock(enemy, IID_Health, { | ||||
GetHitpoints: function() { return 0; }, | GetHitpoints: function() { return 0; }, | ||||
}); | }); | ||||
let controllerFormation = ConstructComponent(controller, "Formation", { | let controllerFormation = ConstructComponent(controller, "Formation", { | ||||
▲ Show 20 Lines • Show All 233 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Unquoted property 'SetInterval' found.