DEV 1364: Allow solo games with all rulesets through the CLI (#80)

* add support for automatic solo through RulesetBuilder

* allow solo games with all modes in CLI
This commit is contained in:
Rob O'Dwyer 2022-06-08 15:45:20 -07:00 committed by GitHub
parent 426da8ac5e
commit 25dc404493
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 115 additions and 7 deletions

View file

@ -133,7 +133,11 @@ func (gameState *GameState) initialize() {
}
// Build ruleset from settings
ruleset := rules.NewRulesetBuilder().WithSeed(gameState.Seed).WithParams(gameState.settings).Ruleset()
ruleset := rules.NewRulesetBuilder().
WithSeed(gameState.Seed).
WithParams(gameState.settings).
WithSolo(len(gameState.URLs) < 2).
Ruleset()
gameState.ruleset = ruleset
// Initialize snake states as empty until we can ping the snake URLs