mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Lots of fixes for cargo + optimization of Stage Messages
This commit is contained in:
@@ -24,6 +24,74 @@ trace.f( self.ClassName, _Group:getName() )
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
function GROUP:GetName()
|
||||
self:T( self.GroupName )
|
||||
|
||||
return self.GroupName
|
||||
end
|
||||
|
||||
function GROUP:Destroy()
|
||||
self:T( self.GroupName )
|
||||
|
||||
for Index, UnitData in pairs( self._Group:getUnits() ) do
|
||||
self:CreateEventCrash( timer.getTime(), UnitData )
|
||||
end
|
||||
|
||||
self._Group:destroy()
|
||||
end
|
||||
|
||||
function GROUP:IsAir()
|
||||
self:T()
|
||||
|
||||
local IsAirResult = self._Group:getCategory() == Group.Category.AIRPLANE or self._Group:getCategory() == Group.Category.HELICOPTER
|
||||
|
||||
self:T( IsAirResult )
|
||||
return IsAirResult
|
||||
end
|
||||
|
||||
function GROUP:AllOnGround()
|
||||
self:T()
|
||||
|
||||
local AllOnGroundResult = true
|
||||
|
||||
for Index, UnitData in pairs( self._Group:getUnits() ) do
|
||||
if UnitData:inAir() then
|
||||
AllOnGroundResult = false
|
||||
end
|
||||
end
|
||||
|
||||
self:T( AllOnGroundResult )
|
||||
return AllOnGroundResult
|
||||
end
|
||||
|
||||
|
||||
function GROUP:GetMaxVelocity()
|
||||
self:T()
|
||||
|
||||
local MaxVelocity = 0
|
||||
|
||||
for Index, UnitData in pairs( self._Group:getUnits() ) do
|
||||
|
||||
local Velocity = UnitData:getVelocity()
|
||||
local VelocityTotal = math.abs( Velocity.x ) + math.abs( Velocity.y ) + math.abs( Velocity.z )
|
||||
|
||||
if VelocityTotal < MaxVelocity then
|
||||
MaxVelocity = VelocityTotal
|
||||
end
|
||||
end
|
||||
|
||||
return MaxVelocity
|
||||
end
|
||||
|
||||
|
||||
function GROUP:GetHeight()
|
||||
self:T()
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
function GROUP:Land( Point, Duration )
|
||||
trace.f( self.ClassName, { self.GroupName, Point, Duration } )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user