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


C++ FScope::AddArgInteger方法代码示例

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


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

示例1: Save

  //
  // Save from the Var Scope into the FScope
  //
  void Save(FScope *fScope, VarSys::VarScope *vScope)
  {
    // Add all of the items in this vScope to the fScope
    BinTree<VarSys::VarItem>::Iterator i(&vScope->items);
    for (!i; *i; i++)
    {
      switch ((*i)->type)
      {
        case VarSys::VI_SCOPE:
        {
          // Add this scope to the fScope
          FScope *sScope = fScope->AddFunction("VarScope");
          sScope->AddArgString((*i)->itemId.str);
          Save(sScope, (*i)->scope.ptr);
          break;
        }

        case VarSys::VI_INTEGER:
        {
          FScope *sScope = fScope->AddFunction("VarInteger");
          sScope->AddArgString((*i)->itemId.str);
          sScope->AddArgInteger((*i)->Integer());
          break;
        }

        case VarSys::VI_FPOINT:   
        {
          FScope *sScope = fScope->AddFunction("VarFloat");
          sScope->AddArgString((*i)->itemId.str);
          sScope->AddArgFPoint((*i)->Float());
          break;
        }

        case VarSys::VI_STRING:
        {
          FScope *sScope = fScope->AddFunction("VarString");
          sScope->AddArgString((*i)->itemId.str);
          sScope->AddArgString((*i)->Str());
          break;
        }

        case VarSys::VI_BINARY:
        {
          FScope *sScope = fScope->AddFunction("VarBinary");
          sScope->AddArgString((*i)->itemId.str);
          StdSave::TypeU32(sScope, "Size", (*i)->BinarySize());
          StdSave::TypeBinary(sScope, (*i)->BinarySize(), (*i)->Binary());
          break;
        }

        default:
          // We don't save anything else
          break;
      }
    }
  }
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:59,代码来源:varfile.cpp

示例2:

  //
  // SaveState
  //
  // Save state information
  //
  void Script::Manager::SaveState(FScope *scope)
  {
    // Save the recruit id
    StdSave::TypeU32(scope, "RecruitId", recruitId);

    // Save each script
    for (NBinTree<Script>::Iterator s(&scripts); *s; s++)
    {
      // Get the script
      Script *script = *s;

      // Create the scope
      FScope *sScope = scope->AddFunction("Script");

      // Add construction data as arguments
      sScope->AddArgString(script->GetName());
      sScope->AddArgString(script->GetConfigName());
      sScope->AddArgInteger(script->GetWeighting());
      sScope->AddArgInteger(script->GetPriority());

      // Save the script state data
      script->SaveState(sScope);
    }
  }
开发者ID:ZhouWeikuan,项目名称:darkreign2,代码行数:29,代码来源:strategic_script_manager.cpp

示例3:

  //
  // SaveState
  //
  // Save state information
  //
  void Resource::Manager::SaveState(FScope *scope)
  {
    StdSave::TypeU32(scope, "ResourceId", resourceId);
    StdSave::TypeReaperList(scope, "ResourceTransports", resourceTransports);

    for (NBinTree<Resource, F32>::Iterator i(&resources); *i; i++)
    {
      // Create a new function
      FScope *sScope = scope->AddFunction("Resource");

      // Save the proximity key
      sScope->AddArgFPoint(i.GetKey());

      // Save the id
      sScope->AddArgInteger((*i)->GetId());

      // Save resource data
      (*i)->SaveState(sScope);
    }

  }
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:26,代码来源:strategic_resource_manager.cpp


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