Move glyph functions out to the glyph file

This commit is contained in:
Marc Di Luzio 2020-07-19 12:34:54 +01:00
parent 7bdfa44fb6
commit 4a89cb9d6e
3 changed files with 36 additions and 34 deletions

View file

@ -1,27 +1,10 @@
package atlas
import (
"log"
"github.com/mdiluz/rove/pkg/maths"
"github.com/mdiluz/rove/proto/roveapi"
)
// TileGlyph returns the glyph for this tile type
func TileGlyph(t roveapi.Tile) Glyph {
switch t {
case roveapi.Tile_Rock:
return GlyphGroundRock
case roveapi.Tile_Gravel:
return GlyphGroundGravel
case roveapi.Tile_Sand:
return GlyphGroundSand
}
log.Fatalf("Unknown tile type: %c", t)
return 0
}
// Atlas represents a 2D world atlas of tiles and objects
type Atlas interface {
// SetTile sets a location on the Atlas to a type of tile