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


C++ FScope类代码示例

本文整理汇总了C++中FScope的典型用法代码示例。如果您正苦于以下问题:C++ FScope类的具体用法?C++ FScope怎么用?C++ FScope使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: LoadState

//
// SquadObj::LoadState
//
// Load a state configuration scope
//
void SquadObj::LoadState(FScope *fScope)
{
  // Call parent scope first
  GameObj::LoadState(fScope);

  // Get specific config scope
  fScope = fScope->GetFunction(SCOPE_CONFIG);
  FScope *sScope;

  while ((sScope = fScope->NextFunction()) != NULL)
  {
    switch (sScope->NameCrc())
    {
      case 0xEDF0E1CF: // "Team"
        SetTeam(Team::Name2Team(StdLoad::TypeString(sScope)));
        break;

      case 0x2F382D90: // "ModifierSettings"
        settings.LoadState(sScope);
        break;

      case 0xE3554C44: // "Node"
      {
        ListNode *node = list.Append();
        StdLoad::TypeReaper(sScope, *node);
        node->LoadState(sScope);
        break;
      }
    }
  }
}
开发者ID:ZhouWeikuan,项目名称:darkreign2,代码行数:36,代码来源:squadobj.cpp

示例2: Load

  //
  // Load
  //
  void SquadFormation::Load(FScope *fScope)
  {
    FScope *sScope;

    while ((sScope = fScope->NextFunction()) != NULL)
    {
      switch (sScope->NameCrc())
      {
        case 0x22C4A13F: // "StateMachine"
          inst.LoadState(sScope);
          break;

        case 0x7223612A: // "Formation"
          formation = StdLoad::TypeU32(sScope);
          break;

        case 0x693D5359: // "Location"
          StdLoad::TypeVector(sScope, location);
          break;

        case 0x04BC5B80: // "Direction"
          direction = StdLoad::TypeF32(sScope);
          break;

        default:
          LoadTaskData(sScope);
          break;
      }
    }
  }
开发者ID:ZhouWeikuan,项目名称:darkreign2,代码行数:33,代码来源:tasks_squadformation.cpp

示例3: LoadState

//
// ExplosionObj::LoadState
//
// Load a state configuration scope
//
void ExplosionObj::LoadState(FScope *fScope)
{
  // Call parent scope first
  MapObj::LoadState(fScope);

  fScope = fScope->GetFunction(SCOPE_CONFIG);
  FScope *sScope;

  while ((sScope = fScope->NextFunction()) != NULL)
  {
    switch (sScope->NameCrc())
    {
      case 0x9E64852D: // "Damage"
        damage.LoadState(sScope);
        break;

      case 0x6F5B0CAF: // "SourceUnit"
        StdLoad::TypeReaper(sScope, sourceUnit);
        break;

      case 0x5B0A6F84: // "SourceTeam"
        sourceTeam = Team::Name2Team(StdLoad::TypeString(sScope));
        break;
    }
  }
}
开发者ID:ZhouWeikuan,项目名称:darkreign2,代码行数:31,代码来源:explosionobj.cpp

示例4: LoadState

//
// LoadState
//
// Load state configuration
//
void SpyObj::LoadState(FScope *fScope)
{
  // Call parent scope first
  UnitObj::LoadState(fScope);

  // Get specific config scope
  if ((fScope = fScope->GetFunction(SCOPE_CONFIG, FALSE)) != NULL)
  {
    FScope *sScope;

    while ((sScope = fScope->NextFunction()) != NULL)
    {
      switch (sScope->NameCrc())
      {
        case 0x95B674EF: // "MorphTeam"
          morphTeam = Team::Name2Team(StdLoad::TypeString(sScope));
          break;

        case 0x65DBDDCC: // "MorphType"
          StdLoad::TypeReaperObjType(sScope, morphType);
          Resolver::Type(morphType);
          break;
      }
    }
  }
}
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:31,代码来源:spyobj.cpp

示例5: name

  //
  // Constructor
  //
  Modifier::Modifier(FScope *fScope)
  : name(StdLoad::TypeString(fScope)),
    numSettings(0)
  {
    FScope *sScope;
    const char *defaultName = NULL;

    while ((sScope = fScope->NextFunction()) != NULL)
    {
      switch (sScope->NameCrc())
      {
        case 0x5FC15146: // "AddSetting"
          if (numSettings == MAXSETTINGS)
          {
            sScope->ScopeError("Maximum settings exceeded!");
          }
          settings[numSettings++] = new GameIdent(StdLoad::TypeString(sScope));
          break;

        case 0x733C1EB5: // "DefaultSetting"
          defaultName = StdLoad::TypeString(sScope);
          break;
      }
    }

    if (!defaultName)
    {
      fScope->ScopeError("Expected DefaultSetting");
    }

    if (!GetIndex(Crc::CalcStr(defaultName), defaultSetting))
    {
      fScope->ScopeError("Could not find setting '%s' in modifier '%s'", defaultName, GetName());
    }
  }
开发者ID:ZhouWeikuan,项目名称:darkreign2,代码行数:38,代码来源:tactical.cpp

示例6: Load

//
// Load
//
void UnitExplore::Load(FScope *fScope)
{
    FScope *sScope;

    while ((sScope = fScope->NextFunction()) != NULL)
    {
        switch (sScope->NameCrc())
        {
        case 0x22C4A13F: // "StateMachine"
            inst.LoadState(sScope);
            break;

        case 0xD3D101D2: // "MoveHandle"
            moveHandle.LoadState(sScope);
            break;

        case 0x7BCDC81D: // "HangUntil"
            hangUntil = StdLoad::TypeU32(sScope);
            break;

        default:
            LoadTaskData(sScope);
            break;
        }
    }
}
开发者ID:supermukmin,项目名称:darkreign2,代码行数:29,代码来源:tasks_unitexplore.cpp

示例7: SaveState

  //
  // SaveState
  //
  // Save object state information
  //
  void Object::SaveState(FScope *scope)
  {
    // Save the managers (order is significant)
    scriptManager.SaveState(scope->AddFunction("ScriptManager"));
    transportManager.SaveState(scope->AddFunction("TransportManager"));
    assetManager.SaveState(scope->AddFunction("AssetManager"));
    bombardierManager.SaveState(scope->AddFunction("BombardierManager"));
    intelManager.SaveState(scope->AddFunction("IntelManager"));
    placementManager.SaveState(scope->AddFunction("PlacementManager"));
    ruleManager.SaveState(scope->AddFunction("RuleManager"));
    resourceManager.SaveState(scope->AddFunction("ResourceManager"));
    waterManager.SaveState(scope->AddFunction("WaterManager"));
    baseManager.SaveState(scope->AddFunction("BaseManager"));

    // Create scope for notifications
    FScope *sScope = scope->AddFunction("Notifications");

    // Save each current notification
    for (NList<Notification>::Iterator i(&notifications); *i; ++i)
    {
      // Get this notification
      Notification &n = **i;

      // Save it out
      FScope *ssScope = sScope->AddFunction("Add");
      StdSave::TypeReaper(ssScope, "From", n.from);
      StdSave::TypeU32(ssScope, "Message", n.message);
      StdSave::TypeU32(ssScope, "Param1", n.param1);
      StdSave::TypeU32(ssScope, "Param2", n.param2);
    }
  }
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:36,代码来源:strategic_object.cpp

示例8: while

  //
  // LoadState
  //
  // Load state information
  //
  void Transport::Manager::LoadState(FScope *scope)
  {
    FScope *sScope;

    while ((sScope = scope->NextFunction()) != NULL)
    {
      switch (sScope->NameCrc())
      {
        case 0xDFB7F0C8: // "Transport"
        {
          // Load and resolve the transport object
          TransportObjPtr reaper;
          StdLoad::TypeReaper(sScope, reaper);
          Resolver::Object<TransportObj, TransportObjType>(reaper);

          if (reaper.Alive())
          {
            if (Transport *transport = FindIdleTransport(*reaper))
            {
              transport->LoadState(sScope);
            }
          }       
          break;
        }
      }
    }
  }
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:32,代码来源:strategic_transport_manager.cpp

示例9: LoadState

//
// ResourceObj::LoadState
//
// Load a state configuration scope
//
void ResourceObj::LoadState(FScope *fScope)
{
  // Call parent scope first
  MapObj::LoadState(fScope);

  if ((fScope = fScope->GetFunction(SCOPE_CONFIG, FALSE)) != NULL)
  {
    FScope *sScope;

    while ((sScope = fScope->NextFunction()) != NULL)
    {
      switch (sScope->NameCrc())
      {
        case 0x5457F5AB: // "TeamHaveSeen"
          teamsHaveSeen = Game::TeamBitfield(StdLoad::TypeU32(sScope));
          break;

        case 0x7C8A86BB: // "ResourcePercent"
          resource = StdLoad::TypePercentage(sScope, ResourceType()->GetResourceMax());
          AdjustResource();
          break;
      }
    }
  }
}
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:30,代码来源:resourceobj.cpp

示例10: Load

  //
  // Load
  //
  void SquadMoveTogether::Load(FScope *fScope)
  {
    FScope *sScope;

    while ((sScope = fScope->NextFunction()) != NULL)
    {
      switch (sScope->NameCrc())
      {
        case 0x22C4A13F: // "StateMachine"
          inst.LoadState(sScope);
          break;

        case 0xA302E408: // "Destination"
          StdLoad::TypeVector(sScope, destination);
          break;

        case 0x04BC5B80: // "Direction"
          direction = StdLoad::TypeF32(sScope);
          break;

        case 0x82698073: // "Trail"
          StdLoad::TypeReaper(sScope, trail);
          break;

        case 0xA3998582: // "TrailIndex"
          index = StdLoad::TypeU32(sScope);
          break;

        default:
          LoadTaskData(sScope);
          break;
      }
    }  
  }
开发者ID:ZhouWeikuan,项目名称:darkreign2,代码行数:37,代码来源:tasks_squadmovetogether.cpp

示例11: Load

  //
  // Load
  //
  void UnitIdle::Load(FScope *fScope)
  {
    FScope *sScope;

    while ((sScope = fScope->NextFunction()) != NULL)
    {
      switch (sScope->NameCrc())
      {
        case 0x22C4A13F: // "StateMachine"
          inst.LoadState(sScope);
          break;

        case 0x5AB44811: // "Timer"
          timer.LoadState(sScope);
          break;

        case 0xA7DAA62B: // "AnimationCrc"
          animationCrc = StdLoad::TypeU32(sScope);
          break;

        default:
          LoadTaskData(sScope);
          break;
      }
    }
  }
开发者ID:ZhouWeikuan,项目名称:darkreign2,代码行数:29,代码来源:tasks_unitidle.cpp

示例12: LoadState

  //
  // LoadState
  //
  // Load state information
  //
  void Transport::LoadState(FScope *scope)
  {
    FScope *sScope;

    while ((sScope = scope->NextFunction()) != NULL)
    {
      switch (sScope->NameCrc())
      {
        case 0x693D5359: // "Location"
          StdLoad::TypeVector(sScope, location);
          break;

        case 0x8810AE3C: // "Script"
          script = manager.GetObject().GetScriptManager().FindScript(StdLoad::TypeU32(sScope));

          if (script)
          {
            AssignToSquad(script);
          }
          break;

        case 0x8669FADC: // "Flag"
          flag = StdLoad::TypeU32(sScope);
          break;
      }
    }
  }
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:32,代码来源:strategic_transport.cpp

示例13: ASSERT

  //
  // LoadState
  //
  // Load state information
  //
  void Asset::Request::LoadState(FScope *scope, void *context)
  {
    // The context holds a pointer to the asset manager
    Manager *manager = reinterpret_cast<Manager *>(context);

    ASSERT(manager)

    FScope *sScope;

    while ((sScope = scope->NextFunction()) != NULL)
    {
      switch (sScope->NameCrc())
      {
        case 0x411AC76D: // "Parent"
          Item::LoadState(sScope, context);
          break;

        case 0x8810AE3C: // "Script"
          script = manager->GetObject().GetScriptManager().FindScript(StdLoad::TypeU32(sScope));
          break;

        case 0xB5EA6B79: // "Handle"
          handle = StdLoad::TypeU32(sScope);
          break;
      }
    }
  }
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:32,代码来源:strategic_asset_request.cpp

示例14: Load

  //
  // Load
  //
  void TransportUnload::Load(FScope *fScope)
  {
    FScope *sScope;

    while ((sScope = fScope->NextFunction()) != NULL)
    {
      switch (sScope->NameCrc())
      {
        case 0x22C4A13F: // "StateMachine"
          inst.LoadState(sScope);
          break;

        case 0xA302E408: // "Destination"
          StdLoad::TypeVector(sScope, destination);
          break;

        case 0xD3D101D2: // "MoveHandle"
          moveHandle.LoadState(sScope);
          break;

        default:
          LoadTaskData(sScope);
          break;
      }
    }    
  }
开发者ID:ZhouWeikuan,项目名称:darkreign2,代码行数:29,代码来源:tasks_transportunload.cpp

示例15: ASSERT

    //
    // Step to the next instruction "At" instruction
    //
    void Cineractive::NextInstruction()
    {
      ASSERT(instructions)

      FScope *fScope;
      nextScope = NULL;

      // Step to the next "At"
      while ((fScope = instructions->NextFunction()) != NULL)
      {
        LOG_VIEWER(("NextInstruction: [%s]", fScope->NameStr()))

        switch (fScope->NameCrc())
        {
          case 0x3F159CC9: // "DefineDebriefing"
          {
            debriefings.Add(Crc::CalcStr(fScope->NextArgString()), fScope);
            break;
          }

          case 0xBF046B0F: // "At"
          {
            nextScope = fScope;
            nextCycle = Utils::FtoLNearest(nextScope->NextArgFPoint() * GameTime::CYCLESPERSECOND);
            return;
          }

          default:
          {
            LOG_WARN(("Unexpected function [%s] in Cineractive", fScope->NameStr()))
            break;
          }
        }
      }
    }
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:38,代码来源:viewer_action.cpp


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