当前位置: 首页>>代码示例>>C++>>正文


C++ SerializedGameData类代码示例

本文整理汇总了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);
}
开发者ID:kumzugloom,项目名称:s25client,代码行数:7,代码来源:TradeGraph.cpp

示例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);
}
开发者ID:kumzugloom,项目名称:s25client,代码行数:7,代码来源:TradeGraph.cpp

示例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());
    }
}
开发者ID:jonathan-reisdorf,项目名称:s25client,代码行数:31,代码来源:nobBaseWarehouse.cpp

示例4: Serialize_nofFlagWorker

void nofFlagWorker::Serialize_nofFlagWorker(SerializedGameData& sgd) const
{
    Serialize_noFigure(sgd);

    sgd.PushObject(flag, true);
    sgd.PushUnsignedChar(static_cast<unsigned char>(state));
}
开发者ID:Flow86,项目名称:s25client,代码行数:7,代码来源:nofFlagWorker.cpp

示例5:

void nobHarborBuilding::ExpeditionInfo::Serialize(SerializedGameData& sgd) const
{
    sgd.PushUnsignedInt(boards);
    sgd.PushUnsignedInt(stones);
    sgd.PushBool(active);
    sgd.PushBool(builder);
}
开发者ID:polemon,项目名称:s25client,代码行数:7,代码来源:nobHarborBuilding.cpp

示例6: Serialize_noFire

void noFire::Serialize_noFire(SerializedGameData& sgd) const
{
    Serialize_noCoordBase(sgd);

    sgd.PushBool(isBig);
    sgd.PushEvent(dead_event);
}
开发者ID:Return-To-The-Roots,项目名称:s25client,代码行数:7,代码来源:noFire.cpp

示例7: Serialize_noSign

void noSign::Serialize_noSign(SerializedGameData& sgd) const
{
    Serialize_noDisappearingEnvObject(sgd);

    sgd.PushUnsignedChar(type);
    sgd.PushUnsignedChar(quantity);
}
开发者ID:Ribosom,项目名称:s25client,代码行数:7,代码来源:noSign.cpp

示例8: Serialize_nofFisher

void nofFisher::Serialize_nofFisher(SerializedGameData& sgd) const
{
    Serialize_nofFarmhand(sgd);

    sgd.PushUnsignedChar(fishing_dir);
    sgd.PushBool(successful);
}
开发者ID:kumzugloom,项目名称:s25client,代码行数:7,代码来源:nofFisher.cpp

示例9: Serialize

void noShipBuildingSite::Serialize(SerializedGameData& sgd) const
{
    Serialize_noCoordBase(sgd);

    sgd.PushUnsignedChar(player);
    sgd.PushUnsignedChar(progress);
}
开发者ID:Flow86,项目名称:s25client,代码行数:7,代码来源:noShipBuildingSite.cpp

示例10: Serialize

void nofCharburner::Serialize(SerializedGameData& sgd) const
{
    Serialize_nofFarmhand(sgd);

    sgd.PushBool(harvest);
    sgd.PushUnsignedChar(static_cast<unsigned char>(wt));
}
开发者ID:vader1986,项目名称:s25client,代码行数:7,代码来源:nofCharburner.cpp

示例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);
}
开发者ID:jonathan-reisdorf,项目名称:s25client,代码行数:7,代码来源:FOWObjects.cpp

示例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));
}
开发者ID:Ribosom,项目名称:s25client,代码行数:8,代码来源:nofPlaner.cpp

示例13: Serialize_noStaticObject

void noStaticObject::Serialize_noStaticObject(SerializedGameData& sgd) const
{
    Serialize_noCoordBase(sgd);

    sgd.PushUnsignedShort(id);
    sgd.PushUnsignedShort(file);
    sgd.PushUnsignedChar(size);
}
开发者ID:vader1986,项目名称:s25client,代码行数:8,代码来源:noStaticObject.cpp

示例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())
{}
开发者ID:aidevn,项目名称:s25client,代码行数:8,代码来源:Ware.cpp

示例15: Serialize_nofWarehouseWorker

void nofWarehouseWorker::Serialize_nofWarehouseWorker(SerializedGameData& sgd) const
{
    Serialize_noFigure(sgd);

    sgd.PushObject(carried_ware, true);
    sgd.PushBool(shouldBringWareIn);
    sgd.PushBool(fat);
}
开发者ID:aidevn,项目名称:s25client,代码行数:8,代码来源:nofWarehouseWorker.cpp


注:本文中的SerializedGameData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。