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 String
getChunkFilename
(@NonNull Chunk chunk) getChunkPath
(@NonNull Chunk chunk) load
(com.simsilica.mathd.Vec3i location) Loads the chunk for the given chunk location.boolean
Saves the chunkboolean
-
Field Details
-
EXTENSION
- See Also:
-
-
Constructor Details
-
FileRepository
public FileRepository()
-
-
Method Details
-
load
Description copied from interface:ChunkRepository
Loads the chunk for the given chunk location.- Specified by:
load
in interfaceChunkRepository
- Parameters:
location
- of the chunk- Returns:
- chunk or null if the chunk could not be loaded
-
load
-
save
Description copied from interface:ChunkRepository
Saves the chunk- Specified by:
save
in interfaceChunkRepository
- Parameters:
chunk
- to save- Returns:
- true when successfully saved, false otherwise
-
save
-
getChunkPath
-
getChunkFilename
-