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


C++ SerializedGameData::PopMapPoint方法代码示例

本文整理汇总了C++中SerializedGameData::PopMapPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ SerializedGameData::PopMapPoint方法的具体用法?C++ SerializedGameData::PopMapPoint怎么用?C++ SerializedGameData::PopMapPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SerializedGameData的用法示例。


在下文中一共展示了SerializedGameData::PopMapPoint方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: nofActiveSoldier

nofAttacker::nofAttacker(SerializedGameData& sgd, const unsigned obj_id) : nofActiveSoldier(sgd, obj_id)
{
    if(state != STATE_WALKINGHOME && state != STATE_FIGUREWORK)
    {
        attacked_goal = sgd.PopObject<nobBaseMilitary>(GOT_UNKNOWN);
        mayBeHunted = sgd.PopBool();
        sgd.PopContainer(canPlayerSendAggDefender);
        RTTR_Assert(canPlayerSendAggDefender.size() == gwg->GetNumPlayers());
        huntingDefender = sgd.PopObject<nofAggressiveDefender>(GOT_NOF_AGGRESSIVEDEFENDER);

        radius = sgd.PopUnsignedShort();

        if(state == STATE_ATTACKING_WAITINGFORDEFENDER)
            blocking_event = sgd.PopEvent();
        else
            blocking_event = nullptr;

        harborPos = sgd.PopMapPoint();
        shipPos = sgd.PopMapPoint();
        ship_obj_id = sgd.PopUnsignedInt();
    } else
    {
        attacked_goal = nullptr;
        mayBeHunted = false;
        canPlayerSendAggDefender.resize(gwg->GetNumPlayers(), 2);
        huntingDefender = nullptr;
        radius = 0;
        blocking_event = nullptr;
        harborPos = MapPoint::Invalid();
        shipPos = MapPoint::Invalid(); //-V656
        ship_obj_id = 0;
    }
}
开发者ID:Return-To-The-Roots,项目名称:s25client,代码行数:33,代码来源:nofAttacker.cpp

示例2: nobBaseWarehouse

nobHarborBuilding::nobHarborBuilding(SerializedGameData& sgd, const unsigned obj_id)
    : nobBaseWarehouse(sgd, obj_id),
      expedition(sgd),
      exploration_expedition(sgd),
      orderware_ev(sgd.PopObject<EventManager::Event>(GOT_EVENT))
{
    // ins Militärquadrat einfügen
    gwg->GetMilitarySquares().Add(this);

    for(unsigned i = 0; i < 6; ++i)
        sea_ids[i] = sgd.PopUnsignedShort();

    sgd.PopObjectContainer(wares_for_ships, GOT_WARE);

    unsigned count = sgd.PopUnsignedInt();
    for(unsigned i = 0; i < count; ++i)
    {
        FigureForShip ffs;
        ffs.dest = sgd.PopMapPoint();
        ffs.fig = sgd.PopObject<noFigure>(GOT_UNKNOWN);
        figures_for_ships.push_back(ffs);
    }

    count = sgd.PopUnsignedInt();
    for(unsigned i = 0; i < count; ++i)
    {
        SoldierForShip ffs;
        ffs.dest = sgd.PopMapPoint();
        ffs.attacker = sgd.PopObject<nofAttacker>(GOT_NOF_ATTACKER);
        soldiers_for_ships.push_back(ffs);
    }
}
开发者ID:polemon,项目名称:s25client,代码行数:32,代码来源:nobHarborBuilding.cpp

示例3: GameObject

CatapultStone::CatapultStone(SerializedGameData& sgd, const unsigned obj_id) : GameObject(sgd, obj_id),
    dest_building(sgd.PopMapPoint()),
    dest_map(sgd.PopMapPoint()),
    start_x(sgd.PopSignedInt()),
    start_y(sgd.PopSignedInt()),
    dest_x(sgd.PopSignedInt()),
    dest_y(sgd.PopSignedInt()),
    explode(sgd.PopBool()),
    event(sgd.PopObject<EventManager::Event>(GOT_EVENT))
{
}
开发者ID:Ribosom,项目名称:s25client,代码行数:11,代码来源:CatapultStone.cpp

示例4: nofFlagWorker

