rove/pkg/atlas/atlas.go

36 lines
783 B
Go
Raw Normal View History

package atlas
import (
"github.com/mdiluz/rove/pkg/objects"
"github.com/mdiluz/rove/pkg/vector"
)
// Tile describes the type of terrain
type Tile byte
const (
// TileNone is a keyword for nothing
TileNone = Tile(0)
// TileRock is solid rock ground
2020-07-08 23:45:52 +01:00
TileRock = Tile('-')
// TileGravel is loose rocks
TileGravel = Tile(':')
// TileSand is sand
2020-07-08 23:45:52 +01:00
TileSand = Tile('~')
)
2020-07-10 16:52:00 +01:00
// 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
SetTile(v vector.Vector, tile Tile)
// SetObject will set a location on the Atlas to contain an object
SetObject(v vector.Vector, obj objects.Object)
// QueryPosition queries a position on the atlas
QueryPosition(v vector.Vector) (byte, objects.Object)
}