phoenix/windows/object.cpp
raw| 1 | namespace phoenix { |
| 2 | |
| 3 | vector<pObject*> pObject::objects; |
| 4 | |
| 5 | pObject::pObject(Object& object) : object(object) { |
| 6 | static unsigned uniqueId = 100; |
| 7 | objects.append(this); |
| 8 | id = uniqueId++; |
| 9 | locked = false; |
| 10 | } |
| 11 | |
| 12 | Object* pObject::find(unsigned id) { |
| 13 | for(auto& item : objects) if(item->id == id) return &item->object; |
| 14 | return nullptr; |
| 15 | } |
| 16 | |
| 17 | } |