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:
parent
35e5a53005
commit
e6e36ce46f
5 changed files with 184 additions and 114 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue