Skip to content

Commit

Permalink
🐛 single primary constructor
Browse files Browse the repository at this point in the history
to set the default values correctly
  • Loading branch information
b8daniel committed May 1, 2022
1 parent 254f879 commit 62b8c0a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import kotlin.time.Duration.Companion.milliseconds
import kotlin.time.Duration.Companion.minutes
import kotlin.time.Duration.Companion.seconds

class GameConfig() : ConfigurationSerializable {
class GameConfig(cfg: MutableMap<String, Any> = mutableMapOf()) : ConfigurationSerializable {

/**
* game, gameLoop, refill, respawn, shot, kill, timer, restart, regen
Expand All @@ -29,7 +29,7 @@ class GameConfig() : ConfigurationSerializable {

var noReplace = DefaultConfig.noReplace

constructor(cfg: MutableMap<String, Any>) : this() {
init {
val cfgDurations = cfg["durations"] as? Map<*, *> ?: mapOf<String, ConfigDuration>()
val mappedDurs =
DefaultConfig.durations +
Expand Down

0 comments on commit 62b8c0a

Please sign in to comment.