YAPOG  0.0.1
Yet Another Pokemon Online Game
PokemonMoveInfoWidget.cpp
Go to the documentation of this file.
11 
13 #include "Pokemon/Pokemon.hpp"
14 
15 namespace ycl
16 {
18  : mainLayout_ (nullptr)
19  , firstLine_ (nullptr)
20  , firstLinePartRight_ (nullptr)
21  , pokemonFrontInfoWidget_ ()
22  , pokemonSingleMoveInfoWidgets_ (4, nullptr)
23  {
24  // Layouts
26  yap::Padding (), yap::Padding (), false);
27 
29  yap::Padding (), yap::Padding (), false);
30 
32  yap::Padding (5, 0, 0, 15), yap::Padding (0, 0, 11, 0), false);
33  }
34 
36  {
38  "Pictures/TeamManager/PokemonMoveInfoBackground.png", true));
39 
40  // Set layouts size
42  firstLine_->SetSize (yap::Vector2 (800, 328));
44 
45  // Init widgets
47 
48  for (int i = 0; i < 4; i++)
49  {
50  PokemonSingleMoveInfoWidget* pokemonSingleMoveInfoWidget =
52 
53  pokemonSingleMoveInfoWidget->Init ();
54 
55  pokemonSingleMoveInfoWidgets_[i] = pokemonSingleMoveInfoWidget;
56 
57  firstLinePartRight_->AddChild (*pokemonSingleMoveInfoWidget);
58  }
59 
60  // Hierarchy construction
61  firstLine_->AddChild (pokemonFrontInfoWidget_, yap::LayoutBox::Align::TOP);
62  firstLine_->AddChild (*firstLinePartRight_, yap::LayoutBox::Align::TOP);
63 
64  mainLayout_->AddChild (*firstLine_, yap::LayoutBox::Align::LEFT);
65 
67 
69  }
70 
72  {
74 
75  for (int i = 0; i < 4; i++)
76  {
77  if (pokemon.GetMoveSet ().GetMove (i) != nullptr)
78  {
79  pokemonSingleMoveInfoWidgets_[i]->SetPokemonMove (
80  *pokemon.GetMoveSet ().GetMove (i));
81  }
82  }
83  }
84 
87  /*
88  void PokemonMoveInfoWidget::SetDefaultColor (const sf::Color& color)
89  {}
90  void PokemonMoveInfoWidget::AddDrawable (yap::IDrawable& drawable)
91  {}
92  void PokemonMoveInfoWidget::AddChild (yap::IWidget& child)
93  {}
94  yap::IWidget& PokemonMoveInfoWidget::GetRoot () const
95  { return GetRoot (); }
96  yap::WidgetBorder* PokemonMoveInfoWidget::GetBorder () const
97  { return GetBorder (); }
98  void PokemonMoveInfoWidget::SetParent (yap::IWidget& parent)
99  {}
100  void PokemonMoveInfoWidget::SetPadding (const yap::Padding& padding)
101  {}
102  void PokemonMoveInfoWidget::SetBackground (yap::WidgetBackground& background)
103  {}
104  void PokemonMoveInfoWidget::SetBorder (yap::WidgetBorder& border, yap::uint width)
105  {}
106  void PokemonMoveInfoWidget::Refresh ()
107  {}
108  */
110  {
111  return false;
112  }
113  /*
114  void PokemonMoveInfoWidget::SetFocused (bool state)
115  {}
116  void PokemonMoveInfoWidget::SetEnable (bool enable)
117  {}
118  void PokemonMoveInfoWidget::Open ()
119  {}
120  void PokemonMoveInfoWidget::Close ()
121  {}
122  */
124 
126  {
127 
128  }
130  {
131 
132  }
134  {
135 
136  }
137  void PokemonMoveInfoWidget::HandleShow (bool isVisible)
138  {
139  }
140  void PokemonMoveInfoWidget::HandleChangeColor (const sf::Color& color)
141  {
142  }
144  {
145  }
146 
147 } // namespace ycl