Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
Show First 20 Lines • Show All 228 Lines • ▼ Show 20 Lines | function TestFormationExiting(mode) | ||||
}); | }); | ||||
let controllerAI = ConstructComponent(controller, "UnitAI", { | let controllerAI = ConstructComponent(controller, "UnitAI", { | ||||
"FormationController": "true", | "FormationController": "true", | ||||
"DefaultStance": "aggressive" | "DefaultStance": "aggressive" | ||||
}); | }); | ||||
AddMock(controller, IID_Position, { | AddMock(controller, IID_Position, { | ||||
"JumpTo": function(x, z) { this.x = x; this.z = z; }, | "JumpTo": function(x, z) { this.x = x; this.z = z; }, | ||||
"TurnTo": function() {}, | |||||
Freagarach: This is enough, I guess.
(A anonymous function returning nothing.) | |||||
"GetTurretParent": function() { return INVALID_ENTITY; }, | "GetTurretParent": function() { return INVALID_ENTITY; }, | ||||
"GetPosition": function() { return new Vector3D(this.x, 0, this.z); }, | "GetPosition": function() { return new Vector3D(this.x, 0, this.z); }, | ||||
"GetPosition2D": function() { return new Vector2D(this.x, this.z); }, | "GetPosition2D": function() { return new Vector2D(this.x, this.z); }, | ||||
"GetRotation": function() { return { "y": 0 }; }, | "GetRotation": function() { return { "y": 0 }; }, | ||||
"IsInWorld": function() { return true; }, | "IsInWorld": function() { return true; }, | ||||
"MoveOutOfWorld": () => {} | "MoveOutOfWorld": () => {} | ||||
}); | }); | ||||
▲ Show 20 Lines • Show All 159 Lines • ▼ Show 20 Lines | function TestMoveIntoFormationWhileAttacking() | ||||
let controllerAI = ConstructComponent(controller, "UnitAI", { | let controllerAI = ConstructComponent(controller, "UnitAI", { | ||||
"FormationController": "true", | "FormationController": "true", | ||||
"DefaultStance": "aggressive" | "DefaultStance": "aggressive" | ||||
}); | }); | ||||
AddMock(controller, IID_Position, { | AddMock(controller, IID_Position, { | ||||
"GetTurretParent": () => INVALID_ENTITY, | "GetTurretParent": () => INVALID_ENTITY, | ||||
"JumpTo": function(x, z) { this.x = x; this.z = z; }, | "JumpTo": function(x, z) { this.x = x; this.z = z; }, | ||||
"TurnTo": function() {}, | |||||
"GetPosition": function(){ return new Vector3D(this.x, 0, this.z); }, | "GetPosition": function(){ return new Vector3D(this.x, 0, this.z); }, | ||||
"GetPosition2D": function(){ return new Vector2D(this.x, this.z); }, | "GetPosition2D": function(){ return new Vector2D(this.x, this.z); }, | ||||
"GetRotation": () => ({ "y": 0 }), | "GetRotation": () => ({ "y": 0 }), | ||||
"IsInWorld": () => true, | "IsInWorld": () => true, | ||||
"MoveOutOfWorld": () => {}, | "MoveOutOfWorld": () => {}, | ||||
}); | }); | ||||
AddMock(controller, IID_UnitMotion, { | AddMock(controller, IID_UnitMotion, { | ||||
▲ Show 20 Lines • Show All 115 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
This is enough, I guess.
(A anonymous function returning nothing.)