Move the function out of the header, and correct related dependencies.

This commit is contained in:
Guillaume Melquiond 2005-03-26 17:24:42 +00:00
parent d501297a65
commit 2424ad048b
3 changed files with 11 additions and 11 deletions

View file

@ -33,6 +33,15 @@
#include <iterator>
#include <sstream>
player_info* game_state::get_player(const std::string& id) {
std::map< std::string, player_info >::iterator found = players.find(id);
if (found == players.end()) {
LOG_STREAM(warn, engine) << "player " << id << " does not exist.\n";
return NULL;
} else
return &found->second;
}
time_of_day::time_of_day(const config& cfg)
: lawful_bonus(atoi(cfg["lawful_bonus"].c_str())),
image(cfg["image"]), name(cfg["name"]), id(cfg["id"]),

View file

@ -13,7 +13,6 @@
#ifndef GAME_STATUS_HPP_INCLUDED
#define GAME_STATUS_HPP_INCLUDED
#include "log.hpp"
#include "unit.hpp"
#include <time.h>
@ -112,16 +111,7 @@ struct game_state
std::map<std::string, player_info> players;
// Return the Nth player, or NULL if no such player exists
player_info* get_player(const std::string& id) {
std::map<std::string, player_info>::iterator found=players.find(id);
if(found==players.end()) {
LOG_STREAM(warn, engine) << "player " << id << " does not exist." << std::endl;
return NULL;
} else {
return &found->second;
}
}
player_info* get_player(const std::string& id);
config variables; //variables that have been set
std::string difficulty; //the difficulty level the game is being played on.

View file

@ -17,6 +17,7 @@
#include "font.hpp"
#include "game_config.hpp"
#include "gettext.hpp"
#include "log.hpp"
#include "multiplayer_connect.hpp"
#include "preferences.hpp"
#include "replay.hpp"