本文整理汇总了C++中ActorSet::size方法的典型用法代码示例。如果您正苦于以下问题:C++ ActorSet::size方法的具体用法?C++ ActorSet::size怎么用?C++ ActorSet::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActorSet
的用法示例。
在下文中一共展示了ActorSet::size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Create
Actor* Actor::Create(String archetype)
{
//TODO: this is kind of a fragile way to get the Actor the script created.
// Let's figure out a smarter way to get the object directly from Python,
// hopefully without introducing a bunch of Python API code into Angel proper.
String markerTag = "last-spawned-actor-from-code";
String toExec = "Actor._lastSpawnedActor = Actor.Create('" + archetype + "')\n";
toExec += "Actor._lastSpawnedActor.Tag('" + markerTag + "')\n";
theWorld.ScriptExec(toExec);
ActorSet tagged = theTagList.GetObjectsTagged(markerTag);
if (tagged.size() > 1)
{
sysLog.Log("WARNING: more than one Actor tagged with '" + markerTag + "'. (" + archetype + ")");
}
if (tagged.size() < 1)
{
sysLog.Log("ERROR: Script failed to create Actor with archetype " + archetype + ". ");
return NULL;
}
ActorSet::iterator it = tagged.begin();
Actor* forReturn = *it;
toExec = "Actor._lastSpawnedActor.__disown__()\n";
toExec += "Actor._lastSpawnedActor = None\n";
theWorld.ScriptExec(toExec);
if (forReturn != NULL)
{
forReturn->Untag(markerTag);
}
return forReturn;
}