本文整理汇总了C++中ActorPtr::setParentBlackBoard方法的典型用法代码示例。如果您正苦于以下问题:C++ ActorPtr::setParentBlackBoard方法的具体用法?C++ ActorPtr::setParentBlackBoard怎么用?C++ ActorPtr::setParentBlackBoard使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActorPtr
的用法示例。
在下文中一共展示了ActorPtr::setParentBlackBoard方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load
void ActorSet::load(const PropertyBag &objects, World *_world)
{
ASSERT(_world!=0, "world was null");
world = _world;
for(size_t i=0, n=objects.getNumInstances("object"); i<n; ++i)
{
const tuple<OBJECT_ID, ActorPtr> t = create();
const ActorPtr object = t.get<1>();
const PropertyBag decl = objects.getBag("object", i);
const FileName templateFile = decl.getFileName("template");
const vec3 initialPosition = decl.getVec3("position");
const PropertyBag templateData = PropertyBag::fromFile(templateFile);
const PropertyBag base = templateData.getBag("components");
ComponentDataSet s = ComponentDataSet::load(base, decl);
// get actor name
object->actorName = "(no name)";
templateData.get("name", object->actorName);
object->load(s, initialPosition, vec3(0,0,0), world);
object->setParentBlackBoard(this);
}
}
示例2: getActorFactory
tuple<OBJECT_ID, ActorPtr> ActorSet::create()
{
ActorFactory &factory = getActorFactory();
const tuple<OBJECT_ID, ActorPtr> t = factory.create();
const OBJECT_ID id = t.get<0>();
const ActorPtr actor = t.get<1>();
actors.insert(make_pair(id, actor)); // record it in this actor set
registerSubscriber(actor); // record it in the blackboard
actor->setParentBlackBoard(this);
return t;
}