nofGeologist::nofGeologist(SerializedGameData& sgd, const unsigned obj_id) : nofFlagWorker(sgd, obj_id), signs(sgd.PopUnsignedShort())
{
    unsigned available_nodes_count = sgd.PopUnsignedInt();
    for(unsigned i = 0; i < available_nodes_count; ++i)
    {
        MapPoint p = sgd.PopMapPoint();
        available_nodes.push_back(p);
    }

    node_goal = sgd.PopMapPoint();

    for(unsigned i = 0; i < 5; ++i)
        resAlreadyFound[i] = sgd.PopBool();
}
开发者ID:Return-To-The-Roots,项目名称:s25client,代码行数:14,代码来源:nofGeologist.cpp

示例5: noMovable

noFigure::noFigure(SerializedGameData& sgd, const unsigned obj_id) : noMovable(sgd, obj_id),
    fs(FigureState(sgd.PopUnsignedChar())),
    job_(Job(sgd.PopUnsignedChar())),
    player(sgd.PopUnsignedChar()),
    cur_rs(sgd.PopObject<RoadSegment>(GOT_ROADSEGMENT)),
    rs_pos(sgd.PopUnsignedShort()),
    rs_dir(sgd.PopBool()),
    on_ship(sgd.PopBool()),
    last_id(0xFFFFFFFF)
{
    if(fs == FS_GOTOGOAL || fs == FS_GOHOME)
        goal_ = sgd.PopObject<noRoadNode>(GOT_UNKNOWN);
    else
        goal_ = 0;

    waiting_for_free_node = sgd.PopBool();

    if(fs == FS_WANDER)
    {
        wander_way = sgd.PopUnsignedShort();
        wander_tryings = sgd.PopUnsignedShort();
        flagPos_ = sgd.PopMapPoint();
        flag_obj_id = sgd.PopUnsignedInt();
        burned_wh_id = sgd.PopUnsignedInt();
    }
}
开发者ID:Ribosom,项目名称:s25client,代码行数:26,代码来源:noFigure.cpp

示例6: 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

示例7: 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

示例8: noFigure

nofTradeLeader::nofTradeLeader(SerializedGameData& sgd, const unsigned obj_id)
    : noFigure(sgd, obj_id),
      tr(sgd, gwg, player),
      successor(sgd.PopObject<nofTradeDonkey>(GOT_NOF_TRADEDONKEY)),
      start(sgd.PopMapPoint()),
      goal_(sgd.PopMapPoint()),
      fails(sgd.PopUnsignedChar())
{
}
开发者ID:Ribosom,项目名称:s25client,代码行数:9,代码来源:nofTradeLeader.cpp

示例9: nofBuildingWorker

nofFarmhand::nofFarmhand(SerializedGameData& sgd, const unsigned obj_id) : nofBuildingWorker(sgd, obj_id), dest(sgd.PopMapPoint())
{}
开发者ID:kumzugloom,项目名称:s25client,代码行数:2,代码来源:nofFarmhand.cpp

示例10: gwg

TradeRoute::TradeRoute(SerializedGameData& sgd, const GameWorldGame& gwg, const unsigned char player)
    : gwg(gwg), player(player), path(sgd), curPos(sgd.PopMapPoint()), curRouteIdx(sgd.PopUnsignedInt())
{}
开发者ID:Return-To-The-Roots,项目名称:s25client,代码行数:3,代码来源:TradeRoute.cpp

示例11: pos

nofCatapultMan::PossibleTarget::PossibleTarget(SerializedGameData& sgd) : pos(sgd.PopMapPoint()), distance(sgd.PopUnsignedInt())
{}
开发者ID:Flow86,项目名称:s25client,代码行数:2,代码来源:nofCatapultMan.cpp

示例12: Deserialize

void GameWorld::Deserialize(SerializedGameData& sgd)
{
    // Headinformationen
    width_ = sgd.PopUnsignedShort();
    height_ = sgd.PopUnsignedShort();
    lt = LandscapeType(sgd.PopUnsignedChar());

    // Initialisierungen
    Init();

    // Obj-ID-Counter setzen
    GameObject::SetObjIDCounter(sgd.PopUnsignedInt());

    // Trade graphs
    // Only if trade is enabled
    if(GAMECLIENT.GetGGS().isEnabled(ADDON_TRADE))
    {
        tgs.resize(sgd.PopUnsignedChar());
        for(unsigned i = 0; i < tgs.size(); ++i)
            tgs[i] = new TradeGraph(sgd, this);
    }

    // Alle Weltpunkte serialisieren
    for(unsigned i = 0; i < map_size; ++i)
    {
        for(unsigned z = 0; z < 3; ++z)
        {
            nodes[i].roads[z] = sgd.PopUnsignedChar();
            nodes[i].roads_real[z] = nodes[i].roads[z] ? true : false;
        }


        nodes[i].altitude = sgd.PopUnsignedChar();
        nodes[i].shadow = sgd.PopUnsignedChar();
        nodes[i].t1 = TerrainType(sgd.PopUnsignedChar());
        nodes[i].t2 = TerrainType(sgd.PopUnsignedChar());
        nodes[i].resources = sgd.PopUnsignedChar();
        nodes[i].reserved = sgd.PopBool();
        nodes[i].owner = sgd.PopUnsignedChar();
        for(unsigned b = 0; b < 4; ++b)
            nodes[i].boundary_stones[b] = sgd.PopUnsignedChar();
        nodes[i].bq = BuildingQuality(sgd.PopUnsignedChar());
        for(unsigned z = 0; z < GAMECLIENT.GetPlayerCount(); ++z)
        {
            MapNode::FoWData& fow = nodes[i].fow[z];
            fow.visibility = Visibility(sgd.PopUnsignedChar());
            // Nur im FoW können FOW-Objekte stehen
            if(fow.visibility == VIS_FOW)
            {
                fow.last_update_time = sgd.PopUnsignedInt();
                fow.object = sgd.PopFOWObject();
                for(unsigned r = 0; r < 3; ++r)
                    fow.roads[r] = sgd.PopUnsignedChar();
                fow.owner = sgd.PopUnsignedChar();
                for(unsigned b = 0; b < 4; ++b)
                    fow.boundary_stones[b] = sgd.PopUnsignedChar();
            }
            else
            {
                fow.last_update_time = 0;
                fow.object = NULL;
                for(unsigned r = 0; r < 3; ++r)
                    fow.roads[r] = 0;
                fow.owner = 0;
                for(unsigned b = 0; b < 4; ++b)
                    fow.boundary_stones[b] = 0;
            }
        }
        nodes[i].obj = sgd.PopObject<noBase>(GOT_UNKNOWN);
        sgd.PopObjectContainer(nodes[i].figures, GOT_UNKNOWN);
        nodes[i].sea_id = sgd.PopUnsignedShort();
        nodes[i].harbor_id = sgd.PopUnsignedInt();

        if (nodes[i].harbor_id)
        {
            GameWorldBase::HarborPos p(MapPoint((MapCoord) (i % width_), (MapCoord) (i / width_)));
            harbor_pos.push_back(p);
        }
    }

    // Katapultsteine deserialisieren
    sgd.PopObjectContainer(catapult_stones, GOT_CATAPULTSTONE);

    // Meeresinformationen deserialisieren
    seas.resize(sgd.PopUnsignedInt());
    for(unsigned i = 0; i < seas.size(); ++i)
    {
        seas[i].nodes_count = sgd.PopUnsignedInt();
    }

    // Hafenpositionen serialisieren
    harbor_pos.resize(sgd.PopUnsignedInt());
    for(unsigned i = 0; i < harbor_pos.size(); ++i)
    {
        harbor_pos[i].pos = sgd.PopMapPoint();
        for(unsigned z = 0; z < 6; ++z)
            harbor_pos[i].cps[z].sea_id = sgd.PopUnsignedShort();
        for(unsigned z = 0; z < 6; ++z)
        {
            harbor_pos[i].neighbors[z].resize(sgd.PopUnsignedInt());
//.........这里部分代码省略.........
开发者ID:Ribosom,项目名称:s25client,代码行数:101,代码来源:GameWorld.cpp

示例13: nofSoldier

nofActiveSoldier::nofActiveSoldier(SerializedGameData& sgd, const unsigned obj_id) : nofSoldier(sgd, obj_id),
    state(SoldierState(sgd.PopUnsignedChar())),
    enemy(sgd.PopObject<nofActiveSoldier>(GOT_UNKNOWN))
{
    fightSpot_ = sgd.PopMapPoint();
}
开发者ID:vader1986,项目名称:s25client,代码行数:6,代码来源:nofActiveSoldier.cpp

示例14: start

TradePath::TradePath(SerializedGameData& sgd): start(sgd.PopMapPoint()), goal(sgd.PopMapPoint()), route(sgd.PopContainer(route)){}
开发者ID:Flow86,项目名称:s25client,代码行数:1,代码来源:TradePath.cpp

示例15: nofWorkman

nofShipWright::nofShipWright(SerializedGameData& sgd, const unsigned obj_id)
    : nofWorkman(sgd, obj_id),
      dest(sgd.PopMapPoint())
{
}
开发者ID:aidevn,项目名称:s25client,代码行数:5,代码来源:nofShipWright.cpp


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