mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Merge pull request #298 from FlightControl-Master/master-bugfix
fixes of base and scoring
This commit is contained in:
commit
d16b68e03a
@ -20,7 +20,7 @@
|
|||||||
--
|
--
|
||||||
-- ## 1.1) BASE constructor
|
-- ## 1.1) BASE constructor
|
||||||
--
|
--
|
||||||
-- Any class derived from BASE, must use the @{Base#BASE.New) constructor within the @{Base#BASE.Inherit) method.
|
-- Any class derived from BASE, will use the @{Base#BASE.New} constructor embedded in the @{Base#BASE.Inherit} method.
|
||||||
-- See an example at the @{Base#BASE.New} method how this is done.
|
-- See an example at the @{Base#BASE.New} method how this is done.
|
||||||
--
|
--
|
||||||
-- ## 1.2) Trace information for debugging
|
-- ## 1.2) Trace information for debugging
|
||||||
@ -227,7 +227,17 @@ FORMATION = {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- @todo need to investigate if the deepCopy is really needed... Don't think so.
|
--- BASE constructor.
|
||||||
|
--
|
||||||
|
-- This is an example how to use the BASE:New() constructor in a new class definition when inheriting from BASE.
|
||||||
|
--
|
||||||
|
-- function EVENT:New()
|
||||||
|
-- local self = BASE:Inherit( self, BASE:New() ) -- #EVENT
|
||||||
|
-- return self
|
||||||
|
-- end
|
||||||
|
--
|
||||||
|
-- @param #BASE self
|
||||||
|
-- @return #BASE
|
||||||
function BASE:New()
|
function BASE:New()
|
||||||
local self = routines.utils.deepCopy( self ) -- Create a new self instance
|
local self = routines.utils.deepCopy( self ) -- Create a new self instance
|
||||||
local MetaTable = {}
|
local MetaTable = {}
|
||||||
@ -289,6 +299,11 @@ function BASE:Inherit( Child, Parent )
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- This is the worker method to retrieve the Parent class.
|
--- This is the worker method to retrieve the Parent class.
|
||||||
|
-- Note that the Parent class must be passed to call the parent class method.
|
||||||
|
--
|
||||||
|
-- self:GetParent(self):ParentMethod()
|
||||||
|
--
|
||||||
|
--
|
||||||
-- @param #BASE self
|
-- @param #BASE self
|
||||||
-- @param #BASE Child is the Child class from which the Parent class needs to be retrieved.
|
-- @param #BASE Child is the Child class from which the Parent class needs to be retrieved.
|
||||||
-- @return #BASE
|
-- @return #BASE
|
||||||
|
|||||||
@ -1529,7 +1529,7 @@ function SCORING:OpenCSV( ScoringCSV )
|
|||||||
error( "Error: Cannot open CSV file in " .. lfs.writedir() )
|
error( "Error: Cannot open CSV file in " .. lfs.writedir() )
|
||||||
end
|
end
|
||||||
|
|
||||||
self.CSVFile:write( '"GameName","RunTime","Time","PlayerName","ScoreType","PlayerUnitCoaltion","PlayerUnitCategory","PlayerUnitType","PlayerUnitName","TargetUnitCoalition","TargetUnitCategory","TargetUnitType","TargetUnitName","Times","Score"\n' )
|
self.CSVFile:write( '"GameName","RunTime","Time","PlayerName","TargetPlayerName","ScoreType","PlayerUnitCoaltion","PlayerUnitCategory","PlayerUnitType","PlayerUnitName","TargetUnitCoalition","TargetUnitCategory","TargetUnitType","TargetUnitName","Times","Score"\n' )
|
||||||
|
|
||||||
self.RunTime = os.date("%y-%m-%d_%H-%M-%S")
|
self.RunTime = os.date("%y-%m-%d_%H-%M-%S")
|
||||||
else
|
else
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
||||||
env.info( 'Moose Generation Timestamp: 20170308_2048' )
|
env.info( 'Moose Generation Timestamp: 20170308_2139' )
|
||||||
local base = _G
|
local base = _G
|
||||||
|
|
||||||
Include = {}
|
Include = {}
|
||||||
@ -2812,7 +2812,7 @@ end
|
|||||||
--
|
--
|
||||||
-- ## 1.1) BASE constructor
|
-- ## 1.1) BASE constructor
|
||||||
--
|
--
|
||||||
-- Any class derived from BASE, must use the @{Base#BASE.New) constructor within the @{Base#BASE.Inherit) method.
|
-- Any class derived from BASE, will use the @{Base#BASE.New} constructor embedded in the @{Base#BASE.Inherit} method.
|
||||||
-- See an example at the @{Base#BASE.New} method how this is done.
|
-- See an example at the @{Base#BASE.New} method how this is done.
|
||||||
--
|
--
|
||||||
-- ## 1.2) Trace information for debugging
|
-- ## 1.2) Trace information for debugging
|
||||||
@ -3019,7 +3019,17 @@ FORMATION = {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- @todo need to investigate if the deepCopy is really needed... Don't think so.
|
--- BASE constructor.
|
||||||
|
--
|
||||||
|
-- This is an example how to use the BASE:New() constructor in a new class definition when inheriting from BASE.
|
||||||
|
--
|
||||||
|
-- function EVENT:New()
|
||||||
|
-- local self = BASE:Inherit( self, BASE:New() ) -- #EVENT
|
||||||
|
-- return self
|
||||||
|
-- end
|
||||||
|
--
|
||||||
|
-- @param #BASE self
|
||||||
|
-- @return #BASE
|
||||||
function BASE:New()
|
function BASE:New()
|
||||||
local self = routines.utils.deepCopy( self ) -- Create a new self instance
|
local self = routines.utils.deepCopy( self ) -- Create a new self instance
|
||||||
local MetaTable = {}
|
local MetaTable = {}
|
||||||
@ -3081,6 +3091,11 @@ function BASE:Inherit( Child, Parent )
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- This is the worker method to retrieve the Parent class.
|
--- This is the worker method to retrieve the Parent class.
|
||||||
|
-- Note that the Parent class must be passed to call the parent class method.
|
||||||
|
--
|
||||||
|
-- self:GetParent(self):ParentMethod()
|
||||||
|
--
|
||||||
|
--
|
||||||
-- @param #BASE self
|
-- @param #BASE self
|
||||||
-- @param #BASE Child is the Child class from which the Parent class needs to be retrieved.
|
-- @param #BASE Child is the Child class from which the Parent class needs to be retrieved.
|
||||||
-- @return #BASE
|
-- @return #BASE
|
||||||
@ -19810,7 +19825,7 @@ function SCORING:OpenCSV( ScoringCSV )
|
|||||||
error( "Error: Cannot open CSV file in " .. lfs.writedir() )
|
error( "Error: Cannot open CSV file in " .. lfs.writedir() )
|
||||||
end
|
end
|
||||||
|
|
||||||
self.CSVFile:write( '"GameName","RunTime","Time","PlayerName","ScoreType","PlayerUnitCoaltion","PlayerUnitCategory","PlayerUnitType","PlayerUnitName","TargetUnitCoalition","TargetUnitCategory","TargetUnitType","TargetUnitName","Times","Score"\n' )
|
self.CSVFile:write( '"GameName","RunTime","Time","PlayerName","TargetPlayerName","ScoreType","PlayerUnitCoaltion","PlayerUnitCategory","PlayerUnitType","PlayerUnitName","TargetUnitCoalition","TargetUnitCategory","TargetUnitType","TargetUnitName","Times","Score"\n' )
|
||||||
|
|
||||||
self.RunTime = os.date("%y-%m-%d_%H-%M-%S")
|
self.RunTime = os.date("%y-%m-%d_%H-%M-%S")
|
||||||
else
|
else
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
||||||
env.info( 'Moose Generation Timestamp: 20170308_2048' )
|
env.info( 'Moose Generation Timestamp: 20170308_2139' )
|
||||||
local base = _G
|
local base = _G
|
||||||
|
|
||||||
Include = {}
|
Include = {}
|
||||||
@ -2812,7 +2812,7 @@ end
|
|||||||
--
|
--
|
||||||
-- ## 1.1) BASE constructor
|
-- ## 1.1) BASE constructor
|
||||||
--
|
--
|
||||||
-- Any class derived from BASE, must use the @{Base#BASE.New) constructor within the @{Base#BASE.Inherit) method.
|
-- Any class derived from BASE, will use the @{Base#BASE.New} constructor embedded in the @{Base#BASE.Inherit} method.
|
||||||
-- See an example at the @{Base#BASE.New} method how this is done.
|
-- See an example at the @{Base#BASE.New} method how this is done.
|
||||||
--
|
--
|
||||||
-- ## 1.2) Trace information for debugging
|
-- ## 1.2) Trace information for debugging
|
||||||
@ -3019,7 +3019,17 @@ FORMATION = {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- @todo need to investigate if the deepCopy is really needed... Don't think so.
|
--- BASE constructor.
|
||||||
|
--
|
||||||
|
-- This is an example how to use the BASE:New() constructor in a new class definition when inheriting from BASE.
|
||||||
|
--
|
||||||
|
-- function EVENT:New()
|
||||||
|
-- local self = BASE:Inherit( self, BASE:New() ) -- #EVENT
|
||||||
|
-- return self
|
||||||
|
-- end
|
||||||
|
--
|
||||||
|
-- @param #BASE self
|
||||||
|
-- @return #BASE
|
||||||
function BASE:New()
|
function BASE:New()
|
||||||
local self = routines.utils.deepCopy( self ) -- Create a new self instance
|
local self = routines.utils.deepCopy( self ) -- Create a new self instance
|
||||||
local MetaTable = {}
|
local MetaTable = {}
|
||||||
@ -3081,6 +3091,11 @@ function BASE:Inherit( Child, Parent )
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- This is the worker method to retrieve the Parent class.
|
--- This is the worker method to retrieve the Parent class.
|
||||||
|
-- Note that the Parent class must be passed to call the parent class method.
|
||||||
|
--
|
||||||
|
-- self:GetParent(self):ParentMethod()
|
||||||
|
--
|
||||||
|
--
|
||||||
-- @param #BASE self
|
-- @param #BASE self
|
||||||
-- @param #BASE Child is the Child class from which the Parent class needs to be retrieved.
|
-- @param #BASE Child is the Child class from which the Parent class needs to be retrieved.
|
||||||
-- @return #BASE
|
-- @return #BASE
|
||||||
@ -19810,7 +19825,7 @@ function SCORING:OpenCSV( ScoringCSV )
|
|||||||
error( "Error: Cannot open CSV file in " .. lfs.writedir() )
|
error( "Error: Cannot open CSV file in " .. lfs.writedir() )
|
||||||
end
|
end
|
||||||
|
|
||||||
self.CSVFile:write( '"GameName","RunTime","Time","PlayerName","ScoreType","PlayerUnitCoaltion","PlayerUnitCategory","PlayerUnitType","PlayerUnitName","TargetUnitCoalition","TargetUnitCategory","TargetUnitType","TargetUnitName","Times","Score"\n' )
|
self.CSVFile:write( '"GameName","RunTime","Time","PlayerName","TargetPlayerName","ScoreType","PlayerUnitCoaltion","PlayerUnitCategory","PlayerUnitType","PlayerUnitName","TargetUnitCoalition","TargetUnitCategory","TargetUnitType","TargetUnitName","Times","Score"\n' )
|
||||||
|
|
||||||
self.RunTime = os.date("%y-%m-%d_%H-%M-%S")
|
self.RunTime = os.date("%y-%m-%d_%H-%M-%S")
|
||||||
else
|
else
|
||||||
|
|||||||
@ -99,7 +99,8 @@
|
|||||||
|
|
||||||
<h2>1.1) BASE constructor</h2>
|
<h2>1.1) BASE constructor</h2>
|
||||||
|
|
||||||
<p>Any class derived from BASE, must use the <a href="Base.html##(BASE).New">Base#BASE.New</a> method how this is done.</p>
|
<p>Any class derived from BASE, will use the <a href="Base.html##(BASE).New">Base#BASE.New</a> constructor embedded in the <a href="Base.html##(BASE).Inherit">Base#BASE.Inherit</a> method.
|
||||||
|
See an example at the <a href="Base.html##(BASE).New">Base#BASE.New</a> method how this is done.</p>
|
||||||
|
|
||||||
<h2>1.2) Trace information for debugging</h2>
|
<h2>1.2) Trace information for debugging</h2>
|
||||||
|
|
||||||
@ -447,7 +448,7 @@ YYYY-MM-DD: CLASS:<strong>NewFunction( Params )</strong> added</p>
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="name" nowrap="nowrap"><a href="##(BASE).New">BASE:New()</a></td>
|
<td class="name" nowrap="nowrap"><a href="##(BASE).New">BASE:New()</a></td>
|
||||||
<td class="summary">
|
<td class="summary">
|
||||||
|
<p>BASE constructor.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -1114,6 +1115,14 @@ The <a href="Event.html">Event</a> processing Priority.</p>
|
|||||||
|
|
||||||
<p>This is the worker method to retrieve the Parent class.</p>
|
<p>This is the worker method to retrieve the Parent class.</p>
|
||||||
|
|
||||||
|
|
||||||
|
<p>Note that the Parent class must be passed to call the parent class method.</p>
|
||||||
|
|
||||||
|
<pre><code>self:GetParent(self):ParentMethod()
|
||||||
|
|
||||||
|
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
<h3>Parameter</h3>
|
<h3>Parameter</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
@ -1264,10 +1273,23 @@ Child</p>
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
|
||||||
|
<p>BASE constructor.</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p> @todo need to investigate if the deepCopy is really needed... Don't think so.</p>
|
<p>This is an example how to use the BASE:New() constructor in a new class definition when inheriting from BASE.</p>
|
||||||
|
|
||||||
|
<pre><code>function EVENT:New()
|
||||||
|
local self = BASE:Inherit( self, BASE:New() ) -- #EVENT
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h3>Return value</h3>
|
||||||
|
|
||||||
|
<p><em><a href="##(BASE)">#BASE</a>:</em></p>
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|||||||
@ -1226,7 +1226,6 @@ The new calculated POINT_VEC2.</p>
|
|||||||
<dl class="function">
|
<dl class="function">
|
||||||
<dt>
|
<dt>
|
||||||
|
|
||||||
<em></em>
|
|
||||||
<a id="#(POINT_VEC2).z" >
|
<a id="#(POINT_VEC2).z" >
|
||||||
<strong>POINT_VEC2.z</strong>
|
<strong>POINT_VEC2.z</strong>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@ -834,6 +834,12 @@ A coding example is provided at the description of the <a href="##(SPAWN).OnSpaw
|
|||||||
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._TranslateRotate">SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle)</a></td>
|
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._TranslateRotate">SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle)</a></td>
|
||||||
<td class="summary">
|
<td class="summary">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="name" nowrap="nowrap"><a href="##(SPAWN).uncontrolled">SPAWN.uncontrolled</a></td>
|
||||||
|
<td class="summary">
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@ -3192,6 +3198,20 @@ True = Continue Scheduler</p>
|
|||||||
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="function">
|
||||||
|
<dt>
|
||||||
|
|
||||||
|
<em></em>
|
||||||
|
<a id="#(SPAWN).uncontrolled" >
|
||||||
|
<strong>SPAWN.uncontrolled</strong>
|
||||||
|
</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user