Develop (#16)
* Initial Methods for SpearheadAPI * Added Spearhead API * Added Spearhead API * fixed compile for api * Added notes for API in beta * Added notes for API in beta * Added Menu to all doc pages * Added Menu to all doc pages * added it for real * added it for real * fixed develop * fixed develop * fixed develop * wip * wip * updated * work in progress * work in progress * added empty docs page * wip * removed SAR files from persistence branch * Added Blue Sams as seperate class * added initial persistance * added initial persistance * added initial persistance * added initial persistance * added initial persistance * added menu to persistence markdown * added menu to persistence markdown * added menu to persistence markdown * docs update * wip * wip * Refactor of Stage classes. * wip * wip * wip * reworked bluesam and stagebase * Added waiting stage functionality * updated docs * wip * wip * wip * updated * wip * wip * wip * refactored without issues, needs testing --------- Co-authored-by: Dutchie <54616262+dutchie032@users.noreply.github.com> Co-authored-by: dutchie032 <dutchie032> Co-authored-by: ex61wi <tim.rorije@ing.com>
This commit is contained in:
committed by
GitHub
co-authored by
Dutchie
dutchie032 <dutchie032>
ex61wi
parent
9c6a5ed217
commit
ff392e0e7e
@@ -48,7 +48,7 @@ function CapConfig:new()
|
||||
local deathDelay = tonumber(SpearheadConfig.CapConfig.deathDelay) or 1800
|
||||
---@return number
|
||||
o.getDeathDelay = function(self) return deathDelay end
|
||||
o.logLevel = Spearhead.LoggerTemplate.LogLevelOptions.INFO
|
||||
o.logLevel = "INFO"
|
||||
|
||||
return o;
|
||||
end
|
||||
|
||||
@@ -1,44 +1,38 @@
|
||||
|
||||
--- @class StageConfig
|
||||
--- @field isEnabled boolean
|
||||
--- @field isDrawStagesEnabled boolean
|
||||
--- @field isAutoStages boolean
|
||||
--- @field startingStage integer
|
||||
--- @field maxMissionsPerStage integer
|
||||
--- @field logLevel LogLevel
|
||||
|
||||
|
||||
local StageConfig = {};
|
||||
|
||||
---comment
|
||||
---@return StageConfig
|
||||
function StageConfig:new()
|
||||
local o = {}
|
||||
setmetatable(o, { __index = self })
|
||||
|
||||
if SpearheadConfig == nil then SpearheadConfig = {} end
|
||||
if SpearheadConfig.StageConfig == nil then SpearheadConfig.StageConfig = {} end
|
||||
|
||||
local enabled = SpearheadConfig.StageConfig.enabled
|
||||
if enabled == nil then enabled = true end
|
||||
---@return boolean
|
||||
o.isEnabled = function(self) return enabled == true end
|
||||
---@type StageConfig
|
||||
local o = {
|
||||
isEnabled = SpearheadConfig.StageConfig.enabled or true,
|
||||
isDrawStagesEnabled = SpearheadConfig.StageConfig.drawStages or true,
|
||||
isAutoStages = SpearheadConfig.StageConfig.autoStages or true,
|
||||
startingStage = SpearheadConfig.StageConfig.startingStage or 1,
|
||||
maxMissionsPerStage = SpearheadConfig.StageConfig.maxMissionStage or 10,
|
||||
logLevel = "INFO"
|
||||
}
|
||||
|
||||
local drawStages = SpearheadConfig.StageConfig.drawStages
|
||||
if drawStages == nil then drawStages = true end
|
||||
---@return boolean
|
||||
o.isDrawStagesEnabled = function(self) return drawStages == true end
|
||||
|
||||
local autoStages = SpearheadConfig.StageConfig.autoStages or true
|
||||
if autoStages == nil then autoStages = true end
|
||||
---@return boolean
|
||||
o.isAutoStages = function(self) return autoStages end
|
||||
|
||||
local maxMissionsPerStage = SpearheadConfig.StageConfig.maxMissionStage
|
||||
o.getMaxMissionsPerStage = function(self) return maxMissionsPerStage end
|
||||
|
||||
o.logLevel = Spearhead.LoggerTemplate.LogLevelOptions.INFO
|
||||
|
||||
local startingStage = SpearheadConfig.StageConfig.startingStage or 1
|
||||
o.getStartingStage = function(self) return startingStage end
|
||||
|
||||
o.toString = function()
|
||||
return Spearhead.Util.toString({
|
||||
maxMissionsPerStage = maxMissionsPerStage,
|
||||
enabled = enabled,
|
||||
drawStages = drawStages,
|
||||
autoStages = autoStages
|
||||
})
|
||||
if SpearheadConfig.StageConfig.debugEnabled == true then
|
||||
o.logLevel = "DEBUG"
|
||||
end
|
||||
|
||||
setmetatable(o, { __index = self })
|
||||
|
||||
return o;
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user