Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/tests/test_WayPoint.js
- This file was added.
Engine.LoadComponentScript("interfaces/WayPoint.js"); | |||||
Engine.LoadComponentScript("WayPoint.js"); | |||||
let entId = 1; | |||||
let cmpWayPoint = ConstructComponent(entId, "WayPoint", {}); | |||||
TS_ASSERT_UNEVAL_EQUALS(cmpWayPoint.GetPositions(), []); | |||||
cmpWayPoint.Stack(10, 5); | |||||
TS_ASSERT_UNEVAL_EQUALS(cmpWayPoint.GetPositions(), [{ 'x': 10, 'z': 5 }]); | |||||
cmpWayPoint.Stack(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