YAPOG  0.0.1
Yet Another Pokemon Online Game
BoundingBoxReader.cpp
Go to the documentation of this file.
5 
6 namespace yap
7 {
9  BoundingBox& boundingBox,
10  const String& xmlRootNodeName)
12  , xmlRootNodeName_ (xmlRootNodeName)
13  , boundingBox_ (boundingBox)
14  {
15 
16  }
17 
19  {
20  }
21 
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