mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge remote-tracking branch 'refs/remotes/origin/master' into 386-ai-designate
This commit is contained in:
commit
cfeec372d7
@ -981,6 +981,185 @@ function SET_GROUP:ForEachGroupNotInZone( ZoneObject, IteratorFunction, ... )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Iterate the SET_GROUP and return true if all the @{Wrapper.Group#GROUP} are completely in the @{Core.Zone#ZONE}
|
||||
-- @param #SET_GROUP self
|
||||
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
|
||||
-- @return #boolean true if all the @{Wrapper.Group#GROUP} are completly in the @{Core.Zone#ZONE}, false otherwise
|
||||
-- @usage
|
||||
-- local MyZone = ZONE:New("Zone1")
|
||||
-- local MySetGroup = SET_GROUP:New()
|
||||
-- MySetGroup:AddGroupsByName({"Group1", "Group2"})
|
||||
--
|
||||
-- if MySetGroup:AllCompletelyInZone(MyZone) then
|
||||
-- MESSAGE:New("All the SET's GROUP are in zone !", 10):ToAll()
|
||||
-- else
|
||||
-- MESSAGE:New("Some or all SET's GROUP are outside zone !", 10):ToAll()
|
||||
-- end
|
||||
function SET_GROUP:AllCompletelyInZone(Zone)
|
||||
self:F2(Zone)
|
||||
local Set = self:GetSet()
|
||||
for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
|
||||
if not GroupData:IsCompletelyInZone(Zone) then
|
||||
return false
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
--- Iterate the SET_GROUP and return true if at least one of the @{Wrapper.Group#GROUP} is completely inside the @{Core.Zone#ZONE}
|
||||
-- @param #SET_GROUP self
|
||||
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
|
||||
-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is completly inside the @{Core.Zone#ZONE}, false otherwise.
|
||||
-- @usage
|
||||
-- local MyZone = ZONE:New("Zone1")
|
||||
-- local MySetGroup = SET_GROUP:New()
|
||||
-- MySetGroup:AddGroupsByName({"Group1", "Group2"})
|
||||
--
|
||||
-- if MySetGroup:AnyCompletelyInZone(MyZone) then
|
||||
-- MESSAGE:New("At least one GROUP is completely in zone !", 10):ToAll()
|
||||
-- else
|
||||
-- MESSAGE:New("No GROUP is completely in zone !", 10):ToAll()
|
||||
-- end
|
||||
function SET_GROUP:AnyCompletelyInZone(Zone)
|
||||
self:F2(Zone)
|
||||
local Set = self:GetSet()
|
||||
for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
|
||||
if GroupData:IsCompletelyInZone(Zone) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
--- Iterate the SET_GROUP and return true if at least one @{#UNIT} of one @{GROUP} of the @{SET_GROUP} is in @{ZONE}
|
||||
-- @param #SET_GROUP self
|
||||
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
|
||||
-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is partly or completly inside the @{Core.Zone#ZONE}, false otherwise.
|
||||
-- @usage
|
||||
-- local MyZone = ZONE:New("Zone1")
|
||||
-- local MySetGroup = SET_GROUP:New()
|
||||
-- MySetGroup:AddGroupsByName({"Group1", "Group2"})
|
||||
--
|
||||
-- if MySetGroup:AnyPartlyInZone(MyZone) then
|
||||
-- MESSAGE:New("At least one GROUP has at least one UNIT in zone !", 10):ToAll()
|
||||
-- else
|
||||
-- MESSAGE:New("No UNIT of any GROUP is in zone !", 10):ToAll()
|
||||
-- end
|
||||
function SET_GROUP:AnyInZone(Zone)
|
||||
self:F2(Zone)
|
||||
local Set = self:GetSet()
|
||||
for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
|
||||
if GroupData:IsPartlyInZone(Zone) or GroupData:IsCompletelyInZone(Zone) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
--- Iterate the SET_GROUP and return true if at least one @{GROUP} of the @{SET_GROUP} is partly in @{ZONE}.
|
||||
-- Will return false if a @{GROUP} is fully in the @{ZONE}
|
||||
-- @param #SET_GROUP self
|
||||
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
|
||||
-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is partly or completly inside the @{Core.Zone#ZONE}, false otherwise.
|
||||
-- @usage
|
||||
-- local MyZone = ZONE:New("Zone1")
|
||||
-- local MySetGroup = SET_GROUP:New()
|
||||
-- MySetGroup:AddGroupsByName({"Group1", "Group2"})
|
||||
--
|
||||
-- if MySetGroup:AnyPartlyInZone(MyZone) then
|
||||
-- MESSAGE:New("At least one GROUP is partially in the zone, but none are fully in it !", 10):ToAll()
|
||||
-- else
|
||||
-- MESSAGE:New("No GROUP are in zone, or one (or more) GROUP is completely in it !", 10):ToAll()
|
||||
-- end
|
||||
function SET_GROUP:AnyPartlyInZone(Zone)
|
||||
self:F2(Zone)
|
||||
local IsPartlyInZone = false
|
||||
local Set = self:GetSet()
|
||||
for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
|
||||
if GroupData:IsCompletelyInZone(Zone) then
|
||||
return false
|
||||
elseif GroupData:IsPartlyInZone(Zone) then
|
||||
IsPartlyInZone = true -- at least one GROUP is partly in zone
|
||||
end
|
||||
end
|
||||
|
||||
if IsPartlyInZone then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
--- Iterate the SET_GROUP and return true if no @{GROUP} of the @{SET_GROUP} is in @{ZONE}
|
||||
-- This could also be achieved with `not SET_GROUP:AnyPartlyInZone(Zone)`, but it's easier for the
|
||||
-- mission designer to add a dedicated method
|
||||
-- @param #SET_GROUP self
|
||||
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
|
||||
-- @return #boolean true if no @{Wrapper.Group#GROUP} is inside the @{Core.Zone#ZONE} in any way, false otherwise.
|
||||
-- @usage
|
||||
-- local MyZone = ZONE:New("Zone1")
|
||||
-- local MySetGroup = SET_GROUP:New()
|
||||
-- MySetGroup:AddGroupsByName({"Group1", "Group2"})
|
||||
--
|
||||
-- if MySetGroup:NoneInZone(MyZone) then
|
||||
-- MESSAGE:New("No GROUP is completely in zone !", 10):ToAll()
|
||||
-- else
|
||||
-- MESSAGE:New("No UNIT of any GROUP is in zone !", 10):ToAll()
|
||||
-- end
|
||||
function SET_GROUP:NoneInZone(Zone)
|
||||
self:F2(Zone)
|
||||
local Set = self:GetSet()
|
||||
for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
|
||||
if not GroupData:IsNotInZone(Zone) then -- If the GROUP is in Zone in any way
|
||||
return false
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
--- Iterate the SET_GROUP and count how many GROUPs are completely in the Zone
|
||||
-- That could easily be done with SET_GROUP:ForEachGroupCompletelyInZone(), but this function
|
||||
-- provides an easy to use shortcut...
|
||||
-- @param #SET_GROUP self
|
||||
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
|
||||
-- @return #number the number of GROUPs completely in the Zone
|
||||
-- @usage
|
||||
-- local MyZone = ZONE:New("Zone1")
|
||||
-- local MySetGroup = SET_GROUP:New()
|
||||
-- MySetGroup:AddGroupsByName({"Group1", "Group2"})
|
||||
--
|
||||
-- MESSAGE:New("There are " .. MySetGroup:CountInZone(MyZone) .. " GROUPs in the Zone !", 10):ToAll()
|
||||
function SET_GROUP:CountInZone(Zone)
|
||||
self:F2(Zone)
|
||||
local Count = 0
|
||||
local Set = self:GetSet()
|
||||
for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
|
||||
if GroupData:IsCompletelyInZone(Zone) then
|
||||
Count = Count + 1
|
||||
end
|
||||
end
|
||||
return Count
|
||||
end
|
||||
|
||||
--- Iterate the SET_GROUP and count how many UNITs are completely in the Zone
|
||||
-- @param #SET_GROUP self
|
||||
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
|
||||
-- @return #number the number of GROUPs completely in the Zone
|
||||
-- @usage
|
||||
-- local MyZone = ZONE:New("Zone1")
|
||||
-- local MySetGroup = SET_GROUP:New()
|
||||
-- MySetGroup:AddGroupsByName({"Group1", "Group2"})
|
||||
--
|
||||
-- MESSAGE:New("There are " .. MySetGroup:CountUnitInZone(MyZone) .. " UNITs in the Zone !", 10):ToAll()
|
||||
function SET_GROUP:CountUnitInZone(Zone)
|
||||
self:F2(Zone)
|
||||
local Count = 0
|
||||
local Set = self:GetSet()
|
||||
for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
|
||||
Count = Count + GroupData:CountInZone(Zone)
|
||||
end
|
||||
return Count
|
||||
end
|
||||
|
||||
----- Iterate the SET_GROUP and call an interator function for each **alive** player, providing the Group of the player and optional parameters.
|
||||
---- @param #SET_GROUP self
|
||||
|
||||
@ -555,22 +555,23 @@ end
|
||||
function GROUP:IsPartlyInZone( Zone )
|
||||
self:F2( { self.GroupName, Zone } )
|
||||
|
||||
local PartlyInZone = false
|
||||
local IsOneUnitInZone = false
|
||||
local IsOneUnitOutsideZone = false
|
||||
|
||||
for UnitID, UnitData in pairs( self:GetUnits() ) do
|
||||
local Unit = UnitData -- Wrapper.Unit#UNIT
|
||||
if Zone:IsVec3InZone( Unit:GetVec3() ) then
|
||||
PartlyInZone = true
|
||||
IsOneUnitInZone = true
|
||||
else
|
||||
-- So, if there were groups in the zone found, and suddenly one NOT in the zone,
|
||||
-- then the group is partialy in the zone :-)
|
||||
if PartlyInZone == true then
|
||||
return true
|
||||
end
|
||||
IsOneUnitOutsideZone = true
|
||||
end
|
||||
end
|
||||
|
||||
if IsOneUnitInZone and IsOneUnitOutsideZone then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
--- Returns true if none of the group units of the group are within a @{Zone}.
|
||||
@ -590,6 +591,24 @@ function GROUP:IsNotInZone( Zone )
|
||||
return true
|
||||
end
|
||||
|
||||
--- Returns the number of UNITs that are in the @{Zone}
|
||||
-- @param #GROUP self
|
||||
-- @param Core.Zone#ZONE_BASE Zone The zone to test.
|
||||
-- @return #number The number of UNITs that are in the @{Zone}
|
||||
function GROUP:CountInZone( Zone )
|
||||
self:F2( {self.GroupName, Zone} )
|
||||
local Count = 0
|
||||
|
||||
for UnitID, UnitData in pairs( self:GetUnits() ) do
|
||||
local Unit = UnitData -- Wrapper.Unit#UNIT
|
||||
if Zone:IsVec3InZone( Unit:GetVec3() ) then
|
||||
Count = Count + 1
|
||||
end
|
||||
end
|
||||
|
||||
return Count
|
||||
end
|
||||
|
||||
--- Returns if the group is of an air category.
|
||||
-- If the group is a helicopter or a plane, then this method will return true, otherwise false.
|
||||
-- @param #GROUP self
|
||||
|
||||
@ -2847,7 +2847,6 @@ The range till cargo will board.</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<a id="#(CARGO_UNIT).CargoCarrier" >
|
||||
<strong>CARGO_UNIT.CargoCarrier</strong>
|
||||
</a>
|
||||
|
||||
@ -190,6 +190,12 @@
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).CopyRoute">GROUP:CopyRoute(Begin, End, Randomize, Radius)</a></td>
|
||||
<td class="summary">
|
||||
<p>Return the route of a group by using the <a href="Database.html##(DATABASE)">Database#DATABASE</a> class.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).CountInZone">GROUP:CountInZone(Zone)</a></td>
|
||||
<td class="summary">
|
||||
<p>Returns the number of UNITs that are in the <a href="Zone.html">Zone</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -680,6 +686,33 @@ When randomization is on, the randomization is within the radius.</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(GROUP).CountInZone" >
|
||||
<strong>GROUP:CountInZone(Zone)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Returns the number of UNITs that are in the <a href="Zone.html">Zone</a></p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Core.Zone.html##(ZONE_BASE)">Core.Zone#ZONE_BASE</a> Zone </em></code>:
|
||||
The zone to test.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em>#number:</em>
|
||||
The number of UNITs that are in the <a href="Zone.html">Zone</a></p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(GROUP).Destroy" >
|
||||
<strong>GROUP:Destroy()</strong>
|
||||
</a>
|
||||
|
||||
@ -1200,6 +1200,7 @@ self</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em><a href="Core.Spot.html##(SPOT)">Core.Spot#SPOT</a></em>
|
||||
<a id="#(POSITIONABLE).Spot" >
|
||||
<strong>POSITIONABLE.Spot</strong>
|
||||
</a>
|
||||
|
||||
@ -727,6 +727,44 @@
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_GROUP).AddInDatabase">SET_GROUP:AddInDatabase(Event)</a></td>
|
||||
<td class="summary">
|
||||
<p>Handles the Database to check on an event (birth) that the Object was added in the Database.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_GROUP).AllCompletelyInZone">SET_GROUP:AllCompletelyInZone(ZoneObject, Zone)</a></td>
|
||||
<td class="summary">
|
||||
<p>Iterate the SET_GROUP and return true if all the <a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a> are completely in the <a href="Core.Zone.html##(ZONE)">Core.Zone#ZONE</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_GROUP).AnyCompletelyInZone">SET_GROUP:AnyCompletelyInZone(ZoneObject, Zone)</a></td>
|
||||
<td class="summary">
|
||||
<p>Iterate the SET_GROUP and return true if at least one of the <a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a> is completely inside the <a href="Core.Zone.html##(ZONE)">Core.Zone#ZONE</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_GROUP).AnyInZone">SET_GROUP:AnyInZone(ZoneObject, Zone)</a></td>
|
||||
<td class="summary">
|
||||
<p>Iterate the SET_GROUP and return true if at least one <a href="##(UNIT)">#UNIT</a> of one <a href="GROUP.html">GROUP</a> of the <a href="SET_GROUP.html">SET_GROUP</a> is in <a href="ZONE.html">ZONE</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_GROUP).AnyPartlyInZone">SET_GROUP:AnyPartlyInZone(ZoneObject, Zone)</a></td>
|
||||
<td class="summary">
|
||||
<p>Iterate the SET_GROUP and return true if at least one <a href="GROUP.html">GROUP</a> of the <a href="SET_GROUP.html">SET_GROUP</a> is partly in <a href="ZONE.html">ZONE</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_GROUP).CountInZone">SET_GROUP:CountInZone(ZoneObject, Zone)</a></td>
|
||||
<td class="summary">
|
||||
<p>Iterate the SET<em>GROUP and count how many GROUPs are completely in the Zone
|
||||
That could easily be done with SET</em>GROUP:ForEachGroupCompletelyInZone(), but this function
|
||||
provides an easy to use shortcut...</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_GROUP).CountUnitInZone">SET_GROUP:CountUnitInZone(ZoneObject, Zone)</a></td>
|
||||
<td class="summary">
|
||||
<p>Iterate the SET_GROUP and count how many UNITs are completely in the Zone</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -811,6 +849,14 @@
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_GROUP).New">SET_GROUP:New()</a></td>
|
||||
<td class="summary">
|
||||
<p>Creates a new SET_GROUP object, building a set of groups belonging to a coalitions, categories, countries, types or with defined prefix names.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_GROUP).NoneInZone">SET_GROUP:NoneInZone(ZoneObject, Zone)</a></td>
|
||||
<td class="summary">
|
||||
<p>Iterate the SET_GROUP and return true if no <a href="GROUP.html">GROUP</a> of the <a href="SET_GROUP.html">SET_GROUP</a> is in <a href="ZONE.html">ZONE</a>
|
||||
This could also be achieved with <code>not SET_GROUP:AnyPartlyInZone(Zone)</code>, but it's easier for the
|
||||
mission designer to add a dedicated method</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -3460,6 +3506,261 @@ The GROUP</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(SET_GROUP).AllCompletelyInZone" >
|
||||
<strong>SET_GROUP:AllCompletelyInZone(ZoneObject, Zone)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Iterate the SET_GROUP and return true if all the <a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a> are completely in the <a href="Core.Zone.html##(ZONE)">Core.Zone#ZONE</a></p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Core.Zone.html##(ZONE)">Core.Zone#ZONE</a> ZoneObject </em></code>:
|
||||
The Zone to be tested for.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em> Zone </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em>#boolean:</em>
|
||||
true if all the <a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a> are completly in the <a href="Core.Zone.html##(ZONE)">Core.Zone#ZONE</a>, false otherwise</p>
|
||||
|
||||
<h3>Usage:</h3>
|
||||
<pre class="example"><code>local MyZone = ZONE:New("Zone1")
|
||||
local MySetGroup = SET_GROUP:New()
|
||||
MySetGroup:AddGroupsByName({"Group1", "Group2"})
|
||||
|
||||
if MySetGroup:AllCompletelyInZone(MyZone) then
|
||||
MESSAGE:New("All the SET's GROUP are in zone !", 10):ToAll()
|
||||
else
|
||||
MESSAGE:New("Some or all SET's GROUP are outside zone !", 10):ToAll()
|
||||
end</code></pre>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(SET_GROUP).AnyCompletelyInZone" >
|
||||
<strong>SET_GROUP:AnyCompletelyInZone(ZoneObject, Zone)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Iterate the SET_GROUP and return true if at least one of the <a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a> is completely inside the <a href="Core.Zone.html##(ZONE)">Core.Zone#ZONE</a></p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Core.Zone.html##(ZONE)">Core.Zone#ZONE</a> ZoneObject </em></code>:
|
||||
The Zone to be tested for.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em> Zone </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em>#boolean:</em>
|
||||
true if at least one of the <a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a> is completly inside the <a href="Core.Zone.html##(ZONE)">Core.Zone#ZONE</a>, false otherwise.</p>
|
||||
|
||||
<h3>Usage:</h3>
|
||||
<pre class="example"><code>local MyZone = ZONE:New("Zone1")
|
||||
local MySetGroup = SET_GROUP:New()
|
||||
MySetGroup:AddGroupsByName({"Group1", "Group2"})
|
||||
|
||||
if MySetGroup:AnyCompletelyInZone(MyZone) then
|
||||
MESSAGE:New("At least one GROUP is completely in zone !", 10):ToAll()
|
||||
else
|
||||
MESSAGE:New("No GROUP is completely in zone !", 10):ToAll()
|
||||
end</code></pre>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(SET_GROUP).AnyInZone" >
|
||||
<strong>SET_GROUP:AnyInZone(ZoneObject, Zone)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Iterate the SET_GROUP and return true if at least one <a href="##(UNIT)">#UNIT</a> of one <a href="GROUP.html">GROUP</a> of the <a href="SET_GROUP.html">SET_GROUP</a> is in <a href="ZONE.html">ZONE</a></p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Core.Zone.html##(ZONE)">Core.Zone#ZONE</a> ZoneObject </em></code>:
|
||||
The Zone to be tested for.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em> Zone </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em>#boolean:</em>
|
||||
true if at least one of the <a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a> is partly or completly inside the <a href="Core.Zone.html##(ZONE)">Core.Zone#ZONE</a>, false otherwise.</p>
|
||||
|
||||
<h3>Usage:</h3>
|
||||
<pre class="example"><code>local MyZone = ZONE:New("Zone1")
|
||||
local MySetGroup = SET_GROUP:New()
|
||||
MySetGroup:AddGroupsByName({"Group1", "Group2"})
|
||||
|
||||
if MySetGroup:AnyPartlyInZone(MyZone) then
|
||||
MESSAGE:New("At least one GROUP has at least one UNIT in zone !", 10):ToAll()
|
||||
else
|
||||
MESSAGE:New("No UNIT of any GROUP is in zone !", 10):ToAll()
|
||||
end</code></pre>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(SET_GROUP).AnyPartlyInZone" >
|
||||
<strong>SET_GROUP:AnyPartlyInZone(ZoneObject, Zone)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Iterate the SET_GROUP and return true if at least one <a href="GROUP.html">GROUP</a> of the <a href="SET_GROUP.html">SET_GROUP</a> is partly in <a href="ZONE.html">ZONE</a>.</p>
|
||||
|
||||
|
||||
<p>Will return false if a <a href="GROUP.html">GROUP</a> is fully in the <a href="ZONE.html">ZONE</a></p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Core.Zone.html##(ZONE)">Core.Zone#ZONE</a> ZoneObject </em></code>:
|
||||
The Zone to be tested for.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em> Zone </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em>#boolean:</em>
|
||||
true if at least one of the <a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a> is partly or completly inside the <a href="Core.Zone.html##(ZONE)">Core.Zone#ZONE</a>, false otherwise.</p>
|
||||
|
||||
<h3>Usage:</h3>
|
||||
<pre class="example"><code>local MyZone = ZONE:New("Zone1")
|
||||
local MySetGroup = SET_GROUP:New()
|
||||
MySetGroup:AddGroupsByName({"Group1", "Group2"})
|
||||
|
||||
if MySetGroup:AnyPartlyInZone(MyZone) then
|
||||
MESSAGE:New("At least one GROUP is partially in the zone, but none are fully in it !", 10):ToAll()
|
||||
else
|
||||
MESSAGE:New("No GROUP are in zone, or one (or more) GROUP is completely in it !", 10):ToAll()
|
||||
end</code></pre>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(SET_GROUP).CountInZone" >
|
||||
<strong>SET_GROUP:CountInZone(ZoneObject, Zone)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Iterate the SET<em>GROUP and count how many GROUPs are completely in the Zone
|
||||
That could easily be done with SET</em>GROUP:ForEachGroupCompletelyInZone(), but this function
|
||||
provides an easy to use shortcut...</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Core.Zone.html##(ZONE)">Core.Zone#ZONE</a> ZoneObject </em></code>:
|
||||
The Zone to be tested for.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em> Zone </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em>#number:</em>
|
||||
the number of GROUPs completely in the Zone</p>
|
||||
|
||||
<h3>Usage:</h3>
|
||||
<pre class="example"><code>local MyZone = ZONE:New("Zone1")
|
||||
local MySetGroup = SET_GROUP:New()
|
||||
MySetGroup:AddGroupsByName({"Group1", "Group2"})
|
||||
|
||||
MESSAGE:New("There are " .. MySetGroup:CountInZone(MyZone) .. " GROUPs in the Zone !", 10):ToAll()</code></pre>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(SET_GROUP).CountUnitInZone" >
|
||||
<strong>SET_GROUP:CountUnitInZone(ZoneObject, Zone)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Iterate the SET_GROUP and count how many UNITs are completely in the Zone</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Core.Zone.html##(ZONE)">Core.Zone#ZONE</a> ZoneObject </em></code>:
|
||||
The Zone to be tested for.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em> Zone </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em>#number:</em>
|
||||
the number of GROUPs completely in the Zone</p>
|
||||
|
||||
<h3>Usage:</h3>
|
||||
<pre class="example"><code>local MyZone = ZONE:New("Zone1")
|
||||
local MySetGroup = SET_GROUP:New()
|
||||
MySetGroup:AddGroupsByName({"Group1", "Group2"})
|
||||
|
||||
MESSAGE:New("There are " .. MySetGroup:CountUnitInZone(MyZone) .. " UNITs in the Zone !", 10):ToAll()</code></pre>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(SET_GROUP).FilterCategories" >
|
||||
<strong>SET_GROUP:FilterCategories(Categories)</strong>
|
||||
</a>
|
||||
@ -3884,6 +4185,51 @@ DBObject = SET_GROUP:New()</code></pre>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(SET_GROUP).NoneInZone" >
|
||||
<strong>SET_GROUP:NoneInZone(ZoneObject, Zone)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Iterate the SET_GROUP and return true if no <a href="GROUP.html">GROUP</a> of the <a href="SET_GROUP.html">SET_GROUP</a> is in <a href="ZONE.html">ZONE</a>
|
||||
This could also be achieved with <code>not SET_GROUP:AnyPartlyInZone(Zone)</code>, but it's easier for the
|
||||
mission designer to add a dedicated method</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Core.Zone.html##(ZONE)">Core.Zone#ZONE</a> ZoneObject </em></code>:
|
||||
The Zone to be tested for.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em> Zone </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em>#boolean:</em>
|
||||
true if no <a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a> is inside the <a href="Core.Zone.html##(ZONE)">Core.Zone#ZONE</a> in any way, false otherwise.</p>
|
||||
|
||||
<h3>Usage:</h3>
|
||||
<pre class="example"><code>local MyZone = ZONE:New("Zone1")
|
||||
local MySetGroup = SET_GROUP:New()
|
||||
MySetGroup:AddGroupsByName({"Group1", "Group2"})
|
||||
|
||||
if MySetGroup:NoneInZone(MyZone) then
|
||||
MESSAGE:New("No GROUP is completely in zone !", 10):ToAll()
|
||||
else
|
||||
MESSAGE:New("No UNIT of any GROUP is in zone !", 10):ToAll()
|
||||
end</code></pre>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(SET_GROUP).RemoveGroupsByName" >
|
||||
<strong>SET_GROUP:RemoveGroupsByName(RemoveGroupNames)</strong>
|
||||
</a>
|
||||
|
||||
@ -2966,7 +2966,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<em>#boolean</em>
|
||||
<a id="#(SPAWN).SpawnUnControlled" >
|
||||
<strong>SPAWN.SpawnUnControlled</strong>
|
||||
</a>
|
||||
|
||||
@ -138,15 +138,27 @@
|
||||
<h2><a id="#(SPOT)">Type <code>SPOT</code></a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SPOT).Destroyed">SPOT:Destroyed()</a></td>
|
||||
<td class="summary">
|
||||
<p>Destroyed Trigger for SPOT</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<<<<<<< HEAD
|
||||
<td class="name" nowrap="nowrap"><a href="##(SPOT).IsLasing">SPOT:IsLasing()</a></td>
|
||||
<td class="summary">
|
||||
<p>Check if the SPOT is lasing</p>
|
||||
=======
|
||||
<td class="name" nowrap="nowrap"><a href="##(SPOT).Destroyed">SPOT:Destroyed()</a></td>
|
||||
<td class="summary">
|
||||
<p>Destroyed Trigger for SPOT</p>
|
||||
>>>>>>> master
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SPOT).LaseOff">SPOT:LaseOff()</a></td>
|
||||
<td class="summary">
|
||||
<p>LaseOff Trigger for SPOT</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SPOT).LaseOn">SPOT:LaseOn()</a></td>
|
||||
<td class="summary">
|
||||
<p>LaseOn Trigger for SPOT</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -180,12 +192,15 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
<td class="name" nowrap="nowrap"><a href="##(SPOT).OnAfterDestroyed">SPOT:OnAfterDestroyed(From, Event, To)</a></td>
|
||||
<td class="summary">
|
||||
<p>Destroyed Handler OnAfter for SPOT</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
>>>>>>> master
|
||||
<td class="name" nowrap="nowrap"><a href="##(SPOT).OnAfterLaseOff">SPOT:OnAfterLaseOff(From, Event, To)</a></td>
|
||||
<td class="summary">
|
||||
<p>LaseOff Handler OnAfter for SPOT</p>
|
||||
@ -198,12 +213,15 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
<td class="name" nowrap="nowrap"><a href="##(SPOT).OnBeforeDestroyed">SPOT:OnBeforeDestroyed(From, Event, To)</a></td>
|
||||
<td class="summary">
|
||||
<p>Destroyed Handler OnBefore for SPOT</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
>>>>>>> master
|
||||
<td class="name" nowrap="nowrap"><a href="##(SPOT).OnBeforeLaseOff">SPOT:OnBeforeLaseOff(From, Event, To)</a></td>
|
||||
<td class="summary">
|
||||
<p>LaseOff Handler OnBefore for SPOT</p>
|
||||
@ -252,12 +270,15 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
<td class="name" nowrap="nowrap"><a href="##(SPOT).__Destroyed">SPOT:__Destroyed(Delay)</a></td>
|
||||
<td class="summary">
|
||||
<p>Destroyed Asynchronous Trigger for SPOT</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
>>>>>>> master
|
||||
<td class="name" nowrap="nowrap"><a href="##(SPOT).__LaseOff">SPOT:__LaseOff(Delay)</a></td>
|
||||
<td class="summary">
|
||||
<p>LaseOff Asynchronous Trigger for SPOT</p>
|
||||
@ -311,31 +332,53 @@
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(SPOT).Destroyed" >
|
||||
<strong>SPOT:Destroyed()</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Destroyed Trigger for SPOT</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a id="#(SPOT).IsLasing" >
|
||||
<strong>SPOT:IsLasing()</strong>
|
||||
=======
|
||||
<a id="#(SPOT).Destroyed" >
|
||||
<strong>SPOT:Destroyed()</strong>
|
||||
>>>>>>> master
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<<<<<<< HEAD
|
||||
<p>Check if the SPOT is lasing</p>
|
||||
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em>#boolean:</em>
|
||||
true if it is lasing</p>
|
||||
=======
|
||||
<p>Destroyed Trigger for SPOT</p>
|
||||
>>>>>>> master
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(SPOT).LaseOff" >
|
||||
<strong>SPOT:LaseOff()</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>LaseOff Trigger for SPOT</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(SPOT).LaseOn" >
|
||||
<strong>SPOT:LaseOn()</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>LaseOn Trigger for SPOT</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
@ -432,6 +475,8 @@ true if it is lasing</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
<a id="#(SPOT).OnAfterDestroyed" >
|
||||
<strong>SPOT:OnAfterDestroyed(From, Event, To)</strong>
|
||||
</a>
|
||||
@ -463,6 +508,7 @@ true if it is lasing</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
>>>>>>> master
|
||||
<a id="#(SPOT).OnAfterLaseOff" >
|
||||
<strong>SPOT:OnAfterLaseOff(From, Event, To)</strong>
|
||||
</a>
|
||||
@ -525,6 +571,8 @@ true if it is lasing</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
<a id="#(SPOT).OnBeforeDestroyed" >
|
||||
<strong>SPOT:OnBeforeDestroyed(From, Event, To)</strong>
|
||||
</a>
|
||||
@ -561,6 +609,7 @@ true if it is lasing</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
>>>>>>> master
|
||||
<a id="#(SPOT).OnBeforeLaseOff" >
|
||||
<strong>SPOT:OnBeforeLaseOff(From, Event, To)</strong>
|
||||
</a>
|
||||
@ -681,6 +730,10 @@ true if it is lasing</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a id="#(SPOT).Spot" >
|
||||
<strong>SPOT.Spot</strong>
|
||||
=======
|
||||
<a id="#(SPOT).SpotIR" >
|
||||
<strong>SPOT.SpotIR</strong>
|
||||
</a>
|
||||
@ -696,6 +749,7 @@ true if it is lasing</p>
|
||||
|
||||
<a id="#(SPOT).SpotLaser" >
|
||||
<strong>SPOT.SpotLaser</strong>
|
||||
>>>>>>> master
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
@ -720,6 +774,8 @@ true if it is lasing</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
<a id="#(SPOT).__Destroyed" >
|
||||
<strong>SPOT:__Destroyed(Delay)</strong>
|
||||
</a>
|
||||
@ -741,6 +797,7 @@ true if it is lasing</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
>>>>>>> master
|
||||
<a id="#(SPOT).__LaseOff" >
|
||||
<strong>SPOT:__LaseOff(Delay)</strong>
|
||||
</a>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user