DEV-1703: Avoid spawning food on hazards for islands and bridges map (#112)

* move PlaceFoodFixed and PlaceSnakesInQuadrants to maps package

* don't spawn food on hazards in islands/rivers and bridges maps
This commit is contained in:
Rob O'Dwyer 2022-09-22 16:09:01 -07:00 committed by GitHub
parent 35e5a53005
commit e6e36ce46f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 184 additions and 114 deletions

View file

@ -8,7 +8,7 @@ import (
"github.com/stretchr/testify/require"
)
func TestRiversAndBridgetsHazardsMap(t *testing.T) {
func TestRiversAndBridgesHazardsMap(t *testing.T) {
// check error handling
m := maps.RiverAndBridgesMediumHazardsMap{}
settings := rules.Settings{}
@ -40,5 +40,8 @@ func TestRiversAndBridgetsHazardsMap(t *testing.T) {
err = test.Map.SetupBoard(state, settings, editor)
require.NoError(t, err)
require.NotEmpty(t, state.Hazards)
require.Len(t, state.Food, 1)
food := state.Food[0]
require.NotContains(t, state.Hazards, food)
}
}