Removed useless class teams_manager.
This commit is contained in:
parent
bde169f28e
commit
1de088e6de
5 changed files with 5 additions and 23 deletions
|
@ -53,7 +53,6 @@ play_controller::play_controller(const config& level, game_state& state_of_game,
|
|||
int ticks, int num_turns, const config& game_config, CVideo& video,
|
||||
bool skip_replay) :
|
||||
controller_base(ticks, game_config, video),
|
||||
team_manager_(teams_),
|
||||
prefs_disp_manager_(),
|
||||
tooltips_manager_(),
|
||||
events_manager_(),
|
||||
|
|
|
@ -184,7 +184,6 @@ protected:
|
|||
int find_human_team_before(const size_t team) const;
|
||||
|
||||
//managers
|
||||
teams_manager team_manager_;
|
||||
boost::scoped_ptr<preferences::display_manager> prefs_disp_manager_;
|
||||
boost::scoped_ptr<tooltips::manager> tooltips_manager_;
|
||||
boost::scoped_ptr<game_events::manager> events_manager_;
|
||||
|
|
|
@ -381,7 +381,7 @@ LEVEL_RESULT playsingle_controller::play_scenario(
|
|||
}
|
||||
}
|
||||
|
||||
if(!team_manager_.get_teams().size())
|
||||
if (teams_.empty())
|
||||
{
|
||||
//store persistent teams
|
||||
gamestate_.snapshot = config();
|
||||
|
|
15
src/team.cpp
15
src/team.cpp
|
@ -34,24 +34,11 @@ static lg::log_domain log_engine("engine");
|
|||
#define WRN_NG LOG_STREAM(warn, log_engine)
|
||||
|
||||
|
||||
namespace {
|
||||
std::vector<team>* teams = NULL;
|
||||
}
|
||||
static std::vector<team> *&teams = resources::teams;
|
||||
|
||||
//static member initialization
|
||||
const int team::default_team_gold = 100;
|
||||
|
||||
teams_manager::teams_manager(std::vector<team>& teams_list)
|
||||
{
|
||||
assert(!teams);
|
||||
teams = &teams_list;
|
||||
}
|
||||
|
||||
teams_manager::~teams_manager()
|
||||
{
|
||||
teams = NULL;
|
||||
}
|
||||
|
||||
const std::vector<team>& teams_manager::get_teams()
|
||||
{
|
||||
assert(teams);
|
||||
|
|
|
@ -305,12 +305,9 @@ private:
|
|||
mutable std::vector<const shroud_map*> ally_shroud_, ally_fog_;
|
||||
};
|
||||
|
||||
struct teams_manager {
|
||||
teams_manager(std::vector<team>& teams);
|
||||
~teams_manager();
|
||||
|
||||
static const std::vector<team>& get_teams();
|
||||
};
|
||||
namespace teams_manager {
|
||||
const std::vector<team> &get_teams();
|
||||
}
|
||||
|
||||
namespace player_teams {
|
||||
int village_owner(const map_location& loc);
|
||||
|
|
Loading…
Add table
Reference in a new issue