本文整理汇总了C++中SerializedGameData类的典型用法代码示例。如果您正苦于以下问题:C++ SerializedGameData类的具体用法?C++ SerializedGameData怎么用?C++ SerializedGameData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SerializedGameData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Serialize
void TradeGraph::Serialize(SerializedGameData& sgd) const
{
sgd.PushUnsignedChar(player);
sgd.PushMapPoint(size);
for(unsigned i = 0; i < trade_graph.size(); ++i)
trade_graph[i].Serialize(sgd);
}
示例2: gwg
TradeGraph::TradeGraph(SerializedGameData& sgd, const GameWorldGame* const gwg) :
gwg(gwg), player(sgd.PopUnsignedChar()), size(sgd.PopMapPoint()),
trade_graph(size.x* size.y)
{
for(unsigned i = 0; i < trade_graph.size(); ++i)
trade_graph[i].Deserialize(sgd);
}
示例3: nobBaseMilitary
nobBaseWarehouse::nobBaseWarehouse(SerializedGameData& sgd, const unsigned obj_id) : nobBaseMilitary(sgd, obj_id)
{
sgd.PopObjectContainer(waiting_wares, GOT_WARE);
fetch_double_protection = sgd.PopBool();
sgd.PopObjectContainer(dependent_figures, GOT_UNKNOWN);
sgd.PopObjectContainer(dependent_wares, GOT_WARE);
producinghelpers_event = sgd.PopObject<EventManager::Event>(GOT_EVENT);
recruiting_event = sgd.PopObject<EventManager::Event>(GOT_EVENT);
empty_event = sgd.PopObject<EventManager::Event>(GOT_EVENT);
store_event = sgd.PopObject<EventManager::Event>(GOT_EVENT);
for(unsigned i = 0; i < 5; ++i)
{
reserve_soldiers_available[i] = sgd.PopUnsignedInt();
reserve_soldiers_claimed_visual[i] = reserve_soldiers_claimed_real[i] = sgd.PopUnsignedInt();
}
for(unsigned i = 0; i < WARE_TYPES_COUNT; ++i)
{
inventory.visual.goods[i] = sgd.PopUnsignedInt();
inventory.real.goods[i] = sgd.PopUnsignedInt();
inventorySettings.wares[i] = inventorySettingsVisual.wares[i] = static_cast<InventorySetting>(sgd.PopUnsignedChar());
}
for(unsigned i = 0; i < JOB_TYPES_COUNT; ++i)
{
inventory.visual.people[i] = sgd.PopUnsignedInt();
inventory.real.people[i] = sgd.PopUnsignedInt();
inventorySettings.figures[i] = inventorySettingsVisual.figures[i] = static_cast<InventorySetting>(sgd.PopUnsignedChar());
}
}
示例4: Serialize_nofFlagWorker
void nofFlagWorker::Serialize_nofFlagWorker(SerializedGameData& sgd) const
{
Serialize_noFigure(sgd);
sgd.PushObject(flag, true);
sgd.PushUnsignedChar(static_cast<unsigned char>(state));
}
示例5:
void nobHarborBuilding::ExpeditionInfo::Serialize(SerializedGameData& sgd) const
{
sgd.PushUnsignedInt(boards);
sgd.PushUnsignedInt(stones);
sgd.PushBool(active);
sgd.PushBool(builder);
}
示例6: Serialize_noFire
void noFire::Serialize_noFire(SerializedGameData& sgd) const
{
Serialize_noCoordBase(sgd);
sgd.PushBool(isBig);
sgd.PushEvent(dead_event);
}
示例7: Serialize_noSign
void noSign::Serialize_noSign(SerializedGameData& sgd) const
{
Serialize_noDisappearingEnvObject(sgd);
sgd.PushUnsignedChar(type);
sgd.PushUnsignedChar(quantity);
}
示例8: Serialize_nofFisher
void nofFisher::Serialize_nofFisher(SerializedGameData& sgd) const
{
Serialize_nofFarmhand(sgd);
sgd.PushUnsignedChar(fishing_dir);
sgd.PushBool(successful);
}
示例9: Serialize
void noShipBuildingSite::Serialize(SerializedGameData& sgd) const
{
Serialize_noCoordBase(sgd);
sgd.PushUnsignedChar(player);
sgd.PushUnsignedChar(progress);
}
示例10: Serialize
void nofCharburner::Serialize(SerializedGameData& sgd) const
{
Serialize_nofFarmhand(sgd);
sgd.PushBool(harvest);
sgd.PushUnsignedChar(static_cast<unsigned char>(wt));
}
示例11: Serialize
void fowBuildingSite::Serialize(SerializedGameData& sgd) const
{
sgd.PushBool(planing);
sgd.PushUnsignedChar(static_cast<unsigned char>(type));
sgd.PushUnsignedChar(static_cast<unsigned char>(nation));
sgd.PushUnsignedChar(build_progress);
}
示例12: Serialize_nofPlaner
void nofPlaner::Serialize_nofPlaner(SerializedGameData& sgd) const
{
Serialize_noFigure(sgd);
sgd.PushUnsignedChar(static_cast<unsigned char>(state));
sgd.PushObject(building_site, true);
sgd.PushUnsignedChar(static_cast<unsigned char>(pd));
}
示例13: Serialize_noStaticObject
void noStaticObject::Serialize_noStaticObject(SerializedGameData& sgd) const
{
Serialize_noCoordBase(sgd);
sgd.PushUnsignedShort(id);
sgd.PushUnsignedShort(file);
sgd.PushUnsignedChar(size);
}
示例14: GameObject
Ware::Ware(SerializedGameData& sgd, const unsigned obj_id) : GameObject(sgd, obj_id),
next_dir(sgd.PopUnsignedChar()),
state(State(sgd.PopUnsignedChar())),
location(sgd.PopObject<noRoadNode>(GOT_UNKNOWN)),
type(GoodType(sgd.PopUnsignedChar())),
goal(sgd.PopObject<noBaseBuilding>(GOT_UNKNOWN)),
next_harbor(sgd.PopMapPoint())
{}
示例15: Serialize_nofWarehouseWorker
void nofWarehouseWorker::Serialize_nofWarehouseWorker(SerializedGameData& sgd) const
{
Serialize_noFigure(sgd);
sgd.PushObject(carried_ware, true);
sgd.PushBool(shouldBringWareIn);
sgd.PushBool(fat);
}