Convert tiles and object types to typed consts

This commit is contained in:
Marc Di Luzio 2020-07-19 11:59:14 +01:00
parent 7e41ac0028
commit 24d4fe9273
2 changed files with 8 additions and 8 deletions

View file

@ -11,16 +11,16 @@ type Tile byte
const ( const (
// TileNone is a keyword for nothing // TileNone is a keyword for nothing
TileNone = iota TileNone = Tile(0)
// TileRock is solid rock ground // TileRock is solid rock ground
TileRock TileRock = Tile(1)
// TileGravel is loose rocks // TileGravel is loose rocks
TileGravel TileGravel = Tile(2)
// TileSand is sand // TileSand is sand
TileSand TileSand = Tile(3)
) )
// Glyph returns the glyph for this tile type // Glyph returns the glyph for this tile type

View file

@ -8,16 +8,16 @@ type ObjectType byte
// Types of objects // Types of objects
const ( const (
// ObjectNone represents no object at all // ObjectNone represents no object at all
ObjectNone = iota ObjectNone = ObjectType(0)
// ObjectRover represents a live rover // ObjectRover represents a live rover
ObjectRoverLive ObjectRoverLive = ObjectType(1)
// ObjectSmallRock is a small stashable rock // ObjectSmallRock is a small stashable rock
ObjectRockSmall ObjectRockSmall = ObjectType(2)
// ObjectLargeRock is a large blocking rock // ObjectLargeRock is a large blocking rock
ObjectRockLarge ObjectRockLarge = ObjectType(3)
) )
// Glyph returns the glyph for this object type // Glyph returns the glyph for this object type