Add player and board size meta data to all game maps (#84)

* WIP: initial data model for new meta props
* WIP: implemented new props
* test and bug fix:
- add coverage of players and sizes
- fix unlimited map size bug
* FIX: update supported players for arcade to 6
* fix: test should be min -> max, not max->max
* Change some naming and the FixedSizes function
* update comment to reflect API changes
* improve comment clarity
* rename field for improved clarity
* change some more "map" -> "board" wording
This commit is contained in:
Torben 2022-06-19 20:09:17 -07:00 committed by GitHub
parent cb014e7b37
commit 3180429688
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 146 additions and 5 deletions

View file

@ -62,3 +62,18 @@ func TestBoardStateEditor(t *testing.T) {
editor.ClearHazards()
require.Equal(t, []rules.Point{}, boardState.Hazards)
}
func TestMapSizes(t *testing.T) {
s := FixedSizes(Dimensions{11, 12})
require.Equal(t, s[0].Width, uint(11))
require.Equal(t, s[0].Height, uint(12))
s = FixedSizes(Dimensions{11, 11}, Dimensions{19, 25})
require.Len(t, s, 2)
require.Equal(t, s[1].Width, uint(19))
require.Equal(t, s[1].Height, uint(25))
s = AnySize()
require.Len(t, s, 1, "unlimited maps should have just one dimensions")
require.True(t, s.IsUnlimited())
}