Undo revision 23130 which was a merge with 2.5, a messy one because I did something...
[blender.git] / source / gameengine / GameLogic / SCA_ILogicBrick.h
index 90881c0..5067985 100644 (file)
@@ -53,7 +53,7 @@ protected:
        CValue* GetEvent();
 
 public:
-       SCA_ILogicBrick(SCA_IObject* gameobj,PyTypeObject* T );
+       SCA_ILogicBrick(SCA_IObject* gameobj);
        virtual ~SCA_ILogicBrick();
 
        void SetExecutePriority(int execute_Priority);
@@ -92,11 +92,35 @@ public:
                it.add_back(this);
        }
 
+       // insert in a QList at position corresponding to m_Execute_Priority
+       // inside a longer list that contains elements of other objects. 
+       // Sorting is done only between the elements of the same object.
+       // head is the head of the combined list
+       // current points to the first element of the object in the list, NULL if none yet
+       void                        InsertSelfActiveQList(SG_QList& head, SG_QList** current)
+       {
+               if (!*current)
+               {
+                       // first element can be put anywhere
+                       head.QAddBack(this);
+                       *current = this;
+                       return;
+               }
+               // note: we assume current points actually to one o our element, skip the tests
+               SG_QList::iterator<SCA_ILogicBrick> it(head,*current);
+               if (m_Execute_Priority <= (*it)->m_Execute_Priority)
+               {
+                       // this element comes before the first
+                       *current = this;
+               }
+               else
+               {
+                       for(++it; !it.end() && (*it)->m_gameobj == m_gameobj &&  m_Execute_Priority > (*it)->m_Execute_Priority; ++it);
+               }
+               it.add_back(this);
+       }
+
        virtual bool            LessComparedTo(SCA_ILogicBrick* other);
-       
-       virtual PyObject* py_getattro(PyObject *attr);
-       virtual PyObject* py_getattro_dict();
-       virtual int py_setattro(PyObject *attr, PyObject *value);
 
        static class SCA_LogicManager*  m_sCurrentLogicManager;