Pol  Revision:cb584c9
Pol::Plib::MapWriter Class Reference

#include <mapwriter.h>

Public Member Functions

 MapWriter ()
 
 ~MapWriter ()
 
void AppendSolid (const SOLIDS_ELEM &solid)
 
void AppendSolidx2Elem (const SOLIDX2_ELEM &elem)
 
void CreateBaseDat (const std::string &realm_name, const std::string &directory)
 
void CreateMaptileDat (const std::string &realm_name, const std::string &directory)
 
void CreateNewFiles (const std::string &realm_name, unsigned short width, unsigned short height)
 
void CreateSolidsDat (const std::string &realm_name, const std::string &directory)
 
void CreateSolidx1Dat (const std::string &realm_name, const std::string &directory)
 
void CreateSolidx2Dat (const std::string &realm_name, const std::string &directory)
 
void Flush ()
 
unsigned height () const
 
unsigned int NextSolidIndex ()
 
unsigned int NextSolidOffset ()
 
unsigned int NextSolidx2Offset ()
 
void OpenExistingFiles (const std::string &realm_name)
 
void SetMapCell (unsigned short x, unsigned short y, MAPCELL cell)
 
void SetMapTile (unsigned short x, unsigned short y, MAPTILE_CELL cell)
 
void SetSolidx2Offset (unsigned short x_base, unsigned short y_base, unsigned int offset)
 
unsigned width () const
 
void WriteConfigFile ()
 

Private Member Functions

void FlushBaseFile ()
 
void FlushMapTileFile ()
 
unsigned int total_blocks ()
 
unsigned int total_maptile_blocks ()
 
std::fstream::pos_type total_size ()
 
unsigned int total_solid_blocks ()
 

Private Attributes

MAPBLOCK _block
 
int _cur_mapblock_index
 
int _cur_maptile_index
 
unsigned short _height
 
MAPTILE_BLOCK _maptile_block
 
std::fstream _ofs_base
 
std::fstream _ofs_maptile
 
std::fstream _ofs_solids
 
std::fstream _ofs_solidx1
 
std::fstream _ofs_solidx2
 
std::string _realm_name
 
unsigned short _width
 
size_t solids_offset
 
size_t solidx2_offset
 

Detailed Description

Definition at line 25 of file mapwriter.h.

Constructor & Destructor Documentation

Pol::Plib::MapWriter::MapWriter ( )

Definition at line 27 of file mapwriter.cpp.

References _ofs_base, _ofs_maptile, _ofs_solids, _ofs_solidx1, and _ofs_solidx2.

Pol::Plib::MapWriter::~MapWriter ( )

Definition at line 189 of file mapwriter.cpp.

References Flush().

Member Function Documentation

void Pol::Plib::MapWriter::AppendSolid ( const SOLIDS_ELEM solid)

Definition at line 299 of file mapwriter.cpp.

References _ofs_solids, and solids_offset.

Referenced by Pol::UoConvert::ProcessSolidBlock().

void Pol::Plib::MapWriter::AppendSolidx2Elem ( const SOLIDX2_ELEM elem)

Definition at line 305 of file mapwriter.cpp.

References _ofs_solidx2, and solidx2_offset.

Referenced by Pol::UoConvert::ProcessSolidBlock().

void Pol::Plib::MapWriter::CreateBaseDat ( const std::string &  realm_name,
const std::string &  directory 
)
void Pol::Plib::MapWriter::CreateMaptileDat ( const std::string &  realm_name,
const std::string &  directory 
)
void Pol::Plib::MapWriter::CreateNewFiles ( const std::string &  realm_name,
unsigned short  width,
unsigned short  height 
)
void Pol::Plib::MapWriter::CreateSolidsDat ( const std::string &  realm_name,
const std::string &  directory 
)

Definition at line 103 of file mapwriter.cpp.

References _ofs_solids, Pol::Clib::binary(), Pol::Clib::open_file(), and solids_offset.

Referenced by CreateNewFiles().

void Pol::Plib::MapWriter::CreateSolidx1Dat ( const std::string &  realm_name,
const std::string &  directory 
)
void Pol::Plib::MapWriter::CreateSolidx2Dat ( const std::string &  realm_name,
const std::string &  directory 
)

Definition at line 95 of file mapwriter.cpp.

References _ofs_solidx2, Pol::Clib::binary(), Pol::Clib::open_file(), and solidx2_offset.

Referenced by CreateNewFiles().

void Pol::Plib::MapWriter::Flush ( )

Definition at line 194 of file mapwriter.cpp.

References FlushBaseFile(), and FlushMapTileFile().

Referenced by ~MapWriter().

void Pol::Plib::MapWriter::FlushBaseFile ( )
private

Definition at line 265 of file mapwriter.cpp.

References _block, _cur_mapblock_index, and _ofs_base.

Referenced by Flush(), height(), and SetMapCell().

void Pol::Plib::MapWriter::FlushMapTileFile ( )
private

Definition at line 274 of file mapwriter.cpp.

References _cur_maptile_index, _maptile_block, and _ofs_maptile.

