added StageOverview elements
This commit is contained in:
Binary file not shown.
@@ -198,9 +198,38 @@ function GlobalStageManager:NewAndStart(database, stageConfig, logLevel)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return o
|
return o
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
GlobalStageManager.printFullOverview = function ()
|
||||||
|
|
||||||
|
local logger = Spearhead.LoggerTemplate.new("StageOverview", "INFO")
|
||||||
|
logger:info("Stage overview:")
|
||||||
|
for stageIndex, stages in pairs(StagesByIndex) do
|
||||||
|
|
||||||
|
local totalStrike = 0
|
||||||
|
local totalbai = 0
|
||||||
|
local totaldead = 0
|
||||||
|
local totalMissions = 0
|
||||||
|
|
||||||
|
for _, stage in pairs(stages) do
|
||||||
|
|
||||||
|
local strike, dead, bai = stage:GetStageStats()
|
||||||
|
|
||||||
|
totalStrike = totalStrike + strike
|
||||||
|
totalbai = totalbai + bai
|
||||||
|
totaldead = totaldead + dead
|
||||||
|
totalMissions = totalMissions + strike + dead + bai
|
||||||
|
end
|
||||||
|
logger:info("Stage# " .. tostring(stageIndex).. " | " .. totalStrike .. " strikes | " .. totaldead .. " dead | " .. totalbai .. " BAI | Total:" .. totalMissions)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
---comment
|
---comment
|
||||||
---@param stageNumber number
|
---@param stageNumber number
|
||||||
---@return boolean | nil
|
---@return boolean | nil
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ function Stage:superNew(database, stageConfig, logger, initData, missionPriority
|
|||||||
|
|
||||||
return time + 20
|
return time + 20
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
do -- load tables
|
do -- load tables
|
||||||
local missionZones = database:getMissionsForStage(self.zoneName)
|
local missionZones = database:getMissionsForStage(self.zoneName)
|
||||||
@@ -450,6 +451,29 @@ function Stage:ActivateBlueGroups()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@return number strike
|
||||||
|
---@return number dead
|
||||||
|
---@return number bai
|
||||||
|
function Stage:GetStageStats()
|
||||||
|
|
||||||
|
local strike = 0
|
||||||
|
local dead = 0
|
||||||
|
local bai = 0
|
||||||
|
|
||||||
|
for _, mission in pairs(self._db.missions) do
|
||||||
|
if mission.missionType == "STRIKE" then
|
||||||
|
strike = strike + 1
|
||||||
|
elseif mission.missionType == "DEAD" then
|
||||||
|
dead = dead + 1
|
||||||
|
elseif mission.missionType == "BAI" then
|
||||||
|
bai = bai + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return strike, dead, bai
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
function Stage:ActivateBlueStage()
|
function Stage:ActivateBlueStage()
|
||||||
|
|
||||||
self._logger:debug("Setting stage '" .. Spearhead.Util.toString(self.zoneName) .. "' to blue")
|
self._logger:debug("Setting stage '" .. Spearhead.Util.toString(self.zoneName) .. "' to blue")
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
|
||||||
SpearheadConfig = {
|
SpearheadConfig = {
|
||||||
|
|
||||||
|
debugEnabled = false, -- default false
|
||||||
|
|
||||||
CapConfig = {
|
CapConfig = {
|
||||||
--quickly enable of disable the entire CAP Logic
|
--quickly enable of disable the entire CAP Logic
|
||||||
--(you can also just rename all units to not be named "CAP_")
|
--(you can also just rename all units to not be named "CAP_")
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
SpearheadConfig = {
|
SpearheadConfig = {
|
||||||
|
|
||||||
|
debugEnabled = false,
|
||||||
CapConfig = {
|
CapConfig = {
|
||||||
--quickly enable of disable the entire CAP Logic
|
--quickly enable of disable the entire CAP Logic
|
||||||
--(you can also just rename all units to not be named "CAP_")
|
--(you can also just rename all units to not be named "CAP_")
|
||||||
|
|||||||
@@ -2,10 +2,8 @@
|
|||||||
--Single player purpose
|
--Single player purpose
|
||||||
|
|
||||||
local defaultLogLevel = "INFO"
|
local defaultLogLevel = "INFO"
|
||||||
local debug = false
|
|
||||||
local id = net.get_my_player_id()
|
if SpearheadConfig and SpearheadConfig.debugEnabled == true then
|
||||||
if id == 0 then
|
|
||||||
debug = true
|
|
||||||
defaultLogLevel = "DEBUG"
|
defaultLogLevel = "DEBUG"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -53,6 +51,8 @@ standardLogger:info("Spearhead Initialisation duration: " .. tostring(duration)
|
|||||||
|
|
||||||
Spearhead.LoadingDone()
|
Spearhead.LoadingDone()
|
||||||
|
|
||||||
|
Spearhead.internal.GlobalStageManager:printFullOverview()
|
||||||
|
|
||||||
--Check lines of code in directory per file:
|
--Check lines of code in directory per file:
|
||||||
-- Get-ChildItem . -Include *.lua -Recurse | foreach {""+(Get-Content $_).Count + " => " + $_.name }; && GCI . -Include *.lua* -Recurse | foreach{(GC $_).Count} | measure-object -sum | % Sum
|
-- Get-ChildItem . -Include *.lua -Recurse | foreach {""+(Get-Content $_).Count + " => " + $_.name }; && GCI . -Include *.lua* -Recurse | foreach{(GC $_).Count} | measure-object -sum | % Sum
|
||||||
-- find . -name '*.lua' | xargs wc -l
|
-- find . -name '*.lua' | xargs wc -l
|
||||||
|
|||||||
Reference in New Issue
Block a user