DEV 1303: Add empty and royale maps and update game map interface (#72)

* move random generator into Settings

* add empty and royale maps

* place snakes on either cardinal or corner positions first
This commit is contained in:
Rob O'Dwyer 2022-05-17 15:45:56 -07:00 committed by GitHub
parent 6fa2da2f01
commit e94d758a9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 479 additions and 52 deletions

View file

@ -13,7 +13,7 @@ func SetupBoard(mapID string, settings rules.Settings, width, height int, snakeI
return nil, err
}
editor := NewBoardStateEditor(boardState, settings.Rand())
editor := NewBoardStateEditor(boardState)
err = gameMap.SetupBoard(boardState, settings, editor)
if err != nil {
@ -31,7 +31,7 @@ func UpdateBoard(mapID string, previousBoardState *rules.BoardState, settings ru
}
nextBoardState := previousBoardState.Clone()
editor := NewBoardStateEditor(nextBoardState, settings.Rand())
editor := NewBoardStateEditor(nextBoardState)
err = gameMap.UpdateBoard(previousBoardState, settings, editor)
if err != nil {