Roguelike
 All Classes Namespaces Functions Variables Typedefs Friends Pages
menu.h
1 
22 #ifndef _MENU_H
23 #define _MENU_H
24 
25 #include <iostream>
26 #include <string>
27 #include <vector>
28 #include <ASCII_Lib.h>
29 #include <defs.h>
30 #include <game_states.h>
31 #include <item.h>
32 #include <game.h>
33 #include <character.h>
34 #include <helper.h>
35 
36 using namespace tiledef;
37 using namespace std;
38 
44 class Menu {
45  public:
53 
60  Screen next_screen;
61 
65  int selection;
66 
70  string title;
71 
78 
82  vector<string> options;
83 
84 
89  bool exit;
90 
96  bool out_of_bounds(int row);
97 
102  int id;
103 
109  Menu(int _padding, Tile _border);
110 
115  void move_selection(int direction);
116 
120  int padding;
121 
127  vector<string> extra_lines;
128 
142  virtual Menu* make_selection() = 0;
143 
148  void add_item(string new_item);
149 
153  bool should_exit();
154 
158  int get_selection();
159 
163  void toggle_exit();
164 
168  Screen get_screen();
169 
173  int get_id();
174 
178  int num_extra_lines();
179 
183  vector<string> get_extra_lines();
184 };
185 
189 class StartMenu : public Menu
190 {
191  public:
197  StartMenu(int _padding, Tile _border);
198  Menu* make_selection();
199 
200 };
201 
205 class MainMenu: public Menu
206 {
207  public:
215  MainMenu(int _padding, Tile _border, Game* _game);
216  Menu* make_selection();
217 
218 
219 };
220 
226 class EquipmentMenu: public Menu
227 {
228  public:
235  EquipmentMenu(int _padding, Tile _border, Game* _game);
236  Menu* make_selection();
237 
238 
239 };
240 
246 class InventoryMenu: public Menu
247 {
248  protected:
252  vector<Item*>* items;
253  public:
254  /*
255  * Constructor for the Inventory Menu.
256  * @param _padding Sets the padding for the menu.
257  * @param _border Sets the border for the menu.
258  * @param _game Sets the game for the menu.
259  */
260  InventoryMenu(int _padding, Tile _border, Game* _game);
261  Menu* make_selection();
262 
263 };
264 
269 class ItemMenu: public Menu
270 {
271  protected:
276  public:
277  /*
278  * Constructor for the Item Menu.
279  * @param _padding Sets the padding for the menu.
280  * @param _border Sets the border for the menu.
281  * @param _game Sets the game for the menu.
282  * @param _item Sets the item for the menu.
283  */
284  ItemMenu(int _padding, Tile _border, Game* _game, Item* _item);
285  Menu* make_selection();
286 
287 };
288 
293 class EquipMenu: public Menu
294 {
295  protected:
299  int item;
300  public:
301  /*
302  * Constructor for the Equip Menu.
303  * @param _padding Sets the padding for the menu.
304  * @param _border Sets the border for the menu.
305  * @param _game Sets the game for the menu.
306  * @param _item Sets the item for the menu.
307  */
308  EquipMenu(int _padding, Tile _border, Game* _game, int _item);
309  Menu* make_selection();
310 
311 };
312 
316 class EscapeMenu: public Menu
317 {
318  public:
319  /*
320  * Constructor for the Escape Menu.
321  * @param _padding Sets the padding for the menu.
322  * @param _border Sets the border for the menu.
323  * @param _game Sets the game for the menu.
324  */
325  EscapeMenu(int _padding, Tile _border, Game* _game);
326  Menu* make_selection();
327 
328 };
329 
335 class AudioMenu: public Menu
336 {
337  public:
338  /*
339  * Constructor for the Audio Menu.
340  * @param _padding Sets the padding for the menu.
341  * @param _border Sets the border for the menu.
342  * @param _game Sets the game for the menu.
343  */
344  AudioMenu(int _padding, Tile _border, Game* _game);
345  Menu* make_selection();
346 
347 };
348 
363 class FontMenu: public Menu
364 {
365  private:
369  string font;
370  public:
371  /*
372  * Constructor for the Font Menu.
373  * @param _padding Sets the padding for the menu.
374  * @param _border Sets the border for the menu.
375  * @param _game Sets the game for the menu.
376  */
377  FontMenu(int _padding, Tile _border, Game* _game);
378  Menu* make_selection();
379 
383  string get_font();
384 };
385 
390 class InfoMenu: public Menu
391 {
392  protected:
397  public:
398  /*
399  * Constructor for the Info Menu.
400  * @param _padding Sets the padding for the menu.
401  * @param _border Sets the border for the menu.
402  * @param _game Sets the game for the menu.
403  * @param _item Sets the item for the menu.
404  */
405  InfoMenu(int _padding, Tile _border, Game* _game, Item* _item);
406  Menu* make_selection();
407 };
408 
409 #endif
string title
Definition: menu.h:70
Definition: menu.h:246
Definition: menu.h:205
Definition: menu.h:335
Definition: menu.h:293
Tile border
Definition: menu.h:77
int item
Definition: menu.h:299
int id
Definition: menu.h:102
Definition: menu.h:316
int selection
Definition: menu.h:65
string font
Definition: menu.h:369
Definition: game.h:49
vector< Item * > * items
Definition: menu.h:252
Definition: menu.h:363
bool exit
Definition: menu.h:89
Definition: defs.h:66
Definition: item.h:40
Item * item
Definition: menu.h:396
Definition: menu.h:269
Definition: menu.h:226
Item * item
Definition: menu.h:275
Definition: menu.h:44
Definition: menu.h:189
int padding
Definition: menu.h:120
vector< string > extra_lines
Definition: menu.h:127
Game * game
Definition: menu.h:52
Definition: defs.cpp:30
vector< string > options
Definition: menu.h:82
Screen next_screen
Definition: menu.h:60
Definition: menu.h:390