Convert objects and tiles to base ints

This commit is contained in:
Marc Di Luzio 2020-07-19 11:54:11 +01:00
parent acdd019093
commit f665436007
3 changed files with 9 additions and 9 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 = Tile(GlyphNone) TileNone = iota
// TileRock is solid rock ground // TileRock is solid rock ground
TileRock = Tile(GlyphRock) TileRock
// TileGravel is loose rocks // TileGravel is loose rocks
TileGravel = Tile(GlyphGravel) TileGravel
// TileSand is sand // TileSand is sand
TileSand = Tile(GlyphSand) TileSand
) )
// Glyph returns the glyph for this tile type // Glyph returns the glyph for this tile type

View file

@ -128,7 +128,7 @@ func (a *chunkBasedAtlas) populate(chunk int) {
obj = ObjectSmallRock obj = ObjectSmallRock
} }
if obj != ObjectNone { if obj != ObjectNone {
c.Objects[j*a.ChunkSize+i] = Object{Type: obj} c.Objects[j*a.ChunkSize+i] = Object{Type: ObjectType(obj)}
} }
} }
} }

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 = ObjectType(GlyphNone) ObjectNone = iota
// ObjectRover represents a live rover // ObjectRover represents a live rover
ObjectRover = ObjectType(GlyphRover) ObjectRover
// ObjectSmallRock is a small stashable rock // ObjectSmallRock is a small stashable rock
ObjectSmallRock = ObjectType(GlyphSmallRock) ObjectSmallRock
// ObjectLargeRock is a large blocking rock // ObjectLargeRock is a large blocking rock
ObjectLargeRock = ObjectType(GlyphLargeRock) ObjectLargeRock
) )
// Glyph returns the glyph for this object type // Glyph returns the glyph for this object type