YAPOG  0.0.1
Yet Another Pokemon Online Game
GameScreen.cpp
Go to the documentation of this file.
4 
5 namespace yap
6 {
8  : nextScreen_ (type)
9  , guiManager_ (nullptr)
10  , type_ (type)
11  {
12  }
13 
15  {
16  delete guiManager_;
17  guiManager_ = nullptr;
18  }
19 
21  {
22  HandleInit ();
23  }
24 
26  {
27  HandleActivate ();
28  }
29 
31  {
33  }
34 
36  {
38  }
39 
40  const ScreenType& GameScreen::Run (const Time& dt, IDrawingContext& context)
41  {
42  HandleRun (dt, context);
43 
44  context.SetMode ("Gui");
45 
46  guiManager_->Update (dt);
47  guiManager_->Draw (context);
48 
49  context.SetDefaultCamera ();
50 
51  return nextScreen_;
52  }
53 
55  {
56  return *guiManager_;
57  }
58 
60  {
61  return *guiManager_;
62  }
63 
65  {
66  return type_;
67  }
68 
70  {
71  return OnGameExited;
72  }
73 
74  bool GameScreen::OnEvent (const GuiEvent& guiEvent)
75  {
76  if (guiManager_->OnEvent (guiEvent))
77  return true;
78 
79  return HandleOnEvent (guiEvent);
80  }
81 
82  bool GameScreen::OnPriorityEvent (const GuiEvent& guiEvent)
83  {
84  if (HandleOnPriorityEvent (guiEvent))
85  return true;
86 
87  return guiManager_->OnPriorityEvent (guiEvent);
88  }
89 
91  {
92  OnGameExited (*this, EmptyEventArgs ());
93  }
94 
96  {
97  guiManager_ = new GuiManager ();
98  }
99 
101  const Time& dt,
102  IDrawingContext& context)
103  {
104  }
105 
107  {
108  CreateGuiManager ();
109  }
110 
112  {
113  }
114 
116  {
117  }
118 
119  bool GameScreen::HandleOnEvent (const GuiEvent& guiEvent)
120  {
121  return false;
122  }
123 
125  {
126  return false;
127  }
128 } // namespace yap