#PLAYERTASK

* Added a couple of QOL functions for internal INTEL object
This commit is contained in:
Applevangelist 2022-11-14 17:37:49 +01:00
parent f0bbc5a777
commit 6365298e4b
2 changed files with 61 additions and 15 deletions

View File

@ -590,7 +590,7 @@ _ATIS = {}
--- ATIS class version. --- ATIS class version.
-- @field #string version -- @field #string version
ATIS.version = "0.9.10" ATIS.version = "0.9.11"
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- TODO list -- TODO list
@ -1319,8 +1319,10 @@ function ATIS:onafterStatus( From, Event, To )
text = text .. string.format( ", Relay unit=%s (alive=%s)", tostring( self.relayunitname ), relayunitstatus ) text = text .. string.format( ", Relay unit=%s (alive=%s)", tostring( self.relayunitname ), relayunitstatus )
end end
self:T( self.lid .. text ) self:T( self.lid .. text )
self:__Status( -60 ) if not self:Is("Stopped") then
self:__Status( -60 )
end
end end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@ -1348,9 +1350,11 @@ function ATIS:onafterCheckQueue( From, Event, To )
end end
end end
-- Check back in 5 seconds. if not self:Is("Stopped") then
self:__CheckQueue( -math.abs( self.dTQueueCheck ) ) -- Check back in 5 seconds.
self:__CheckQueue( -math.abs( self.dTQueueCheck ) )
end
end end
--- Broadcast ATIS radio message. --- Broadcast ATIS radio message.

View File

@ -1,4 +1,4 @@
---- **Ops** - PlayerTask (mission) for Players. --- **Ops** - PlayerTask (mission) for Players.
-- --
-- ## Main Features: -- ## Main Features:
-- --
@ -1402,7 +1402,7 @@ PLAYERTASKCONTROLLER.Messages = {
--- PLAYERTASK class version. --- PLAYERTASK class version.
-- @field #string version -- @field #string version
PLAYERTASKCONTROLLER.version="0.1.46" PLAYERTASKCONTROLLER.version="0.1.47"
--- Create and run a new TASKCONTROLLER instance. --- Create and run a new TASKCONTROLLER instance.
-- @param #PLAYERTASKCONTROLLER self -- @param #PLAYERTASKCONTROLLER self
@ -2573,7 +2573,7 @@ function PLAYERTASKCONTROLLER:_AddTask(Target)
task:_SetController(self) task:_SetController(self)
self.TaskQueue:Push(task) self.TaskQueue:Push(task)
self:__TaskAdded(-1,task) self:__TaskAdded(10,task)
return self return self
end end
@ -2607,7 +2607,7 @@ function PLAYERTASKCONTROLLER:AddPlayerTaskToQueue(PlayerTask)
PlayerTask:_SetController(self) PlayerTask:_SetController(self)
PlayerTask:SetCoalition(self.Coalition) PlayerTask:SetCoalition(self.Coalition)
self.TaskQueue:Push(PlayerTask) self.TaskQueue:Push(PlayerTask)
self:__TaskAdded(-1,PlayerTask) self:__TaskAdded(10,PlayerTask)
else else
self:E(self.lid.."***** NO valid PAYERTASK object sent!") self:E(self.lid.."***** NO valid PAYERTASK object sent!")
end end
@ -3255,7 +3255,21 @@ function PLAYERTASKCONTROLLER:AddAgent(Recce)
if self.Intel then if self.Intel then
self.Intel:AddAgent(Recce) self.Intel:AddAgent(Recce)
else else
self:E(self.lid.."NO detection has been set up (yet)!") self:E(self.lid.."*****NO detection has been set up (yet)!")
end
return self
end
--- [User] Set up detection of STATIC objects. You need to set up detection with @{#PLAYERTASKCONTROLLER.SetupIntel}() **before** using this.
-- @param #PLAYERTASKCONTROLLER self
-- @param #boolean OnOff Set to `true`for on and `false`for off.
-- @return #PLAYERTASKCONTROLLER self
function PLAYERTASKCONTROLLER:SwitchDetectStatics(OnOff)
self:T(self.lid.."SwitchDetectStatics")
if self.Intel then
self.Intel:SetDetectStatics(OnOff)
else
self:E(self.lid.."***** NO detection has been set up (yet)!")
end end
return self return self
end end
@ -3269,7 +3283,21 @@ function PLAYERTASKCONTROLLER:AddAcceptZone(AcceptZone)
if self.Intel then if self.Intel then
self.Intel:AddAcceptZone(AcceptZone) self.Intel:AddAcceptZone(AcceptZone)
else else
self:E(self.lid.."NO detection has been set up (yet)!") self:E(self.lid.."*****NO detection has been set up (yet)!")
end
return self
end
--- [User] Add accept SET_ZONE to INTEL detection. You need to set up detection with @{#PLAYERTASKCONTROLLER.SetupIntel}() **before** using this.
-- @param #PLAYERTASKCONTROLLER self
-- @param Core.Set#SET_ZONE AcceptZoneSet Add a SET_ZONE to the accept zone set.
-- @return #PLAYERTASKCONTROLLER self
function PLAYERTASKCONTROLLER:AddAcceptZoneSet(AcceptZoneSet)
self:T(self.lid.."AddAcceptZoneSet")
if self.Intel then
self.Intel.acceptzoneset:AddSet(AcceptZoneSet)
else
self:E(self.lid.."*****NO detection has been set up (yet)!")
end end
return self return self
end end
@ -3283,7 +3311,21 @@ function PLAYERTASKCONTROLLER:AddRejectZone(RejectZone)
if self.Intel then if self.Intel then
self.Intel:AddRejectZone(RejectZone) self.Intel:AddRejectZone(RejectZone)
else else
self:E(self.lid.."NO detection has been set up (yet)!") self:E(self.lid.."*****NO detection has been set up (yet)!")
end
return self
end
--- [User] Add reject SET_ZONE to INTEL detection. You need to set up detection with @{#PLAYERTASKCONTROLLER.SetupIntel}() **before** using this.
-- @param #PLAYERTASKCONTROLLER self
-- @param Core.Set#SET_ZONE RejectZoneSet Add a zone to the reject zone set.
-- @return #PLAYERTASKCONTROLLER self
function PLAYERTASKCONTROLLER:AddRejectZone(RejectZoneSet)
self:T(self.lid.."AddRejectZoneSet")
if self.Intel then
self.Intel.rejectzoneset:AddSet(RejectZoneSet)
else
self:E(self.lid.."*****NO detection has been set up (yet)!")
end end
return self return self
end end
@ -3297,7 +3339,7 @@ function PLAYERTASKCONTROLLER:RemoveAcceptZone(AcceptZone)
if self.Intel then if self.Intel then
self.Intel:RemoveAcceptZone(AcceptZone) self.Intel:RemoveAcceptZone(AcceptZone)
else else
self:E(self.lid.."NO detection has been set up (yet)!") self:E(self.lid.."*****NO detection has been set up (yet)!")
end end
return self return self
end end
@ -3311,7 +3353,7 @@ function PLAYERTASKCONTROLLER:RemoveRejectZone(RejectZone)
if self.Intel then if self.Intel then
self.Intel:RemoveRejectZone(RejectZone) self.Intel:RemoveRejectZone(RejectZone)
else else
self:E(self.lid.."NO detection has been set up (yet)!") self:E(self.lid.."*****NO detection has been set up (yet)!")
end end
return self return self
end end