Differential D557 Diff 2260 ps/trunk/binaries/data/mods/public/simulation/components/tests/test_WayPoint.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/components/tests/test_WayPoint.js
Engine.LoadComponentScript("interfaces/WayPoint.js"); | |||||
Engine.LoadComponentScript("WayPoint.js"); | |||||
let cmpWayPoint = ConstructComponent(ent, "Pack", {}); | |||||
TS_ASSERT_UNEVAL_EQUALS(cmpWayPoint.GetPositions, []); | |||||
cmpWayPoint.AddPosition(10, 5); | |||||
TS_ASSERT_UNEVAL_EQUALS(cmpWayPoint.GetPositions, [{ 'x': 10, 'z': 5 }]); | |||||
cmpWayPoint.AddPosition(6, 8); | |||||
TS_ASSERT_UNEVAL_EQUALS(cmpWayPoint.GetPositions, [{ 'x': 10, 'z': 5 }, { 'x': 6, 'z': 8 }]); | |||||
cmpWayPoint.Shift(); | |||||
TS_ASSERT_UNEVAL_EQUALS(cmpWayPoint.GetPositions, [{ 'x': 6, 'z': 8 }]); | |||||
cmpWayPoint.Unset(); | |||||
TS_ASSERT_UNEVAL_EQUALS(cmpWayPoint.GetPositions, []); |
Wildfire Games · Phabricator