Merge pull request #298 from FlightControl-Master/master-bugfix

fixes of base and scoring
This commit is contained in:
Sven Van de Velde 2017-03-08 21:41:04 +01:00 committed by GitHub
commit d16b68e03a
7 changed files with 105 additions and 19 deletions

View File

@ -20,7 +20,7 @@
--
-- ## 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.
--
-- ## 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()
local self = routines.utils.deepCopy( self ) -- Create a new self instance
local MetaTable = {}
@ -289,6 +299,11 @@ function BASE:Inherit( Child, Parent )
end
--- 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 Child is the Child class from which the Parent class needs to be retrieved.
-- @return #BASE

View File

@ -1529,7 +1529,7 @@ function SCORING:OpenCSV( ScoringCSV )
error( "Error: Cannot open CSV file in " .. lfs.writedir() )
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")
else

View File

@ -1,5 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
env.info( 'Moose Generation Timestamp: 20170308_2048' )
env.info( 'Moose Generation Timestamp: 20170308_2139' )
local base = _G
Include = {}
@ -2812,7 +2812,7 @@ end
--
-- ## 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.
--
-- ## 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()
local self = routines.utils.deepCopy( self ) -- Create a new self instance
local MetaTable = {}
@ -3081,6 +3091,11 @@ function BASE:Inherit( Child, Parent )
end
--- 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 Child is the Child class from which the Parent class needs to be retrieved.
-- @return #BASE
@ -19810,7 +19825,7 @@ function SCORING:OpenCSV( ScoringCSV )
error( "Error: Cannot open CSV file in " .. lfs.writedir() )
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")
else

View File

@ -1,5 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
env.info( 'Moose Generation Timestamp: 20170308_2048' )
env.info( 'Moose Generation Timestamp: 20170308_2139' )
local base = _G
Include = {}
@ -2812,7 +2812,7 @@ end
--
-- ## 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.
--
-- ## 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()
local self = routines.utils.deepCopy( self ) -- Create a new self instance
local MetaTable = {}
@ -3081,6 +3091,11 @@ function BASE:Inherit( Child, Parent )
end
--- 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 Child is the Child class from which the Parent class needs to be retrieved.
-- @return #BASE
@ -19810,7 +19825,7 @@ function SCORING:OpenCSV( ScoringCSV )
error( "Error: Cannot open CSV file in " .. lfs.writedir() )
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")
else

View File

@ -99,7 +99,8 @@
<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>
@ -447,7 +448,7 @@ YYYY-MM-DD: CLASS:<strong>NewFunction( Params )</strong> added</p>
<tr>
<td class="name" nowrap="nowrap"><a href="##(BASE).New">BASE:New()</a></td>
<td class="summary">
<p>BASE constructor.</p>
</td>
</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>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>
<ul>
<li>
@ -1264,10 +1273,23 @@ Child</p>
</dt>
<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>
</dl>

View File

@ -1226,7 +1226,6 @@ The new calculated POINT_VEC2.</p>
<dl class="function">
<dt>
<em></em>
<a id="#(POINT_VEC2).z" >
<strong>POINT_VEC2.z</strong>
</a>

View File

@ -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="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).uncontrolled">SPAWN.uncontrolled</a></td>
<td class="summary">
</td>
</tr>
</table>
@ -3192,6 +3198,20 @@ True = Continue Scheduler</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(SPAWN).uncontrolled" >
<strong>SPAWN.uncontrolled</strong>
</a>
</dt>
<dd>
</dd>
</dl>