namespace phoenix { vector pObject::objects; pObject::pObject(Object& object) : object(object) { static unsigned uniqueId = 100; objects.append(this); id = uniqueId++; locked = false; } Object* pObject::find(unsigned id) { for(auto& item : objects) if(item->id == id) return &item->object; return nullptr; } }