DEV 953: Add basic maps support to CLI (#74)
* remove squad support and switch to using pipelines only in RulesBuilder * remove spawn_food.standard from legacy ruleset definitions * bugfix: Royale map generates Standard food * add maps support to CLI * add automated tests for all registered GameMap implementations * update README
This commit is contained in:
parent
3bd1e47bb4
commit
1adbc79168
27 changed files with 565 additions and 1371 deletions
|
|
@ -2,7 +2,6 @@ package rules
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"math/rand"
|
||||
)
|
||||
|
||||
var royaleRulesetStages = []string{
|
||||
|
|
@ -10,7 +9,6 @@ var royaleRulesetStages = []string{
|
|||
StageStarvationStandard,
|
||||
StageHazardDamageStandard,
|
||||
StageFeedSnakesStandard,
|
||||
StageSpawnFoodStandard,
|
||||
StageEliminationStandard,
|
||||
StageSpawnHazardsShrinkMap,
|
||||
StageGameOverStandard,
|
||||
|
|
@ -19,8 +17,6 @@ var royaleRulesetStages = []string{
|
|||
type RoyaleRuleset struct {
|
||||
StandardRuleset
|
||||
|
||||
Seed int64
|
||||
|
||||
ShrinkEveryNTurns int
|
||||
}
|
||||
|
||||
|
|
@ -55,7 +51,7 @@ func PopulateHazardsRoyale(b *BoardState, settings Settings, moves []SnakeMove)
|
|||
return false, nil
|
||||
}
|
||||
|
||||
randGenerator := rand.New(rand.NewSource(settings.RoyaleSettings.seed))
|
||||
randGenerator := settings.GetRand(0)
|
||||
|
||||
numShrinks := turn / settings.RoyaleSettings.ShrinkEveryNTurns
|
||||
minX, maxX := 0, b.Width-1
|
||||
|
|
@ -91,7 +87,6 @@ func (r *RoyaleRuleset) IsGameOver(b *BoardState) (bool, error) {
|
|||
func (r RoyaleRuleset) Settings() Settings {
|
||||
s := r.StandardRuleset.Settings()
|
||||
s.RoyaleSettings = RoyaleSettings{
|
||||
seed: r.Seed,
|
||||
ShrinkEveryNTurns: r.ShrinkEveryNTurns,
|
||||
}
|
||||
return s
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue