本文整理汇总了C++中FScope::NameCrc方法的典型用法代码示例。如果您正苦于以下问题:C++ FScope::NameCrc方法的具体用法?C++ FScope::NameCrc怎么用?C++ FScope::NameCrc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FScope
的用法示例。
在下文中一共展示了FScope::NameCrc方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
}
}
示例2: 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;
}
}
}
示例3: 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;
}
}
}
示例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;
}
}
}
}
示例5: LoadState
//
// Load the modifier settings
//
void ModifierSettings::LoadState(FScope *fScope)
{
// Load the settings
FScope *sScope;
while ((sScope = fScope->NextFunction()) != NULL)
{
switch (sScope->NameCrc())
{
case 0x1F2EDF02: // "Set"
{
const char *modifier = sScope->NextArgString();
const char *setting = sScope->NextArgString();
U8 modifierIndex;
U8 settingIndex;
if (
FindModifier(Crc::CalcStr(modifier), &modifierIndex) &&
FindSetting(modifierIndex, Crc::CalcStr(setting), &settingIndex))
{
Set(modifierIndex, settingIndex);
}
else
{
LOG_WARN(("Invalid modifier setting combination %s:%s", modifier, setting))
}
break;
}
}
}
}
示例6: 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;
}
}
}
}
示例7: 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;
}
}
}
示例8: 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;
}
}
}
示例9: 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;
}
}
}
}
示例10: 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;
}
}
}
示例11: 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;
}
}
}
示例12: ProcessStandardCursors
//
// Process a StandardCursors scope
//
void ProcessStandardCursors(FScope *fScope)
{
FScope *sScope;
while ((sScope = fScope->NextFunction()) != NULL)
{
switch (sScope->NameCrc())
{
case 0x8F651465: // "Default"
standardCrs[DEFAULT] = FindByName(sScope->NextArgString());
break;
case 0x23C19271: // "IBeam"
standardCrs[IBEAM] = FindByName(sScope->NextArgString());
break;
case 0x6E758990: // "Wait"
standardCrs[WAIT] = FindByName(sScope->NextArgString());
break;
case 0x65D94636: // "No"
standardCrs[NO] = FindByName(sScope->NextArgString());
break;
default:
{
LOG_ERR(("Unknown standard cursor type [%s]", sScope->NameStr()));
break;
}
}
}
}
示例13: 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;
}
}
}
}
示例14: 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;
}
}
}
}
示例15: 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;
}
}
}