本文整理汇总了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;
}
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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: 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());
}
}
示例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;
}
}
}
示例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(¬ifications); *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);
}
}
示例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;
}
}
}
}
示例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;
}
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
}