-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathconstants.go
62 lines (53 loc) · 2.07 KB
/
constants.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package rules
type RulesetError string
func (err RulesetError) Error() string { return string(err) }
const (
MoveUp = "up"
MoveDown = "down"
MoveRight = "right"
MoveLeft = "left"
BoardSizeSmall = 7
BoardSizeMedium = 11
BoardSizeLarge = 19
BoardSizeXLarge = 21
BoardSizeXXLarge = 25
SnakeMaxHealth = 100
SnakeStartSize = 3
// Snake state constants
NotEliminated = ""
EliminatedByCollision = "snake-collision"
EliminatedBySelfCollision = "snake-self-collision"
EliminatedByOutOfHealth = "out-of-health"
EliminatedByHeadToHeadCollision = "head-collision"
EliminatedByOutOfBounds = "wall-collision"
EliminatedByHazard = "hazard"
// Error constants
ErrorTooManySnakes = RulesetError("too many snakes for fixed start positions")
ErrorNoRoomForSnake = RulesetError("not enough space to place snake")
ErrorNoRoomForFood = RulesetError("not enough space to place food")
ErrorNoMoveFound = RulesetError("move not provided for snake")
ErrorZeroLengthSnake = RulesetError("snake is length zero")
ErrorEmptyRegistry = RulesetError("empty registry")
ErrorNoStages = RulesetError("no stages")
ErrorStageNotFound = RulesetError("stage not found")
ErrorMapNotFound = RulesetError("map not found")
// Ruleset / game type names
GameTypeConstrictor = "constrictor"
GameTypeRoyale = "royale"
GameTypeSolo = "solo"
GameTypeStandard = "standard"
GameTypeWrapped = "wrapped"
GameTypeWrappedConstrictor = "wrapped_constrictor"
// Game creation parameter names
ParamGameType = "name"
ParamFoodSpawnChance = "foodSpawnChance"
ParamMinimumFood = "minimumFood"
ParamHazardDamagePerTurn = "damagePerTurn"
ParamHazardMap = "hazardMap"
ParamHazardMapAuthor = "hazardMapAuthor"
ParamShrinkEveryNTurns = "shrinkEveryNTurns"
ParamAllowBodyCollisions = "allowBodyCollisions"
ParamSharedElimination = "sharedElimination"
ParamSharedHealth = "sharedHealth"
ParamSharedLength = "sharedLength"
)