Roguelike
 All Classes Namespaces Functions Variables Typedefs Friends Pages
Public Member Functions | Protected Attributes | List of all members
EquipMenu Class Reference

#include <menu.h>

Inheritance diagram for EquipMenu:
Menu

Public Member Functions

 EquipMenu (int _padding, Tile _border, Game *_game, int _item)
 
Menumake_selection ()
 
- Public Member Functions inherited from Menu
bool out_of_bounds (int row)
 
 Menu (int _padding, Tile _border)
 
void move_selection (int direction)
 
void add_item (string new_item)
 
bool should_exit ()
 
int get_selection ()
 
void toggle_exit ()
 
Screen get_screen ()
 
int get_id ()
 
int num_extra_lines ()
 
vector< string > get_extra_lines ()
 

Protected Attributes

int item
 

Additional Inherited Members

- Public Attributes inherited from Menu
Gamegame
 
Screen next_screen
 
int selection
 
string title
 
Tile border
 
vector< string > options
 
bool exit
 
int id
 
int padding
 
vector< string > extra_lines
 

Detailed Description

The menu which is brought up when a player selects and item from the EquipmentMenu. This menu allows players to interact with the items that they currently have equipped.

Member Function Documentation

Menu * EquipMenu::make_selection ( )
virtual

The function that handles when a selection is made in the menu. This is the most important function. There are four possibilities:

  1. The selection just transitions to a new menu. The menu returned will be the new menu.
  2. The selection just performs a function and then returns to the same menu. In this case, "this" will be returned and nothing else will happen.
  3. The selection causes an exit of the menu screen. When this happens, "this" will be returned and should_exit will be toggled. On the next pass, the game_state will then transition to the next_screen.
  4. The function returns NULL, in which case the game is exited. There's no reason that 2 & 3 can't be combined.

Implements Menu.

Member Data Documentation

int EquipMenu::item
protected

The index in the main_character's equipment to act on.


The documentation for this class was generated from the following files: