Package com.rvandoosselaer.blocks
Class FileRepository
java.lang.Object
com.rvandoosselaer.blocks.FileRepository
- All Implemented Interfaces:
ChunkRepository
A File repository implementation for loading and storing chunks using the Protocol Buffers method.
Each chunk is stored in a separate file.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetChunkFilename(@NonNull Chunk chunk) getChunkPath(@NonNull Chunk chunk) load(com.simsilica.mathd.Vec3i location) Loads the chunk for the given chunk location.booleanSaves the chunkboolean
-
Field Details
-
EXTENSION
- See Also:
-
-
Constructor Details
-
FileRepository
public FileRepository()
-
-
Method Details
-
load
Description copied from interface:ChunkRepositoryLoads the chunk for the given chunk location.- Specified by:
loadin interfaceChunkRepository- Parameters:
location- of the chunk- Returns:
- chunk or null if the chunk could not be loaded
-
load
-
save
Description copied from interface:ChunkRepositorySaves the chunk- Specified by:
savein interfaceChunkRepository- Parameters:
chunk- to save- Returns:
- true when successfully saved, false otherwise
-
save
-
getChunkPath
-
getChunkFilename
-