File: object.cpp

package info (click to toggle)
libretro-bsnes-mercury 094%2Bgit20160126-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 9,636 kB
  • sloc: cpp: 109,056; ansic: 3,097; makefile: 638; xml: 11; sh: 1
file content (17 lines) | stat: -rw-r--r-- 336 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
namespace phoenix {

vector<pObject*> 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;
}

}