YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
EventBoundingBoxCollection.cpp
Go to the documentation of this file.
1
#include "
YAPOG/Game/World/Map/Physics/EventBoundingBoxCollection.hpp
"
2
#include "
YAPOG/Game/World/Map/Physics/MapEventInfo.hpp
"
3
#include "
YAPOG/Game/World/Map/Physics/CollidableArea.hpp
"
4
#include "
YAPOG/Game/World/Map/Physics/BoundingBox.hpp
"
5
#include "
YAPOG/Game/World/Map/DynamicWorldObject.hpp
"
6
7
namespace
yap
8
{
9
EventBoundingBoxCollection::EventBoundingBoxCollection
()
10
:
BoundingBoxCollection
()
11
, parent_ (nullptr)
12
, eventBoundingBoxes_ ()
13
{
14
}
15
16
EventBoundingBoxCollection::~EventBoundingBoxCollection
()
17
{
18
}
19
20
EventBoundingBoxCollection::EventBoundingBoxCollection
(
21
const
EventBoundingBoxCollection
& copy)
22
:
BoundingBoxCollection
(copy)
23
, parent_ (nullptr)
24
, eventBoundingBoxes_ ()
25
{
26
}
27
28
void
EventBoundingBoxCollection::AddEventBoundingBox
(
29
BoundingBox
* boundingBox,
30
MapEvent
* event)
31
{
32
eventBoundingBoxes_
.
Add
(boundingBox, event);
33
34
AddBoundingBox
(boundingBox);
35
}
36
37
void
EventBoundingBoxCollection::RemoveEventBoundingBox
(
38
BoundingBox
* boundingBox)
39
{
40
eventBoundingBoxes_
.
Remove
(boundingBox);
41
42
RemoveBoundingBox
(boundingBox);
43
}
44
45
void
EventBoundingBoxCollection::SetCollidableArea
(
46
DynamicWorldObject
& parent,
47
CollidableArea
* collidableArea)
48
{
49
parent_
= &parent;
50
51
BoundingBoxCollection::SetCollidableArea
(collidableArea);
52
}
53
54
void
EventBoundingBoxCollection::HandleAddBoundingBoxToCollidableArea
(
55
BoundingBox
* boundingBox)
56
{
57
GetCollidableArea
().
AddEventCollidable
(
58
boundingBox,
59
MapEventInfo::PtrType
(
60
new
MapEventInfo
(
61
*boundingBox,
62
*
eventBoundingBoxes_
[boundingBox],
63
*
parent_
)));
64
}
65
66
void
EventBoundingBoxCollection::HandleRemoveBoundingBoxFromCollidableArea
(
67
BoundingBox
* boundingBox)
68
{
69
GetCollidableArea
().
RemoveEventCollidable
(boundingBox);
70
}
71
}
// namespace yap
YAPOG
src
YAPOG
Game
World
Map
Physics
EventBoundingBoxCollection.cpp
Generated on Mon Sep 17 2012 22:24:25 for YAPOG by
1.8.1.1