fix for rivers and bridges snake start positions (#85)
* fix for rivers and bridges snake start positions * update max player count, add unit test * set player count to 12 (max for smallest size) * fix: one of the 19x19 spawn points * randomize snake placement at start positions * randomly choose starts in quadrants * fix: check that start positions are valid * modify food placement to avoid hazards
This commit is contained in:
parent
f58df66e69
commit
9d6b1147cd
5 changed files with 298 additions and 25 deletions
|
|
@ -103,13 +103,13 @@ func TestRiversAndBridgetsHazardsMap(t *testing.T) {
|
|||
// check all the supported sizes
|
||||
for _, size := range []int{11, 19, 25} {
|
||||
state = rules.NewBoardState(size, size)
|
||||
state.Snakes = append(state.Snakes, rules.Snake{ID: "1", Body: []rules.Point{}})
|
||||
editor = maps.NewBoardStateEditor(state)
|
||||
require.Empty(t, state.Hazards)
|
||||
err = m.SetupBoard(state, settings, editor)
|
||||
require.NoError(t, err)
|
||||
require.NotEmpty(t, state.Hazards)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestSpiralHazardsMap(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue