diff --git a/ruleset.go b/ruleset.go index 052f127..ccba1b5 100644 --- a/ruleset.go +++ b/ruleset.go @@ -35,5 +35,5 @@ type SnakeMove struct { type Ruleset interface { CreateInitialBoardState(width int32, height int32, snakeIDs []string) (*BoardState, error) CreateNextBoardState(prevState *BoardState, moves []SnakeMove) (*BoardState, error) - IsGameFinished(state *BoardState) (bool, error) + IsGameOver(state *BoardState) (bool, error) } diff --git a/solo_test.go b/solo_test.go index 8e4b636..cbb3ef9 100644 --- a/solo_test.go +++ b/solo_test.go @@ -6,6 +6,10 @@ import ( "github.com/stretchr/testify/require" ) +func TestSoloRulesetInterface(t *testing.T) { + var _ Ruleset = (*SoloRuleset)(nil) +} + func TestSoloCreateNextBoardStateSanity(t *testing.T) { boardState := &BoardState{} r := SoloRuleset{} diff --git a/standard_test.go b/standard_test.go index 94d69bd..ff902c4 100644 --- a/standard_test.go +++ b/standard_test.go @@ -9,6 +9,10 @@ import ( "github.com/stretchr/testify/require" ) +func TestStandardRulesetInterface(t *testing.T) { + var _ Ruleset = (*StandardRuleset)(nil) +} + func TestSanity(t *testing.T) { r := StandardRuleset{} diff --git a/team_test.go b/team_test.go index 473417c..101fa83 100644 --- a/team_test.go +++ b/team_test.go @@ -6,6 +6,10 @@ import ( "github.com/stretchr/testify/require" ) +func TestTeamRulesetInterface(t *testing.T) { + var _ Ruleset = (*TeamRuleset)(nil) +} + func TestCreateNextBoardStateSanity(t *testing.T) { boardState := &BoardState{} r := TeamRuleset{}