mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
AI Dispatchers - add ability to add/remove resources to/from a squad
This commit is contained in:
parent
8ac06979f0
commit
2aeebf280b
@ -3877,6 +3877,30 @@ do
|
|||||||
self:CAP( SquadronName )
|
self:CAP( SquadronName )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Add resources to a Squadron
|
||||||
|
-- @param #AI_A2A_DISPATCHER self
|
||||||
|
-- @param #string Squadron The squadron name.
|
||||||
|
-- @param #number Amount Number of resources to add.
|
||||||
|
function AI_A2A_DISPATCHER:AddToSquadron(Squadron,Amount)
|
||||||
|
local Squadron = self:GetSquadron(Squadron)
|
||||||
|
if Squadron.ResourceCount then
|
||||||
|
Squadron.ResourceCount = Squadron.ResourceCount + Amount
|
||||||
|
end
|
||||||
|
self:T({Squadron = Squadron.Name,SquadronResourceCount = Squadron.ResourceCount})
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Remove resources from a Squadron
|
||||||
|
-- @param #AI_A2A_DISPATCHER self
|
||||||
|
-- @param #string Squadron The squadron name.
|
||||||
|
-- @param #number Amount Number of resources to remove.
|
||||||
|
function AI_A2A_DISPATCHER:RemoveFromSquadron(Squadron,Amount)
|
||||||
|
local Squadron = self:GetSquadron(Squadron)
|
||||||
|
if Squadron.ResourceCount then
|
||||||
|
Squadron.ResourceCount = Squadron.ResourceCount - Amount
|
||||||
|
end
|
||||||
|
self:T({Squadron = Squadron.Name,SquadronResourceCount = Squadron.ResourceCount})
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
|
|||||||
@ -4729,5 +4729,29 @@ do
|
|||||||
self:Patrol( SquadronName, PatrolTaskType )
|
self:Patrol( SquadronName, PatrolTaskType )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Add resources to a Squadron
|
||||||
|
-- @param #AI_A2G_DISPATCHER self
|
||||||
|
-- @param #string Squadron The squadron name.
|
||||||
|
-- @param #number Amount Number of resources to add.
|
||||||
|
function AI_A2G_DISPATCHER:AddToSquadron(Squadron,Amount)
|
||||||
|
local Squadron = self:GetSquadron(Squadron)
|
||||||
|
if Squadron.ResourceCount then
|
||||||
|
Squadron.ResourceCount = Squadron.ResourceCount + Amount
|
||||||
|
end
|
||||||
|
self:T({Squadron = Squadron.Name,SquadronResourceCount = Squadron.ResourceCount})
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Remove resources from a Squadron
|
||||||
|
-- @param #AI_A2G_DISPATCHER self
|
||||||
|
-- @param #string Squadron The squadron name.
|
||||||
|
-- @param #number Amount Number of resources to remove.
|
||||||
|
function AI_A2G_DISPATCHER:RemoveFromSquadron(Squadron,Amount)
|
||||||
|
local Squadron = self:GetSquadron(Squadron)
|
||||||
|
if Squadron.ResourceCount then
|
||||||
|
Squadron.ResourceCount = Squadron.ResourceCount - Amount
|
||||||
|
end
|
||||||
|
self:T({Squadron = Squadron.Name,SquadronResourceCount = Squadron.ResourceCount})
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user