spatial-db/storage/storage_server.go
2023-12-13 23:48:53 -08:00

27 lines
595 B
Go

package storage
import (
"errors"
"github.com/NickyBoy89/spatial-db/world"
)
type StorageServer interface {
// Individual operations
SetStorageRoot(path string)
// Block-level interactions
ChangeBlock(pos world.BlockPos, targetState world.BlockID) error
ReadBlockAt(pos world.BlockPos) (world.BlockID, error)
// Region-level interactions
ChangeBlockRange(targetState world.BlockID, start, end world.BlockPos) error
// Network-level operations
ReadChunkAt(pos world.ChunkPos) (world.ChunkData, error)
}
var (
ChunkNotFoundError = errors.New("chunk was not found in storage")
)