本文整理汇总了C++中System::add方法的典型用法代码示例。如果您正苦于以下问题:C++ System::add方法的具体用法?C++ System::add怎么用?C++ System::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System
的用法示例。
在下文中一共展示了System::add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load
void WorldSave::load(World& w)
{
auto& systems = w.getSystems();
System<Physical>* physSys = systems.get<Physical>();
for(auto& c : components[Component::Type::Physical])
{
physSys->add(c.first)->unserialize(c.second);
}
System<Movable>* movSys = systems.get<Movable>();
for(auto& c : components[Component::Type::Movable])
{
movSys->add(c.first)->unserialize(c.second);
}
System<Animated>* animSys = systems.get<Animated>();
for(auto& c : components[Component::Type::Animated])
{
animSys->add(c.first)->unserialize(c.second);
}
System<BatchDrawable>* bdrawSys = systems.get<BatchDrawable>();
for(auto& c : components[Component::Type::BatchDrawable])
{
bdrawSys->add(c.first)->unserialize(c.second);
}
System<Controllable>* ctrlSys = systems.get<Controllable>();
for(auto& c : components[Component::Type::Controllable])
{
ctrlSys->add(c.first)->unserialize(c.second);
}
System<Drawable>* drawSys = systems.get<Drawable>();
for(auto& c : components[Component::Type::Drawable])
{
drawSys->add(c.first)->unserialize(c.second);
}
System<Name>* nameSys = systems.get<Name>();
for(auto& c : components[Component::Type::Name])
{
nameSys->add(c.first)->unserialize(c.second);
}
System<Noisy>* noiseSys = systems.get<Noisy>();
for(auto& c : components[Component::Type::Noisy])
{
noiseSys->add(c.first)->unserialize(c.second);
}
System<Pathfinder>* pfSys = systems.get<Pathfinder>();
for(auto& c : components[Component::Type::Pathfinder])
{
pfSys->add(c.first)->unserialize(c.second);
}
System<Scriptable>* scriptSys = systems.get<Scriptable>();
for(auto& c : components[Component::Type::Scriptable])
{
scriptSys->add(c.first)->unserialize(c.second);
}
}