mapserver/mapobjectdb/accessor.go

31 lines
496 B
Go
Raw Normal View History

2019-01-18 15:51:10 +01:00
package mapobjectdb
2019-01-18 13:50:59 +01:00
import (
"mapserver/coords"
)
2019-01-18 15:51:10 +01:00
type MapObject struct {
2019-01-18 13:50:59 +01:00
//mapblock position
2019-01-18 15:10:46 +01:00
MBPos coords.MapBlockCoords
2019-01-18 15:18:42 +01:00
2019-01-18 13:50:59 +01:00
//block position
X, Y, Z int
2019-01-18 15:10:46 +01:00
2019-01-18 15:18:42 +01:00
Type string
Data string
Mtime int64
2019-01-18 13:50:59 +01:00
}
type SearchQuery struct {
//block position (not mapblock)
Pos1, Pos2 coords.MapBlockCoords
2019-01-18 15:10:46 +01:00
Type string
2019-01-18 13:50:59 +01:00
}
type DBAccessor interface {
Migrate() error
2019-01-18 15:51:10 +01:00
GetMapData(q SearchQuery) ([]MapObject, error)
2019-01-18 15:10:46 +01:00
RemoveMapData(pos coords.MapBlockCoords) error
2019-01-18 15:51:10 +01:00
AddMapData(data MapObject) error
2019-01-18 13:50:59 +01:00
}