本文整理汇总了C++中Loader::GetLong方法的典型用法代码示例。如果您正苦于以下问题:C++ Loader::GetLong方法的具体用法?C++ Loader::GetLong怎么用?C++ Loader::GetLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Loader
的用法示例。
在下文中一共展示了Loader::GetLong方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Load
/**
* Load guests from the save game.
* @param ldr Input stream to read.
*/
void Guests::Load(Loader &ldr)
{
uint32 version = ldr.OpenBlock("GSTS");
if (version == 1) {
this->start_voxel.x = ldr.GetWord();
this->start_voxel.y = ldr.GetWord();
this->daily_frac = ldr.GetWord();
this->next_daily_index = ldr.GetWord();
this->free_idx = ldr.GetLong();
uint active_guest_count = ldr.GetLong();
for (uint i = 0; i < active_guest_count; i++) {
Guest *g = this->block.Get(ldr.GetWord());
g->Load(ldr);
}
} else {
ldr.SetFailMessage("Incorrect version of Guests block.");
}
ldr.CloseBlock();
}
示例2: Load
/**
* Load a voxel from the save game.
* @param ldr Input stream to read.
* @param version Version to load.
*/
void Voxel::Load(Loader &ldr, uint32 version)
{
this->ClearVoxel();
if (version >= 1 && version <= 3) {
this->ground = ldr.GetLong(); /// \todo Check sanity of the data.
this->instance = ldr.GetByte();
if (this->instance == SRI_FREE) {
this->instance_data = 0; // Full rides load after the world, overwriting map data.
} else if (this->instance >= SRI_RIDES_START && this->instance < SRI_FULL_RIDES) {
this->instance_data = ldr.GetWord();
} else {
this->instance_data = 0; // Full rides load after the world, overwriting map data.
ldr.SetFailMessage("Unknown voxel instance data");
}
if (version >= 2) this->fences = ldr.GetWord();
} else {
ldr.SetFailMessage("Unknown voxel version");
}
}