From ad2c3ed83fcc01d8d3f9fa5745ef38472e09abef Mon Sep 17 00:00:00 2001 From: Sven Van de Velde Date: Fri, 6 May 2016 16:41:59 +0200 Subject: [PATCH] commit --- Moose/Group.lua | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/Moose/Group.lua b/Moose/Group.lua index 4e845ada7..2e2676743 100644 --- a/Moose/Group.lua +++ b/Moose/Group.lua @@ -594,6 +594,41 @@ function GROUP:TaskWrappedAction( DCSCommand, Index ) return DCSTaskWrappedAction end +--- Executes a command action +-- @param #GROUP self +-- @param DCSCommand#Command DCSCommand +-- @return #GROUP self +function GROUP:SetCommand( DCSCommand ) + self:F( DCSCommand ) + + local Controller = self:_GetController() + + Controller:setCommand( DCSCommand ) + + return self +end + +--- Perform a switch waypoint command +-- @param #GROUP self +-- @param #number FromWayPoint +-- @param #number ToWayPoint +-- @return DCSTask#Task +function GROUP:CommandSwitchWayPoint( FromWayPoint, ToWayPoint, Index ) + self:F( { FromWayPoint, ToWayPoint, Index } ) + + local CommandSwitchWayPoint = { + id = 'SwitchWaypoint', + params = { + fromWaypointIndex = FromWayPoint, + goToWaypointIndex = ToWayPoint, + }, + } + + self:T( { CommandSwitchWayPoint } ) + return CommandSwitchWayPoint +end + + --- Orbit at a specified position at a specified alititude during a specified duration with a specified speed. -- @param #GROUP self -- @param #Vec2 Point The point to hold the position.