Skip to content

Commit

Permalink
menu handler uses game_board in it's constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeck88 committed Jun 8, 2014
1 parent 57cc44b commit 358531e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/game_board.hpp
Expand Up @@ -28,6 +28,7 @@ class config;

namespace events {
class mouse_handler;
class menu_handler;
}

/**
Expand Down Expand Up @@ -58,6 +59,7 @@ class game_board {
friend class playsingle_controller;
friend class playmp_controller;
friend class events::mouse_handler;
friend class events::menu_handler;

friend class game_display;
/**
Expand Down
11 changes: 6 additions & 5 deletions src/menu_events.cpp
Expand Up @@ -30,6 +30,7 @@
#include "dialogs.hpp"
#include "formatter.hpp"
#include "filechooser.hpp"
#include "game_board.hpp"
#include "game_end_exceptions.hpp"
#include "game_events/pump.hpp"
#include "game_preferences.hpp"
Expand Down Expand Up @@ -80,14 +81,14 @@ static lg::log_domain log_engine("engine");

namespace events{

menu_handler::menu_handler(game_display* gui, unit_map& units, std::vector<team>& teams,
const config& level, const gamemap& map,
menu_handler::menu_handler(game_display* gui, game_board & board,
const config& level,
const config& game_config, game_state& gamestate) :
gui_(gui),
units_(units),
teams_(teams),
units_(board.units_),
teams_(board.teams_),
level_(level),
map_(map),
map_(board.map()),
game_config_(game_config),
gamestate_(gamestate),
textbox_info_(),
Expand Down
5 changes: 3 additions & 2 deletions src/menu_events.hpp
Expand Up @@ -21,6 +21,7 @@
#include "floating_textbox.hpp"
#include "unit_map.hpp"

class game_board;
class game_state;
class gamemap;

Expand All @@ -34,8 +35,8 @@ namespace events {

class menu_handler : private chat_handler {
public:
menu_handler(game_display* gui, unit_map& units, std::vector<team>& teams,
const config& level, const gamemap& map,
menu_handler(game_display* gui, game_board & board,
const config& level,
const config& game_config, game_state& gamestate);
virtual ~menu_handler();

Expand Down
2 changes: 1 addition & 1 deletion src/play_controller.cpp
Expand Up @@ -108,7 +108,7 @@ play_controller::play_controller(const config& level, game_state& state_of_game,
labels_manager_(),
help_manager_(&game_config),
mouse_handler_(NULL, gameboard_),
menu_handler_(NULL, gameboard_.units_, gameboard_.teams_, level, gameboard_.map_, game_config, state_of_game),
menu_handler_(NULL, gameboard_, level, game_config, state_of_game),
soundsources_manager_(),
tod_manager_(level),
pathfind_manager_(),
Expand Down

0 comments on commit 358531e

Please sign in to comment.