Referenced by Flush(), height(), and SetMapTile().

unsigned Pol::Plib::MapWriter::height ( ) const
inline
unsigned int Pol::Plib::MapWriter::NextSolidIndex ( )

Definition at line 289 of file mapwriter.cpp.

References NextSolidOffset().

Referenced by Pol::UoConvert::ProcessSolidBlock().

unsigned int Pol::Plib::MapWriter::NextSolidOffset ( )

Definition at line 284 of file mapwriter.cpp.

References solids_offset.

Referenced by NextSolidIndex().

unsigned int Pol::Plib::MapWriter::NextSolidx2Offset ( )

Definition at line 294 of file mapwriter.cpp.

References solidx2_offset.

Referenced by Pol::UoConvert::ProcessSolidBlock().

void Pol::Plib::MapWriter::SetMapCell ( unsigned short  x,
unsigned short  y,
MAPCELL  cell 
)
void Pol::Plib::MapWriter::SetMapTile ( unsigned short  x,
unsigned short  y,
MAPTILE_CELL  cell 
)
void Pol::Plib::MapWriter::SetSolidx2Offset ( unsigned short  x_base,
unsigned short  y_base,
unsigned int  offset 
)

Definition at line 311 of file mapwriter.cpp.

References _ofs_solidx1, _width, SOLIDX_X_SIZE, and SOLIDX_Y_SIZE.

Referenced by Pol::UoConvert::ProcessSolidBlock().

unsigned int Pol::Plib::MapWriter::total_blocks ( )
private

Definition at line 204 of file mapwriter.cpp.

References _height, _width, and Pol::Plib::MAPBLOCK_CHUNK.

Referenced by CreateBaseDat(), height(), and total_size().

unsigned int Pol::Plib::MapWriter::total_maptile_blocks ( )
private

Definition at line 212 of file mapwriter.cpp.

References _height, _width, and Pol::Plib::MAPTILE_CHUNK.

Referenced by CreateMaptileDat(), and height().

std::fstream::pos_type Pol::Plib::MapWriter::total_size ( )
private

Definition at line 200 of file mapwriter.cpp.

References total_blocks().

Referenced by height().

unsigned int Pol::Plib::MapWriter::total_solid_blocks ( )
private

Definition at line 208 of file mapwriter.cpp.

References _height, _width, SOLIDX_X_SIZE, and SOLIDX_Y_SIZE.

Referenced by CreateSolidx1Dat(), and height().

unsigned Pol::Plib::MapWriter::width ( ) const
inline

Definition at line 55 of file mapwriter.h.

References _width.

Referenced by CreateNewFiles().

void Pol::Plib::MapWriter::WriteConfigFile ( )

Member Data Documentation

MAPBLOCK Pol::Plib::MapWriter::_block
private

Definition at line 74 of file mapwriter.h.

Referenced by FlushBaseFile(), and SetMapCell().

int Pol::Plib::MapWriter::_cur_mapblock_index
private

Definition at line 73 of file mapwriter.h.

Referenced by FlushBaseFile(), and SetMapCell().

int Pol::Plib::MapWriter::_cur_maptile_index
private

Definition at line 81 of file mapwriter.h.

Referenced by FlushMapTileFile(), and SetMapTile().

unsigned short Pol::Plib::MapWriter::_height
private
MAPTILE_BLOCK Pol::Plib::MapWriter::_maptile_block
private

Definition at line 82 of file mapwriter.h.

Referenced by FlushMapTileFile(), and SetMapTile().

std::fstream Pol::Plib::MapWriter::_ofs_base
private

Definition at line 72 of file mapwriter.h.

Referenced by CreateBaseDat(), FlushBaseFile(), MapWriter(), OpenExistingFiles(), and SetMapCell().

std::fstream Pol::Plib::MapWriter::_ofs_maptile
private
std::fstream Pol::Plib::MapWriter::_ofs_solids
private

Definition at line 78 of file mapwriter.h.

Referenced by AppendSolid(), CreateSolidsDat(), MapWriter(), and OpenExistingFiles().

std::fstream Pol::Plib::MapWriter::_ofs_solidx1
private

Definition at line 76 of file mapwriter.h.

Referenced by CreateSolidx1Dat(), MapWriter(), OpenExistingFiles(), and SetSolidx2Offset().

std::fstream Pol::Plib::MapWriter::_ofs_solidx2
private

Definition at line 77 of file mapwriter.h.

Referenced by AppendSolidx2Elem(), CreateSolidx2Dat(), MapWriter(), and OpenExistingFiles().

std::string Pol::Plib::MapWriter::_realm_name
private

Definition at line 69 of file mapwriter.h.

Referenced by CreateNewFiles(), OpenExistingFiles(), and WriteConfigFile().

unsigned short Pol::Plib::MapWriter::_width
private
size_t Pol::Plib::MapWriter::solids_offset
private

Definition at line 84 of file mapwriter.h.

Referenced by AppendSolid(), CreateSolidsDat(), NextSolidOffset(), and OpenExistingFiles().

size_t Pol::Plib::MapWriter::solidx2_offset
private

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