Esempio n. 1
0
File: Entity.cpp Progetto: A-K/naali
 QObjectList Entity::GetComponentsRaw(const QString &type_name) const
 {
     QObjectList ret;
     if (type_name.isNull())
         for(size_t i = 0; i < components_.size() ; ++i)
             ret.push_back(components_[i].get());
     else
         for(size_t i = 0; i < components_.size() ; ++i)
             if (components_[i]->TypeName() == type_name)
                 ret.push_back(components_[i].get());
     return ret;
 }
Esempio n. 2
0
QObjectList Entity::GetComponentsRaw(const QString &type_name) const
{
    LogWarning("Entity::GetComponentsRaw: This function is deprecated and will be removed. Use GetComponents or Components instead.");
    QObjectList ret;
    if (type_name.isNull())
        for (ComponentMap::const_iterator i = components_.begin(); i != components_.end(); ++i)
            ret.push_back(i->second.get());
    else
        for (ComponentMap::const_iterator i = components_.begin(); i != components_.end(); ++i)
            if (i->second->TypeName() == type_name)
                ret.push_back(i->second.get());
    return ret;
}
Esempio n. 3
0
    QObjectList loadAll(NodeObjectMap &map) {
        
        Nodes nodes;
        
        Triples candidates = m_s->match(Triple(Node(), Uri("a"), Node()));
        foreach (Triple t, candidates) {
            if (t.c.type != Node::URI) continue;
            nodes.push_back(t.a);
        }

        LoadState state;
        state.requested = nodes;
        state.map = map;
        state.loadFlags = LoadState::IgnoreUnknownTypes;

        collect(state);
        load(state);

        map = state.map;

        QObjectList objects;
        foreach (Node n, nodes) {
            QObject *o = map.value(n);
            if (o) objects.push_back(o);
        }
Esempio n. 4
0
QObjectList WorldModel::getBodies() const
{
    QObjectList bodies;

    foreach (QBodyDef* qbody, bodyList_)
        bodies.push_back(qbody);

    return bodies;
}