Differential D1418 Diff 12057 ps/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | function TestTargetEntityRenaming(init_state, post_state, setup) | ||||
TS_ASSERT_EQUALS(unitAI.GetCurrentState(), post_state); | TS_ASSERT_EQUALS(unitAI.GetCurrentState(), post_state); | ||||
} | } | ||||
TestTargetEntityRenaming( | TestTargetEntityRenaming( | ||||
"INDIVIDUAL.GARRISON.APPROACHING", "INDIVIDUAL.IDLE", | "INDIVIDUAL.GARRISON.APPROACHING", "INDIVIDUAL.IDLE", | ||||
(unitAI, player_ent, target_ent) => { | (unitAI, player_ent, target_ent) => { | ||||
unitAI.CanGarrison = (target) => target == target_ent; | unitAI.CanGarrison = (target) => target == target_ent; | ||||
unitAI.MoveToGarrisonRange = (target) => target == target_ent; | unitAI.MoveToGarrisonRange = (target) => target == target_ent; | ||||
unitAI.AbleToMove = () => true; | |||||
AddMock(target_ent, IID_GarrisonHolder, { | AddMock(target_ent, IID_GarrisonHolder, { | ||||
"CanPickup": () => false | "CanPickup": () => false | ||||
}); | }); | ||||
unitAI.Garrison(target_ent, false); | unitAI.Garrison(target_ent, false); | ||||
} | } | ||||
); | ); | ||||
▲ Show 20 Lines • Show All 344 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator