Merge remote-tracking branch 'refs/remotes/origin/master' into 386-ai-designate

This commit is contained in:
FlightControl 2017-04-23 08:48:40 +02:00
commit cfeec372d7
8 changed files with 663 additions and 29 deletions

View File

@ -981,6 +981,185 @@ function SET_GROUP:ForEachGroupNotInZone( ZoneObject, IteratorFunction, ... )
return self return self
end 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. ----- 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 ---- @param #SET_GROUP self

View File

@ -555,22 +555,23 @@ end
function GROUP:IsPartlyInZone( Zone ) function GROUP:IsPartlyInZone( Zone )
self:F2( { self.GroupName, Zone } ) self:F2( { self.GroupName, Zone } )
local PartlyInZone = false local IsOneUnitInZone = false
local IsOneUnitOutsideZone = false
for UnitID, UnitData in pairs( self:GetUnits() ) do for UnitID, UnitData in pairs( self:GetUnits() ) do
local Unit = UnitData -- Wrapper.Unit#UNIT local Unit = UnitData -- Wrapper.Unit#UNIT
if Zone:IsVec3InZone( Unit:GetVec3() ) then if Zone:IsVec3InZone( Unit:GetVec3() ) then
PartlyInZone = true IsOneUnitInZone = true
else else
-- So, if there were groups in the zone found, and suddenly one NOT in the zone, IsOneUnitOutsideZone = true
-- then the group is partialy in the zone :-)
if PartlyInZone == true then
return true
end
end end
end end
if IsOneUnitInZone and IsOneUnitOutsideZone then
return true
else
return false return false
end
end end
--- Returns true if none of the group units of the group are within a @{Zone}. --- 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 return true
end 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. --- 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. -- If the group is a helicopter or a plane, then this method will return true, otherwise false.
-- @param #GROUP self -- @param #GROUP self

View File

@ -2847,7 +2847,6 @@ The range till cargo will board.</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em></em>
<a id="#(CARGO_UNIT).CargoCarrier" > <a id="#(CARGO_UNIT).CargoCarrier" >
<strong>CARGO_UNIT.CargoCarrier</strong> <strong>CARGO_UNIT.CargoCarrier</strong>
</a> </a>

View File

@ -190,6 +190,12 @@
<td class="name" nowrap="nowrap"><a href="##(GROUP).CopyRoute">GROUP:CopyRoute(Begin, End, Randomize, Radius)</a></td> <td class="name" nowrap="nowrap"><a href="##(GROUP).CopyRoute">GROUP:CopyRoute(Begin, End, Randomize, Radius)</a></td>
<td class="summary"> <td class="summary">
<p>Return the route of a group by using the <a href="Database.html##(DATABASE)">Database#DATABASE</a> class.</p> <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> </td>
</tr> </tr>
<tr> <tr>
@ -680,6 +686,33 @@ When randomization is on, the randomization is within the radius.</p>
<dl class="function"> <dl class="function">
<dt> <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" > <a id="#(GROUP).Destroy" >
<strong>GROUP:Destroy()</strong> <strong>GROUP:Destroy()</strong>
</a> </a>

View File

@ -1200,6 +1200,7 @@ self</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em><a href="Core.Spot.html##(SPOT)">Core.Spot#SPOT</a></em>
<a id="#(POSITIONABLE).Spot" > <a id="#(POSITIONABLE).Spot" >
<strong>POSITIONABLE.Spot</strong> <strong>POSITIONABLE.Spot</strong>
</a> </a>

View File

@ -727,6 +727,44 @@
<td class="name" nowrap="nowrap"><a href="##(SET_GROUP).AddInDatabase">SET_GROUP:AddInDatabase(Event)</a></td> <td class="name" nowrap="nowrap"><a href="##(SET_GROUP).AddInDatabase">SET_GROUP:AddInDatabase(Event)</a></td>
<td class="summary"> <td class="summary">
<p>Handles the Database to check on an event (birth) that the Object was added in the Database.</p> <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> </td>
</tr> </tr>
<tr> <tr>
@ -811,6 +849,14 @@
<td class="name" nowrap="nowrap"><a href="##(SET_GROUP).New">SET_GROUP:New()</a></td> <td class="name" nowrap="nowrap"><a href="##(SET_GROUP).New">SET_GROUP:New()</a></td>
<td class="summary"> <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> <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> </td>
</tr> </tr>
<tr> <tr>
@ -3460,6 +3506,261 @@ The GROUP</p>
<dl class="function"> <dl class="function">
<dt> <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" > <a id="#(SET_GROUP).FilterCategories" >
<strong>SET_GROUP:FilterCategories(Categories)</strong> <strong>SET_GROUP:FilterCategories(Categories)</strong>
</a> </a>
@ -3884,6 +4185,51 @@ DBObject = SET_GROUP:New()</code></pre>
<dl class="function"> <dl class="function">
<dt> <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" > <a id="#(SET_GROUP).RemoveGroupsByName" >
<strong>SET_GROUP:RemoveGroupsByName(RemoveGroupNames)</strong> <strong>SET_GROUP:RemoveGroupsByName(RemoveGroupNames)</strong>
</a> </a>

View File

@ -2966,7 +2966,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
<dl class="function"> <dl class="function">
<dt> <dt>
<em></em> <em>#boolean</em>
<a id="#(SPAWN).SpawnUnControlled" > <a id="#(SPAWN).SpawnUnControlled" >
<strong>SPAWN.SpawnUnControlled</strong> <strong>SPAWN.SpawnUnControlled</strong>
</a> </a>

View File

@ -138,15 +138,27 @@
<h2><a id="#(SPOT)">Type <code>SPOT</code></a></h2> <h2><a id="#(SPOT)">Type <code>SPOT</code></a></h2>
<table class="function_list"> <table class="function_list">
<tr> <tr>
<td class="name" nowrap="nowrap"><a href="##(SPOT).Destroyed">SPOT:Destroyed()</a></td> <<<<<<< HEAD
<td class="summary">
<p>Destroyed Trigger for SPOT</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPOT).IsLasing">SPOT:IsLasing()</a></td> <td class="name" nowrap="nowrap"><a href="##(SPOT).IsLasing">SPOT:IsLasing()</a></td>
<td class="summary"> <td class="summary">
<p>Check if the SPOT is lasing</p> <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> </td>
</tr> </tr>
<tr> <tr>
@ -180,12 +192,15 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<<<<<<< HEAD
=======
<td class="name" nowrap="nowrap"><a href="##(SPOT).OnAfterDestroyed">SPOT:OnAfterDestroyed(From, Event, To)</a></td> <td class="name" nowrap="nowrap"><a href="##(SPOT).OnAfterDestroyed">SPOT:OnAfterDestroyed(From, Event, To)</a></td>
<td class="summary"> <td class="summary">
<p>Destroyed Handler OnAfter for SPOT</p> <p>Destroyed Handler OnAfter for SPOT</p>
</td> </td>
</tr> </tr>
<tr> <tr>
>>>>>>> master
<td class="name" nowrap="nowrap"><a href="##(SPOT).OnAfterLaseOff">SPOT:OnAfterLaseOff(From, Event, To)</a></td> <td class="name" nowrap="nowrap"><a href="##(SPOT).OnAfterLaseOff">SPOT:OnAfterLaseOff(From, Event, To)</a></td>
<td class="summary"> <td class="summary">
<p>LaseOff Handler OnAfter for SPOT</p> <p>LaseOff Handler OnAfter for SPOT</p>
@ -198,12 +213,15 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<<<<<<< HEAD
=======
<td class="name" nowrap="nowrap"><a href="##(SPOT).OnBeforeDestroyed">SPOT:OnBeforeDestroyed(From, Event, To)</a></td> <td class="name" nowrap="nowrap"><a href="##(SPOT).OnBeforeDestroyed">SPOT:OnBeforeDestroyed(From, Event, To)</a></td>
<td class="summary"> <td class="summary">
<p>Destroyed Handler OnBefore for SPOT</p> <p>Destroyed Handler OnBefore for SPOT</p>
</td> </td>
</tr> </tr>
<tr> <tr>
>>>>>>> master
<td class="name" nowrap="nowrap"><a href="##(SPOT).OnBeforeLaseOff">SPOT:OnBeforeLaseOff(From, Event, To)</a></td> <td class="name" nowrap="nowrap"><a href="##(SPOT).OnBeforeLaseOff">SPOT:OnBeforeLaseOff(From, Event, To)</a></td>
<td class="summary"> <td class="summary">
<p>LaseOff Handler OnBefore for SPOT</p> <p>LaseOff Handler OnBefore for SPOT</p>
@ -252,12 +270,15 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<<<<<<< HEAD
=======
<td class="name" nowrap="nowrap"><a href="##(SPOT).__Destroyed">SPOT:__Destroyed(Delay)</a></td> <td class="name" nowrap="nowrap"><a href="##(SPOT).__Destroyed">SPOT:__Destroyed(Delay)</a></td>
<td class="summary"> <td class="summary">
<p>Destroyed Asynchronous Trigger for SPOT</p> <p>Destroyed Asynchronous Trigger for SPOT</p>
</td> </td>
</tr> </tr>
<tr> <tr>
>>>>>>> master
<td class="name" nowrap="nowrap"><a href="##(SPOT).__LaseOff">SPOT:__LaseOff(Delay)</a></td> <td class="name" nowrap="nowrap"><a href="##(SPOT).__LaseOff">SPOT:__LaseOff(Delay)</a></td>
<td class="summary"> <td class="summary">
<p>LaseOff Asynchronous Trigger for SPOT</p> <p>LaseOff Asynchronous Trigger for SPOT</p>
@ -311,31 +332,53 @@
<dl class="function"> <dl class="function">
<dt> <dt>
<a id="#(SPOT).Destroyed" > <<<<<<< HEAD
<strong>SPOT:Destroyed()</strong>
</a>
</dt>
<dd>
<p>Destroyed Trigger for SPOT</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPOT).IsLasing" > <a id="#(SPOT).IsLasing" >
<strong>SPOT:IsLasing()</strong> <strong>SPOT:IsLasing()</strong>
=======
<a id="#(SPOT).Destroyed" >
<strong>SPOT:Destroyed()</strong>
>>>>>>> master
</a> </a>
</dt> </dt>
<dd> <dd>
<<<<<<< HEAD
<p>Check if the SPOT is lasing</p> <p>Check if the SPOT is lasing</p>
<h3>Return value</h3> <h3>Return value</h3>
<p><em>#boolean:</em> <p><em>#boolean:</em>
true if it is lasing</p> 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> </dd>
</dl> </dl>
@ -432,6 +475,8 @@ true if it is lasing</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<<<<<<< HEAD
=======
<a id="#(SPOT).OnAfterDestroyed" > <a id="#(SPOT).OnAfterDestroyed" >
<strong>SPOT:OnAfterDestroyed(From, Event, To)</strong> <strong>SPOT:OnAfterDestroyed(From, Event, To)</strong>
</a> </a>
@ -463,6 +508,7 @@ true if it is lasing</p>
<dl class="function"> <dl class="function">
<dt> <dt>
>>>>>>> master
<a id="#(SPOT).OnAfterLaseOff" > <a id="#(SPOT).OnAfterLaseOff" >
<strong>SPOT:OnAfterLaseOff(From, Event, To)</strong> <strong>SPOT:OnAfterLaseOff(From, Event, To)</strong>
</a> </a>
@ -525,6 +571,8 @@ true if it is lasing</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<<<<<<< HEAD
=======
<a id="#(SPOT).OnBeforeDestroyed" > <a id="#(SPOT).OnBeforeDestroyed" >
<strong>SPOT:OnBeforeDestroyed(From, Event, To)</strong> <strong>SPOT:OnBeforeDestroyed(From, Event, To)</strong>
</a> </a>
@ -561,6 +609,7 @@ true if it is lasing</p>
<dl class="function"> <dl class="function">
<dt> <dt>
>>>>>>> master
<a id="#(SPOT).OnBeforeLaseOff" > <a id="#(SPOT).OnBeforeLaseOff" >
<strong>SPOT:OnBeforeLaseOff(From, Event, To)</strong> <strong>SPOT:OnBeforeLaseOff(From, Event, To)</strong>
</a> </a>
@ -681,6 +730,10 @@ true if it is lasing</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<<<<<<< HEAD
<a id="#(SPOT).Spot" >
<strong>SPOT.Spot</strong>
=======
<a id="#(SPOT).SpotIR" > <a id="#(SPOT).SpotIR" >
<strong>SPOT.SpotIR</strong> <strong>SPOT.SpotIR</strong>
</a> </a>
@ -696,6 +749,7 @@ true if it is lasing</p>
<a id="#(SPOT).SpotLaser" > <a id="#(SPOT).SpotLaser" >
<strong>SPOT.SpotLaser</strong> <strong>SPOT.SpotLaser</strong>
>>>>>>> master
</a> </a>
</dt> </dt>
<dd> <dd>
@ -720,6 +774,8 @@ true if it is lasing</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<<<<<<< HEAD
=======
<a id="#(SPOT).__Destroyed" > <a id="#(SPOT).__Destroyed" >
<strong>SPOT:__Destroyed(Delay)</strong> <strong>SPOT:__Destroyed(Delay)</strong>
</a> </a>
@ -741,6 +797,7 @@ true if it is lasing</p>
<dl class="function"> <dl class="function">
<dt> <dt>
>>>>>>> master
<a id="#(SPOT).__LaseOff" > <a id="#(SPOT).__LaseOff" >
<strong>SPOT:__LaseOff(Delay)</strong> <strong>SPOT:__LaseOff(Delay)</strong>
</a> </a>