YAPOG  0.0.1
Yet Another Pokemon Online Game
DynamicWorldObjectCollection.cpp
Go to the documentation of this file.
3 
4 namespace yap
5 {
7  : objects_ ()
8  {
9  }
10 
12  {
13  for (const auto& it : objects_)
14  delete it.second;
15  }
16 
19  {
20  return objects_.Begin ();
21  }
22 
25  {
26  return objects_.Begin ();
27  }
28 
31  {
32  return objects_.End ();
33  }
34 
37  {
38  return objects_.End ();
39  }
40 
43  {
44  return objects_.Count ();
45  }
46 
48  {
49  objects_.Add (object->GetWorldID (), object);
50  }
51 
53  {
54  objects_.Remove (worldID);
55  }
56 
58  const ID& worldID)
59  {
60  return *objects_[worldID];
61  }
62 
64  {
65  for (auto& it : objects_)
66  it.second->Update (dt);
67  }
68 } // namespace yap