YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
BoundingBoxReader.cpp
Go to the documentation of this file.
1
#include "
YAPOG/Game/World/Map/Physics/BoundingBoxReader.hpp
"
2
#include "
YAPOG/Game/World/Map/Physics/BoundingBox.hpp
"
3
#include "
YAPOG/System/IO/Xml/XmlReader.hpp
"
4
#include "
YAPOG/Graphics/RectReader.hpp
"
5
6
namespace
yap
7
{
8
BoundingBoxReader::BoundingBoxReader
(
9
BoundingBox
& boundingBox,
10
const
String
& xmlRootNodeName)
11
:
BaseReaderVisitor
()
12
, xmlRootNodeName_ (xmlRootNodeName)
13
, boundingBox_ (boundingBox)
14
{
15
16
}
17
18
BoundingBoxReader::~BoundingBoxReader
()
19
{
20
}
21
22
void
BoundingBoxReader::Visit
(
XmlReader
& visitable)
23
{
24
BaseReaderVisitor::Visit
(visitable);
25
26
auto
reader = visitable.
ChangeRoot
(
xmlRootNodeName_
);
27
28
FloatRect
rect;
29
RectReader<float>
rectReader (rect,
"rect"
);
30
reader->Accept (rectReader);
31
32
boundingBox_
.
SetPosition
(
Vector2
(rect.left, rect.top));
33
boundingBox_
.
SetSize
(
Vector2
(rect.width, rect.height));
34
35
boundingBox_
.
SetZ
(reader->ReadInt (
"z"
));
36
boundingBox_
.
SetH
(reader->ReadInt (
"h"
));
37
}
38
}
// namespace yap
YAPOG
src
YAPOG
Game
World
Map
Physics
BoundingBoxReader.cpp
Generated on Mon Sep 17 2012 22:24:25 for YAPOG by
1.8.1.1