* Convert errors to constant error interfaces.
This commit is contained in:
parent
f0f2ff5961
commit
2cbf8884bf
3 changed files with 38 additions and 26 deletions
|
|
@ -37,3 +37,7 @@ type Ruleset interface {
|
|||
CreateNextBoardState(prevState *BoardState, moves []SnakeMove) (*BoardState, error)
|
||||
IsGameOver(state *BoardState) (bool, error)
|
||||
}
|
||||
|
||||
type RulesetError string
|
||||
|
||||
func (err RulesetError) Error() string { return string(err) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue