Rename models.go to ruleset.go

This commit is contained in:
Brad Van Vugt 2020-01-01 17:22:16 -08:00 committed by GitHub
parent 11e5735109
commit d477201b1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,37 +0,0 @@
package rulesets
const (
MOVE_UP = "up"
MOVE_DOWN = "down"
MOVE_RIGHT = "right"
MOVE_LEFT = "left"
)
type Point struct {
X int32
Y int32
}
type Snake struct {
ID string
Body []*Point
Health int32
EliminatedCause string
}
type BoardState struct {
Height int32
Width int32
Food []*Point
Snakes []*Snake
}
type SnakeMove struct {
Snake *Snake
Move string
}
type Ruleset interface {
CreateInitialBoardState(width int32, height int32, snakeIDs []string) (*BoardState, error)
ResolveMoves(prevState *BoardState, moves []*SnakeMove) (*BoardState, error)
}