ScummVM API documentation
stats.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef ULTIMA4_VIEWS_STATS_H
23 #define ULTIMA4_VIEWS_STATS_H
24 
25 #include "ultima/ultima4/core/observable.h"
26 #include "ultima/ultima4/core/observer.h"
27 #include "ultima/ultima4/views/menu.h"
28 #include "ultima/ultima4/views/textview.h"
29 
30 namespace Ultima {
31 namespace Ultima4 {
32 
33 struct SaveGame;
34 class Aura;
35 class Ingredients;
36 class Menu;
37 class MenuEvent;
38 class Party;
39 class PartyEvent;
40 
41 #define STATS_AREA_WIDTH 15
42 #define STATS_AREA_HEIGHT 8
43 #define STATS_AREA_X TEXT_AREA_X
44 #define STATS_AREA_Y 1
45 
46 enum StatsView {
47  STATS_PARTY_OVERVIEW,
48  STATS_CHAR1,
49  STATS_CHAR2,
50  STATS_CHAR3,
51  STATS_CHAR4,
52  STATS_CHAR5,
53  STATS_CHAR6,
54  STATS_CHAR7,
55  STATS_CHAR8,
56  STATS_WEAPONS,
57  STATS_ARMOR,
58  STATS_EQUIPMENT,
59  STATS_ITEMS,
60  STATS_REAGENTS,
61  STATS_MIXTURES,
62  MIX_REAGENTS
63 };
64 
65 class StatsArea : public Observer<Aura *>, public Observer<Party *, PartyEvent &>,
66  public Observer<Menu *, MenuEvent &>, public Observable<StatsArea *, Common::String> {
67 public:
68  StatsArea();
69 
70  void setView(StatsView view);
71 
72  void clear();
73 
77  void prevItem();
78 
82  void nextItem();
83 
87  virtual void update(bool avatarOnly = false);
88  void update(Aura *observable, NoArg *arg) override;
89  void update(Aura *aura) override;
90  void update(Party *party, PartyEvent &event) override;
91  void update(Menu *menu, MenuEvent &event) override;
92 
93  void highlightPlayer(int player);
94 
98  void redraw();
99 
100  TextView *getMainArea() {
101  return &_mainArea;
102  }
103 
104  void resetReagentsMenu();
105  Menu *getReagentsMenu() {
106  return &_reagentsMixMenu;
107  }
108 
109 private:
113  void showPartyView(bool avatarOnly);
114 
118  void showPlayerDetails();
119 
123  void showWeapons();
124 
128  void showArmor();
129 
133  void showEquipment();
134 
138  void showItems();
139 
143  void showReagents(bool active = false);
144 
148  void showMixtures();
149 
153  void setTitle(const Common::String &s);
154 
155  TextView _title;
156  TextView _mainArea;
157  TextView _summary;
158 
159  StatsView _view;
160 
161  Menu _reagentsMixMenu;
162 };
163 
164 } // End of namespace Ultima4
165 } // End of namespace Ultima
166 
167 #endif
virtual void update(bool avatarOnly=false)
Definition: str.h:59
Definition: menu.h:37
Definition: observer.h:37
Definition: observer.h:61
Definition: stats.h:65
Definition: textview.h:41
Definition: player.h:262
Definition: detection.h:27
Definition: player.h:285
Definition: menu.h:72
Definition: aura.h:33
Definition: observable.h:45