diff --git a/pkg/atlas/atlas.go b/pkg/atlas/atlas.go index 1a2f3fb..73ea341 100644 --- a/pkg/atlas/atlas.go +++ b/pkg/atlas/atlas.go @@ -9,16 +9,16 @@ type Tile byte const ( // TileNone is a keyword for nothing - TileNone = Tile(0) + TileNone = Tile(GlyphNone) // TileRock is solid rock ground - TileRock = Tile('-') + TileRock = Tile(GlyphRock) // TileGravel is loose rocks - TileGravel = Tile(':') + TileGravel = Tile(GlyphGravel) // TileSand is sand - TileSand = Tile('~') + TileSand = Tile(GlyphSand) ) // Atlas represents a 2D world atlas of tiles and objects diff --git a/pkg/atlas/glyph.go b/pkg/atlas/glyph.go new file mode 100644 index 0000000..c39f1be --- /dev/null +++ b/pkg/atlas/glyph.go @@ -0,0 +1,27 @@ +package atlas + +// Glyph represents the text representation of something in the game +type Glyph byte + +const ( + // GlyphNone is a keyword for nothing + GlyphNone = Glyph(0) + + // GlyphRock is solid rock ground + GlyphRock = Glyph('-') + + // GlyphGravel is loose rocks + GlyphGravel = Glyph(':') + + // GlyphSand is sand + GlyphSand = Glyph('~') + + // GlyphRover represents a live rover + GlyphRover = Glyph('R') + + // GlyphSmallRock is a small stashable rock + GlyphSmallRock = Glyph('o') + + // GlyphLargeRock is a large blocking rock + GlyphLargeRock = Glyph('O') +) diff --git a/pkg/atlas/objects.go b/pkg/atlas/objects.go index 68b4ef8..c397ec1 100644 --- a/pkg/atlas/objects.go +++ b/pkg/atlas/objects.go @@ -6,13 +6,13 @@ type Type byte // Types of objects const ( // ObjectNone represents no object at all - ObjectNone = Type(0) + ObjectNone = Type(GlyphNone) // ObjectRover represents a live rover - ObjectRover = Type('R') + ObjectRover = Type(GlyphRover) // ObjectSmallRock is a small stashable rock - ObjectSmallRock = Type('o') + ObjectSmallRock = Type(GlyphSmallRock) // ObjectLargeRock is a large blocking rock ObjectLargeRock = Type('O')