Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
cWSSAnvil::cMCAFile Class Reference

#include <WSSAnvil.h>

Collaboration diagram for cWSSAnvil::cMCAFile:
Collaboration graph
[legend]

Public Member Functions

 cMCAFile (cWSSAnvil &a_ParentSchema, const AString &a_FileName, int a_RegionX, int a_RegionZ)
 
bool GetChunkData (const cChunkCoords &a_Chunk, ContiguousByteBuffer &a_Data)
 
const AStringGetFileName () const
 
int GetRegionX () const
 
int GetRegionZ () const
 
bool SetChunkData (const cChunkCoords &a_Chunk, ContiguousByteBufferView a_Data)
 

Protected Member Functions

unsigned FindFreeLocation (int a_LocalX, int a_LocalZ, size_t a_DataSize)
 Finds a free location large enough to hold a_Data. More...
 
bool OpenFile (bool a_IsForReading)
 Opens a MCA file either for a Read operation (fails if doesn't exist) or for a Write operation (creates new if not found) More...
 

Protected Attributes

cFile m_File
 
AString m_FileName
 
unsigned m_Header [MCA_MAX_CHUNKS]
 
cWSSAnvilm_ParentSchema
 
int m_RegionX
 
int m_RegionZ
 
unsigned m_TimeStamps [MCA_MAX_CHUNKS]
 

Detailed Description

Definition at line 51 of file WSSAnvil.h.

Constructor & Destructor Documentation

◆ cMCAFile()

cWSSAnvil::cMCAFile::cMCAFile ( cWSSAnvil a_ParentSchema,
const AString a_FileName,
int  a_RegionX,
int  a_RegionZ 
)

Definition at line 3878 of file WSSAnvil.cpp.

Member Function Documentation

◆ FindFreeLocation()

unsigned cWSSAnvil::cMCAFile::FindFreeLocation ( int  a_LocalX,
int  a_LocalZ,
size_t  a_DataSize 
)
protected

Finds a free location large enough to hold a_Data.

Returns the sector number.

Definition at line 4123 of file WSSAnvil.cpp.

◆ GetChunkData()

bool cWSSAnvil::cMCAFile::GetChunkData ( const cChunkCoords a_Chunk,
ContiguousByteBuffer a_Data 
)

Definition at line 3953 of file WSSAnvil.cpp.

◆ GetFileName()

const AString& cWSSAnvil::cMCAFile::GetFileName ( ) const
inline

Definition at line 62 of file WSSAnvil.h.

◆ GetRegionX()

int cWSSAnvil::cMCAFile::GetRegionX ( ) const
inline

Definition at line 60 of file WSSAnvil.h.

◆ GetRegionZ()

int cWSSAnvil::cMCAFile::GetRegionZ ( ) const
inline

Definition at line 61 of file WSSAnvil.h.

◆ OpenFile()

bool cWSSAnvil::cMCAFile::OpenFile ( bool  a_IsForReading)
protected

Opens a MCA file either for a Read operation (fails if doesn't exist) or for a Write operation (creates new if not found)

Definition at line 3890 of file WSSAnvil.cpp.

◆ SetChunkData()

bool cWSSAnvil::cMCAFile::SetChunkData ( const cChunkCoords a_Chunk,
ContiguousByteBufferView  a_Data 
)

Definition at line 4035 of file WSSAnvil.cpp.

Member Data Documentation

◆ m_File

cFile cWSSAnvil::cMCAFile::m_File
protected

Definition at line 70 of file WSSAnvil.h.

◆ m_FileName

AString cWSSAnvil::cMCAFile::m_FileName
protected

Definition at line 71 of file WSSAnvil.h.

◆ m_Header

unsigned cWSSAnvil::cMCAFile::m_Header[MCA_MAX_CHUNKS]
protected

Definition at line 75 of file WSSAnvil.h.

◆ m_ParentSchema

cWSSAnvil& cWSSAnvil::cMCAFile::m_ParentSchema
protected

Definition at line 66 of file WSSAnvil.h.

◆ m_RegionX

int cWSSAnvil::cMCAFile::m_RegionX
protected

Definition at line 68 of file WSSAnvil.h.

◆ m_RegionZ

int cWSSAnvil::cMCAFile::m_RegionZ
protected

Definition at line 69 of file WSSAnvil.h.

◆ m_TimeStamps

unsigned cWSSAnvil::cMCAFile::m_TimeStamps[MCA_MAX_CHUNKS]
protected

Definition at line 78 of file WSSAnvil.h.


The documentation for this class was generated from the following files: