YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
DynamicWorldObjectCollection.cpp
Go to the documentation of this file.
1
#include "
YAPOG/Game/World/Map/DynamicWorldObjectCollection.hpp
"
2
#include "
YAPOG/Game/World/Map/DynamicWorldObject.hpp
"
3
4
namespace
yap
5
{
6
DynamicWorldObjectCollection::DynamicWorldObjectCollection
()
7
: objects_ ()
8
{
9
}
10
11
DynamicWorldObjectCollection::~DynamicWorldObjectCollection
()
12
{
13
for
(
const
auto
& it :
objects_
)
14
delete
it.second;
15
}
16
17
DynamicWorldObjectCollection::ItType
18
DynamicWorldObjectCollection::begin
()
19
{
20
return
objects_
.
Begin
();
21
}
22
23
DynamicWorldObjectCollection::ConstItType
24
DynamicWorldObjectCollection::begin
()
const
25
{
26
return
objects_
.
Begin
();
27
}
28
29
DynamicWorldObjectCollection::ItType
30
DynamicWorldObjectCollection::end
()
31
{
32
return
objects_
.
End
();
33
}
34
35
DynamicWorldObjectCollection::ConstItType
36
DynamicWorldObjectCollection::end
()
const
37
{
38
return
objects_
.
End
();
39
}
40
41
DynamicWorldObjectCollection::SizeType
42
DynamicWorldObjectCollection::Count
()
const
43
{
44
return
objects_
.
Count
();
45
}
46
47
void
DynamicWorldObjectCollection::AddObject
(
DynamicWorldObject
*
object
)
48
{
49
objects_
.
Add
(object->
GetWorldID
(), object);
50
}
51
52
void
DynamicWorldObjectCollection::RemoveObject
(
const
ID
& worldID)
53
{
54
objects_
.
Remove
(worldID);
55
}
56
57
DynamicWorldObject
&
DynamicWorldObjectCollection::GetObject
(
58
const
ID
& worldID)
59
{
60
return
*
objects_
[worldID];
61
}
62
63
void
DynamicWorldObjectCollection::Update
(
const
Time
& dt)
64
{
65
for
(
auto
& it :
objects_
)
66
it.second->Update (dt);
67
}
68
}
// namespace yap
YAPOG
src
YAPOG
Game
World
Map
DynamicWorldObjectCollection.cpp
Generated on Mon Sep 17 2012 22:24:25 for YAPOG by
1.8.1.1