Add new constants for standard ruleset errors, resolves #5 (#24)

* Convert errors to constant error interfaces.
This commit is contained in:
md-hexdrive 2020-12-11 12:50:52 -05:00 committed by GitHub
parent f0f2ff5961
commit 2cbf8884bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 26 deletions

View file

@ -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) }