DEV 1247: Add a new map generator interface (#71)

* reorganize code

* first draft of map generator interfaces

* add explicit random interface to board helpers

* implement standard map

* rename Generator to GameMap

* allow initializing snakes separately from placing them

* add random number generator to Settings

* updates to GameMap interface

* add helpers for creating and updating BoardState with maps
This commit is contained in:
Rob O'Dwyer 2022-05-11 08:26:28 -07:00 committed by GitHub
parent 1c3f434841
commit dab9178a55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 916 additions and 160 deletions

View file

@ -231,7 +231,7 @@ func initializeBoardFromArgs(ruleset rules.Ruleset, snakeStates map[string]Snake
for _, snakeState := range snakeStates {
snakeIds = append(snakeIds, snakeState.ID)
}
state, err := rules.CreateDefaultBoardState(Width, Height, snakeIds)
state, err := rules.CreateDefaultBoardState(rules.GlobalRand, Width, Height, snakeIds)
if err != nil {
log.Panic("[PANIC]: Error Initializing Board State")
}