Adding default values for the Royale ruleset and game map (#119)
This commit is contained in:
parent
82e1999126
commit
0bc228ff34
2 changed files with 2 additions and 2 deletions
|
|
@ -46,7 +46,7 @@ func (m RoyaleHazardsMap) PostUpdateBoard(lastBoardState *rules.BoardState, sett
|
||||||
// Royale uses the current turn to generate hazards, not the previous turn that's in the board state
|
// Royale uses the current turn to generate hazards, not the previous turn that's in the board state
|
||||||
turn := lastBoardState.Turn + 1
|
turn := lastBoardState.Turn + 1
|
||||||
|
|
||||||
shrinkEveryNTurns := settings.Int(rules.ParamShrinkEveryNTurns, 0)
|
shrinkEveryNTurns := settings.Int(rules.ParamShrinkEveryNTurns, 20)
|
||||||
if shrinkEveryNTurns < 1 {
|
if shrinkEveryNTurns < 1 {
|
||||||
return errors.New("royale game can't shrink more frequently than every turn")
|
return errors.New("royale game can't shrink more frequently than every turn")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ func PopulateHazardsRoyale(b *BoardState, settings Settings, moves []SnakeMove)
|
||||||
// Royale uses the current turn to generate hazards, not the previous turn that's in the board state
|
// Royale uses the current turn to generate hazards, not the previous turn that's in the board state
|
||||||
turn := b.Turn + 1
|
turn := b.Turn + 1
|
||||||
|
|
||||||
shrinkEveryNTurns := settings.Int(ParamShrinkEveryNTurns, 0)
|
shrinkEveryNTurns := settings.Int(ParamShrinkEveryNTurns, 20)
|
||||||
if shrinkEveryNTurns < 1 {
|
if shrinkEveryNTurns < 1 {
|
||||||
return false, errors.New("royale game can't shrink more frequently than every turn")
|
return false, errors.New("royale game can't shrink more frequently than every turn")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue