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


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

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


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

示例1: ModifierProperties

  //
  // Constructor
  //
  Table::Table(FScope *fScope)
  {
    // Setup the modifiers
    modifiers = new ModifierProperties *[numModifiers];
    for (U32 m = 0; m < numModifiers; m++)
    {
      modifiers[m] = new ModifierProperties(*Tactical::modifiers[m]);
    }

    FScope *sScope;
    while ((sScope = fScope->NextFunction()) != NULL)
    {
      switch (sScope->NameCrc())
      {
        case 0xFEB2541D: // "ConfigureModifier"
        {
          U8 index;
          const char *modifier = StdLoad::TypeString(sScope);
          if (FindModifierIndex(Crc::CalcStr(modifier), index))
          {
            modifiers[index]->Load(sScope);
          }
          else
          {
            sScope->ScopeError("Could not find modifier '%s'", modifier);
          }
          break;
        }
      }
    }
  }
开发者ID:ZhouWeikuan,项目名称:darkreign2,代码行数:34,代码来源:tactical.cpp

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

示例3: Load

  //
  // Load
  //
  void SettingProperties::Load(FScope *fScope)
  {
    FScope *sScope;
    while ((sScope = fScope->NextFunction()) != NULL)
    {
      switch (sScope->NameCrc())
      {
        case 0x2CA06E10: // "Allow"
        {
          U32 index;
          const char *property = StdLoad::TypeString(sScope);
          if (FindPropertyIndex(Crc::CalcStr(property), index))
          {
            values[index] = PV_ALLOW;
          }
          else
          {
            sScope->ScopeError("Unknown Property '%s'", property);
          }
          break;
        }

        case 0xF8765CE8: // "Deny"
        {
          U32 index;
          const char *property = StdLoad::TypeString(sScope);
          if (FindPropertyIndex(Crc::CalcStr(property), index))
          {
            values[index] = PV_DENY;
          }
          else
          {
            sScope->ScopeError("Unknown Property '%s'", property);
          }
          break;
        }
      }
    }
  }
开发者ID:ZhouWeikuan,项目名称:darkreign2,代码行数:42,代码来源:tactical.cpp

示例4: name

  //
  // Obj::Obj
  //
  // Constructor
  //
  Obj::Obj(FScope *fScope, const char *name) : 
    name(name)
  {
    FScope *sScope;

    defaultLocation = NULL;

    // Process each function
    while ((sScope = fScope->NextFunction()) != NULL)
    {
      switch (sScope->NameCrc())
      {

        case 0x1E534497: // "Tag"
        {
          U32 tag = Crc::CalcStr(sScope->NextArgString());
          tags.Add(tag, new Location(sScope, name));
          break;
        }

        case 0x1D9D48EC: // "Type"
        {
          U32 type = Crc::CalcStr(sScope->NextArgString());
          types.Add(type, new Location(sScope, name));
          break;
        }

        case 0x666BCB68: // "Property"
        {
          properties.Append(new PropertyLocation(sScope, name));
          break;
        }

        case 0x8F651465: // "Default"
          if (defaultLocation)
          {
            sScope->ScopeError("Default has already been specified");
          }
          defaultLocation = new Location(sScope, name);
          break;
      }
    }
  }
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:48,代码来源:message.cpp

示例5: script

  //
  // Constructor
  //
  Script::State::State(Script &script, const char *name, FScope *fScope)
  : script(script),
    settings(&Setting::nodeState),
    conditions(&Condition::nodeState),
    transitions(&Transition::nodeState),
    name(name)
  {
    FScope *sScope;
    FScope *iScope;

    // Load the settings
    iScope = fScope->GetFunction("Settings", FALSE);
    if (iScope)
    {
      while ((sScope = iScope->NextFunction()) != NULL)
      {
        switch (sScope->NameCrc())
        {
          case 0x32BBA19C: // "Setting"
            settings.Append(Setting::Create(script, sScope));
            break;

          default:
            sScope->ScopeError("Unknown function '%s' in settings", sScope->NameStr());
        }
      }
    }

    // Load the action
    iScope = fScope->GetFunction("Action", FALSE);
    if (iScope)
    {
      action = Action::Create(script, iScope);
    }
    else
    {
      action = NULL;
    }

    // Load the conditions
    iScope = fScope->GetFunction("Conditions", FALSE);

    if (iScope)
    {
      while ((sScope = iScope->NextFunction()) != NULL)
      {
        switch (sScope->NameCrc())
        {
          case 0x6A34146A: // "Condition"
            conditions.Append(Condition::Create(script, sScope));
            break;

          case 0xFBCD164A: // "Status"
          {
            GameIdent code = StdLoad::TypeString(sScope);

            if (transitions.Exists(code.crc))
            {
              sScope->ScopeError("Status '%s' already defined", code.str);
            }

            // Add the new transition
            transitions.Add(code.crc, Transition::Create(sScope));
            break;
          }

          default:
            sScope->ScopeError("Unknown function '%s' in conditions", sScope->NameStr());
        }
      }
    }

    completed = transitions.Find(Status::Completed);
  }
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:77,代码来源:strategic_script_state.cpp


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