package ru.dbotthepony.kstarbound.server.world

import ru.dbotthepony.kommons.arrays.Object2DArray
import ru.dbotthepony.kommons.io.ByteKey
import ru.dbotthepony.kommons.util.KOptional
import ru.dbotthepony.kstarbound.world.ChunkPos
import ru.dbotthepony.kstarbound.world.ChunkState
import ru.dbotthepony.kstarbound.world.api.AbstractCell
import ru.dbotthepony.kstarbound.world.entities.AbstractEntity
import java.io.Closeable
import java.util.concurrent.CompletableFuture

class NativeWorldStorage(private val engine: StorageEngine) : WorldStorage() {
	override fun loadCells(pos: ChunkPos): CompletableFuture<KOptional<Pair<Object2DArray<out AbstractCell>, ChunkState>>> {
		TODO("Not yet implemented")
	}

	override fun loadEntities(pos: ChunkPos): CompletableFuture<KOptional<Collection<AbstractEntity>>> {
		TODO("Not yet implemented")
	}

	override fun loadMetadata(): CompletableFuture<KOptional<Metadata>> {
		TODO("Not yet implemented")
	}

	override fun saveEntities(pos: ChunkPos, data: Collection<AbstractEntity>): Boolean {
		return super.saveEntities(pos, data)
	}

	override fun saveCells(pos: ChunkPos, data: Object2DArray<out AbstractCell>, state: ChunkState): Boolean {
		return super.saveCells(pos, data, state)
	}

	override fun saveMetadata(data: Metadata): Boolean {
		return super.saveMetadata(data)
	}

	override fun close() {
		engine.close()
	}
}
