[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src actions.cpp dialogs.cpp display.cpp...
From: |
Yann Dirson |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src actions.cpp dialogs.cpp display.cpp... |
Date: |
Tue, 22 Mar 2005 18:42:37 -0500 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Yann Dirson <address@hidden> 05/03/22 23:42:37
Modified files:
src : actions.cpp dialogs.cpp display.cpp display.hpp
game.cpp game_events.cpp gamestatus.cpp
gamestatus.hpp pathfind.cpp playlevel.cpp
playlevel.hpp playturn.cpp playturn.hpp
replay.hpp reports.cpp reports.hpp team.cpp
team.hpp unit.cpp unit_display.cpp
unit_types.cpp
src/editor : editor.cpp editor_main.cpp
Added files:
src : game_errors.hpp
Log message:
split a game exceptions into their own file to avoid gratuitous
dependencies on gamestatus, some cleanup of deps against gamestatus
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/game_errors.hpp?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/actions.cpp.diff?tr1=1.199&tr2=1.200&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/dialogs.cpp.diff?tr1=1.92&tr2=1.93&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/display.cpp.diff?tr1=1.305&tr2=1.306&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/display.hpp.diff?tr1=1.98&tr2=1.99&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/game.cpp.diff?tr1=1.211&tr2=1.212&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/game_events.cpp.diff?tr1=1.132&tr2=1.133&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/gamestatus.cpp.diff?tr1=1.60&tr2=1.61&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/gamestatus.hpp.diff?tr1=1.38&tr2=1.39&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/pathfind.cpp.diff?tr1=1.63&tr2=1.64&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/playlevel.cpp.diff?tr1=1.189&tr2=1.190&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/playlevel.hpp.diff?tr1=1.21&tr2=1.22&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/playturn.cpp.diff?tr1=1.348&tr2=1.349&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/playturn.hpp.diff?tr1=1.65&tr2=1.66&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/replay.hpp.diff?tr1=1.30&tr2=1.31&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/reports.cpp.diff?tr1=1.62&tr2=1.63&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/reports.hpp.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/team.cpp.diff?tr1=1.84&tr2=1.85&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/team.hpp.diff?tr1=1.55&tr2=1.56&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/unit.cpp.diff?tr1=1.130&tr2=1.131&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/unit_display.cpp.diff?tr1=1.54&tr2=1.55&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/unit_types.cpp.diff?tr1=1.90&tr2=1.91&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/editor/editor.cpp.diff?tr1=1.97&tr2=1.98&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/editor/editor_main.cpp.diff?tr1=1.29&tr2=1.30&r1=text&r2=text
Patches:
Index: wesnoth/src/actions.cpp
diff -u wesnoth/src/actions.cpp:1.199 wesnoth/src/actions.cpp:1.200
--- wesnoth/src/actions.cpp:1.199 Mon Mar 21 20:46:26 2005
+++ wesnoth/src/actions.cpp Tue Mar 22 23:42:36 2005
@@ -1,4 +1,4 @@
-/* $Id: actions.cpp,v 1.199 2005/03/21 20:46:26 ydirson Exp $ */
+/* $Id: actions.cpp,v 1.200 2005/03/22 23:42:36 ydirson Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -17,6 +17,7 @@
#include "display.hpp"
#include "events.hpp"
#include "game_config.hpp"
+#include "game_errors.hpp"
#include "game_events.hpp"
#include "gettext.hpp"
#include "halo.hpp"
@@ -1278,7 +1279,7 @@
if(new_type != info.unit_types.end() && un != units.end()) {
return unit(&(new_type->second),un->second);
} else {
- throw gamestatus::game_error("Could not find the unit being
advanced"
+ throw game::game_error("Could not find the unit being advanced"
" to: " + advance_to);
}
}
Index: wesnoth/src/dialogs.cpp
diff -u wesnoth/src/dialogs.cpp:1.92 wesnoth/src/dialogs.cpp:1.93
--- wesnoth/src/dialogs.cpp:1.92 Sat Mar 19 14:54:00 2005
+++ wesnoth/src/dialogs.cpp Tue Mar 22 23:42:36 2005
@@ -1,4 +1,4 @@
-/* $Id: dialogs.cpp,v 1.92 2005/03/19 14:54:00 silene Exp $ */
+/* $Id: dialogs.cpp,v 1.93 2005/03/22 23:42:36 ydirson Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -18,6 +18,7 @@
#include "filesystem.hpp"
#include "font.hpp"
#include "game_config.hpp"
+#include "game_errors.hpp"
#include "gettext.hpp"
#include "help.hpp"
#include "language.hpp"
@@ -482,7 +483,7 @@
} catch(config::error&) {
summary["corrupt"] = "yes";
ERR_G << "save '" << games[*s].name << "' could
not be loaded (config parse error)\n";
- } catch(gamestatus::load_game_failed&) {
+ } catch(game::load_game_failed&) {
summary["corrupt"] = "yes";
ERR_G << "save '" << games[*s].name << "' could
not be loaded (load_game_failed exception)\n";
}
Index: wesnoth/src/display.cpp
diff -u wesnoth/src/display.cpp:1.305 wesnoth/src/display.cpp:1.306
--- wesnoth/src/display.cpp:1.305 Sat Mar 19 22:18:18 2005
+++ wesnoth/src/display.cpp Tue Mar 22 23:42:36 2005
@@ -1,4 +1,4 @@
-/* $Id: display.cpp,v 1.305 2005/03/19 22:18:18 gruikya Exp $ */
+/* $Id: display.cpp,v 1.306 2005/03/22 23:42:36 ydirson Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -18,6 +18,7 @@
#include "events.hpp"
#include "font.hpp"
#include "game_config.hpp"
+#include "gamestatus.hpp"
#include "gettext.hpp"
#include "halo.hpp"
#include "hotkeys.hpp"
Index: wesnoth/src/display.hpp
diff -u wesnoth/src/display.hpp:1.98 wesnoth/src/display.hpp:1.99
--- wesnoth/src/display.hpp:1.98 Wed Mar 16 21:49:37 2005
+++ wesnoth/src/display.hpp Tue Mar 22 23:42:36 2005
@@ -1,4 +1,4 @@
-/* $Id: display.hpp,v 1.98 2005/03/16 21:49:37 ydirson Exp $ */
+/* $Id: display.hpp,v 1.99 2005/03/22 23:42:36 ydirson Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -14,7 +14,7 @@
#define DISPLAY_H_INCLUDED
class config;
-#include "gamestatus.hpp"
+class gamestatus;
#include "image.hpp"
#include "key.hpp"
#include "map.hpp"
Index: wesnoth/src/editor/editor.cpp
diff -u wesnoth/src/editor/editor.cpp:1.97 wesnoth/src/editor/editor.cpp:1.98
--- wesnoth/src/editor/editor.cpp:1.97 Wed Mar 9 22:58:18 2005
+++ wesnoth/src/editor/editor.cpp Tue Mar 22 23:42:37 2005
@@ -19,7 +19,6 @@
#include "../filesystem.hpp"
#include "../font.hpp"
#include "../game_config.hpp"
-#include "../gamestatus.hpp"
#include "../gettext.hpp"
#include "../key.hpp"
#include "../widgets/menu.hpp"
Index: wesnoth/src/editor/editor_main.cpp
diff -u wesnoth/src/editor/editor_main.cpp:1.29
wesnoth/src/editor/editor_main.cpp:1.30
--- wesnoth/src/editor/editor_main.cpp:1.29 Wed Mar 9 23:30:28 2005
+++ wesnoth/src/editor/editor_main.cpp Tue Mar 22 23:42:37 2005
@@ -17,6 +17,7 @@
#include "../filesystem.hpp"
#include "../font.hpp"
#include "../game_config.hpp"
+#include "../gamestatus.hpp"
#include "../gettext.hpp"
#include "../image.hpp"
#include "../language.hpp"
Index: wesnoth/src/game.cpp
diff -u wesnoth/src/game.cpp:1.211 wesnoth/src/game.cpp:1.212
--- wesnoth/src/game.cpp:1.211 Sun Mar 20 22:06:04 2005
+++ wesnoth/src/game.cpp Tue Mar 22 23:42:36 2005
@@ -1,4 +1,4 @@
-/* $Id: game.cpp,v 1.211 2005/03/20 22:06:04 Sirp Exp $ */
+/* $Id: game.cpp,v 1.212 2005/03/22 23:42:36 ydirson Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -26,6 +26,7 @@
#include "filesystem.hpp"
#include "font.hpp"
#include "game_config.hpp"
+#include "game_errors.hpp"
#include "game_events.hpp"
#include "gamestatus.hpp"
#include "gettext.hpp"
@@ -147,7 +148,7 @@
config snapshot;
recorder.save_game(label, snapshot, state.starting_pos);
- }
catch(gamestatus::save_game_failed&) {
+ }
catch(game::save_game_failed&) {
gui::show_error_message(disp, _("The game could not be saved"));
retry = true;
};
@@ -169,10 +170,10 @@
if(res != VICTORY) {
return res;
}
- } catch(gamestatus::load_game_failed& e) {
+ } catch(game::load_game_failed& e) {
gui::show_error_message(disp, _("The game could not be
loaded: ") + e.message);
return QUIT;
- } catch(gamestatus::game_error& e) {
+ } catch(game::game_error& e) {
gui::show_error_message(disp, _("Error while playing
the game: ") + e.message);
return QUIT;
} catch(gamemap::incorrect_format_exception& e) {
@@ -204,7 +205,7 @@
if(should_save == 0) {
try {
save_game(state);
- } catch(gamestatus::save_game_failed&) {
+ } catch(game::save_game_failed&) {
gui::show_error_message(disp,
_("The game could not be saved"));
retry = true;
}
@@ -788,9 +789,9 @@
try {
play_level(units_data_,game_config_,&level,video_,state_,story);
- } catch(gamestatus::error& e) {
+ } catch(game::error& e) {
std::cerr << "caught error: '" << e.message << "'\n";
- } catch(gamestatus::load_game_exception& e) {
+ } catch(game::load_game_exception& e) {
//the user's trying to load a game, so go into the normal title
screen loop and load one
loaded_game_ = e.game;
loaded_game_show_replay_ = e.show_replay;
@@ -853,7 +854,7 @@
}
}
- } catch(gamestatus::error& e) {
+ } catch(game::error& e) {
gui::show_error_message(disp(), _("The file you have tried to
load is corrupt: '") + e.message + '\'');
return false;
} catch(config::error& e) {
@@ -913,11 +914,11 @@
try {
play_level(units_data_,game_config_,&starting_pos,video_,state_,story);
recorder.clear();
- } catch(gamestatus::load_game_failed& e) {
+ } catch(game::load_game_failed& e) {
gui::show_error_message(disp(), _("The game could not
be loaded: ") + e.message);
- } catch(gamestatus::game_error& e) {
+ } catch(game::game_error& e) {
gui::show_error_message(disp(), _("Error while playing
the game: ") + e.message);
- } catch(gamestatus::load_game_exception& e) {
+ } catch(game::load_game_exception& e) {
//this will make it so next time through the title
screen loop, this game is loaded
loaded_game_ = e.game;
loaded_game_show_replay_ = e.show_replay;
@@ -1327,9 +1328,9 @@
mp::start_client(disp(), game_config_, units_data_,
host);
}
- } catch(gamestatus::load_game_failed& e) {
+ } catch(game::load_game_failed& e) {
gui::show_error_message(disp(), _("The game could not be
loaded: ") + e.message);
- } catch(gamestatus::game_error& e) {
+ } catch(game::game_error& e) {
gui::show_error_message(disp(), _("Error while playing the
game: ") + e.message);
} catch(network::error& e) {
std::cerr << "caught network error...\n";
@@ -1343,7 +1344,7 @@
}
} catch(gamemap::incorrect_format_exception& e) {
gui::show_error_message(disp(), std::string(_("The game map
could not be loaded: ")) + e.msg_);
- } catch(gamestatus::load_game_exception& e) {
+ } catch(game::load_game_exception& e) {
//this will make it so next time through the title screen loop,
this game is loaded
loaded_game_ = e.game;
loaded_game_show_replay_ = e.show_replay;
@@ -1436,7 +1437,7 @@
the_end(disp().video());
about::show_about(disp().video());
}
- } catch(gamestatus::load_game_exception& e) {
+ } catch(game::load_game_exception& e) {
//this will make it so next time through the title screen loop,
this game is loaded
loaded_game_ = e.game;
Index: wesnoth/src/game_events.cpp
diff -u wesnoth/src/game_events.cpp:1.132 wesnoth/src/game_events.cpp:1.133
--- wesnoth/src/game_events.cpp:1.132 Sat Mar 19 21:26:30 2005
+++ wesnoth/src/game_events.cpp Tue Mar 22 23:42:36 2005
@@ -1,4 +1,4 @@
-/* $Id: game_events.cpp,v 1.132 2005/03/19 21:26:30 gruikya Exp $ */
+/* $Id: game_events.cpp,v 1.133 2005/03/22 23:42:36 ydirson Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -15,6 +15,7 @@
#include "ai.hpp"
#include "display.hpp"
+#include "game_errors.hpp"
#include "game_events.hpp"
#include "image.hpp"
#include "language.hpp"
@@ -1283,7 +1284,7 @@
<< " and the map location is
invalid.\n";
}
}
- } catch(gamestatus::load_game_failed& e) {
+ } catch(game::load_game_failed& e) {
ERR_NG << "could not de-serialize unit: '" << e.message
<< "'\n";
}
}
Index: wesnoth/src/gamestatus.cpp
diff -u wesnoth/src/gamestatus.cpp:1.60 wesnoth/src/gamestatus.cpp:1.61
--- wesnoth/src/gamestatus.cpp:1.60 Sun Mar 20 12:05:53 2005
+++ wesnoth/src/gamestatus.cpp Tue Mar 22 23:42:36 2005
@@ -1,4 +1,4 @@
-/* $Id: gamestatus.cpp,v 1.60 2005/03/20 12:05:53 gruikya Exp $ */
+/* $Id: gamestatus.cpp,v 1.61 2005/03/22 23:42:36 ydirson Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -15,6 +15,7 @@
#include "filesystem.hpp"
#include "game_config.hpp"
+#include "game_errors.hpp"
#include "gamestatus.hpp"
#include "language.hpp"
#include "log.hpp"
@@ -426,7 +427,7 @@
if(cfg.empty()) {
std::cerr << "Could not parse file data into config\n";
- throw gamestatus::load_game_failed();
+ throw game::load_game_failed();
}
}
@@ -440,7 +441,7 @@
state = read_game(data,&cfg);
}
-//throws gamestatus::save_game_failed
+//throws game::save_game_failed
void save_game(const game_state& state)
{
log_scope("save_game");
@@ -464,7 +465,7 @@
write_save_index();
} catch(io_exception& e) {
- throw gamestatus::save_game_failed(e.what());
+ throw game::save_game_failed(e.what());
}
}
Index: wesnoth/src/gamestatus.hpp
diff -u wesnoth/src/gamestatus.hpp:1.38 wesnoth/src/gamestatus.hpp:1.39
--- wesnoth/src/gamestatus.hpp:1.38 Thu Mar 10 00:00:06 2005
+++ wesnoth/src/gamestatus.hpp Tue Mar 22 23:42:36 2005
@@ -1,4 +1,4 @@
-/* $Id: gamestatus.hpp,v 1.38 2005/03/10 00:00:06 ydirson Exp $ */
+/* $Id: gamestatus.hpp,v 1.39 2005/03/22 23:42:36 ydirson Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -63,40 +63,6 @@
//has expired.
bool next_turn();
- struct error {
- error() {}
- error(const std::string& msg) : message(msg)
- {}
-
- std::string message;
- };
-
- //an exception object used when loading a game fails.
- struct load_game_failed : public error {
- load_game_failed() {}
- load_game_failed(const std::string& msg) :
error("load_game_failed: " + msg) {}
- };
-
- //an exception object used when saving a game fails.
- struct save_game_failed : public error {
- save_game_failed() {}
- save_game_failed(const std::string& msg) :
error("save_game_failed: " + msg) {}
- };
-
- //an exception object used for any general game error.
- //e.g. data files are corrupt.
- struct game_error : public error {
- game_error(const std::string& msg) : error("game_error: " +
msg) {}
- };
-
- //an exception object used to signal that the user has decided to abort
- //a game, and load another game instead
- struct load_game_exception {
- load_game_exception(const std::string& game, bool show_replay)
: game(game), show_replay(show_replay) {}
- std::string game;
- bool show_replay;
- };
-
private:
const time_of_day& get_time_of_day_turn(int nturn) const;
Index: wesnoth/src/pathfind.cpp
diff -u wesnoth/src/pathfind.cpp:1.63 wesnoth/src/pathfind.cpp:1.64
--- wesnoth/src/pathfind.cpp:1.63 Thu Mar 10 20:17:17 2005
+++ wesnoth/src/pathfind.cpp Tue Mar 22 23:42:36 2005
@@ -1,4 +1,4 @@
-/* $Id: pathfind.cpp,v 1.63 2005/03/10 20:17:17 ydirson Exp $ */
+/* $Id: pathfind.cpp,v 1.64 2005/03/22 23:42:36 ydirson Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -13,13 +13,15 @@
#include "global.hpp"
+#include "astarnode.hpp"
#include "gamestatus.hpp"
#include "log.hpp"
#include "pathfind.hpp"
#include "util.hpp"
-#include "astarnode.hpp"
#include "wassert.hpp"
+class gamestatus;
+
#include <cmath>
#include <iostream>
Index: wesnoth/src/playlevel.cpp
diff -u wesnoth/src/playlevel.cpp:1.189 wesnoth/src/playlevel.cpp:1.190
--- wesnoth/src/playlevel.cpp:1.189 Tue Mar 22 22:09:28 2005
+++ wesnoth/src/playlevel.cpp Tue Mar 22 23:42:36 2005
@@ -1,4 +1,4 @@
-/* $Id: playlevel.cpp,v 1.189 2005/03/22 22:09:28 ydirson Exp $ */
+/* $Id: playlevel.cpp,v 1.190 2005/03/22 23:42:36 ydirson Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -18,6 +18,8 @@
#include "dialogs.hpp"
#include "events.hpp"
#include "filesystem.hpp"
+#include "game_errors.hpp"
+#include "gamestatus.hpp"
#include "gettext.hpp"
#include "game_events.hpp"
#include "halo.hpp"
@@ -284,11 +286,11 @@
}
if(map.empty()) {
- throw gamestatus::load_game_failed("Map not
found");
+ throw game::load_game_failed("Map not found");
}
if(!start_pos.valid() && new_unit.side() == 1) {
- throw gamestatus::load_game_failed("No starting
position for side 1");
+ throw game::load_game_failed("No starting
position for side 1");
}
if(start_pos.valid()) {
Index: wesnoth/src/playlevel.hpp
diff -u wesnoth/src/playlevel.hpp:1.21 wesnoth/src/playlevel.hpp:1.22
--- wesnoth/src/playlevel.hpp:1.21 Sat Mar 19 10:26:43 2005
+++ wesnoth/src/playlevel.hpp Tue Mar 22 23:42:36 2005
@@ -1,4 +1,4 @@
-/* $Id: playlevel.hpp,v 1.21 2005/03/19 10:26:43 gruikya Exp $ */
+/* $Id: playlevel.hpp,v 1.22 2005/03/22 23:42:36 ydirson Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -15,9 +15,9 @@
class config;
class CVideo;
+struct game_state;
#include "game_config.hpp"
-#include "gamestatus.hpp"
#include "unit_types.hpp"
#include <vector>
Index: wesnoth/src/playturn.cpp
diff -u wesnoth/src/playturn.cpp:1.348 wesnoth/src/playturn.cpp:1.349
--- wesnoth/src/playturn.cpp:1.348 Tue Mar 22 12:53:23 2005
+++ wesnoth/src/playturn.cpp Tue Mar 22 23:42:36 2005
@@ -1,4 +1,4 @@
-/* $Id: playturn.cpp,v 1.348 2005/03/22 12:53:23 j_daniel Exp $ */
+/* $Id: playturn.cpp,v 1.349 2005/03/22 23:42:36 ydirson Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -16,6 +16,7 @@
#include "actions.hpp"
#include "dialogs.hpp"
#include "events.hpp"
+#include "game_errors.hpp"
#include "game_events.hpp"
#include "gettext.hpp"
#include "help.hpp"
@@ -1288,7 +1289,7 @@
write_game_snapshot(snapshot);
try {
recorder.save_game(_("Auto-Save"), snapshot,
state_of_game_.starting_pos);
- } catch(gamestatus::save_game_failed&) {
+ } catch(game::save_game_failed&) {
gui::show_dialog(gui_,NULL,"",_("Could not auto save the game.
Please save the game manually."),gui::MESSAGE);
//do not bother retrying, since the user can just save the game
}
@@ -1507,7 +1508,7 @@
bool show_replay = false;
const std::string game =
dialogs::load_game_dialog(gui_,terrain_config_,gameinfo_,&show_replay);
if(game != "") {
- throw gamestatus::load_game_exception(game,show_replay);
+ throw game::load_game_exception(game,show_replay);
}
}
@@ -1551,7 +1552,7 @@
if(dialog_type != gui::NULL_DIALOG) {
gui::show_dialog(gui_,NULL,_("Saved"),_("The
game has been saved"), gui::OK_ONLY);
}
- } catch(gamestatus::save_game_failed&) {
+ } catch(game::save_game_failed&) {
gui::show_dialog(gui_,NULL,_("Error"),_("The game could
not be saved"),gui::MESSAGE);
//do not bother retrying, since the user can just try
to save the game again
};
Index: wesnoth/src/playturn.hpp
diff -u wesnoth/src/playturn.hpp:1.65 wesnoth/src/playturn.hpp:1.66
--- wesnoth/src/playturn.hpp:1.65 Sat Mar 19 10:26:43 2005
+++ wesnoth/src/playturn.hpp Tue Mar 22 23:42:37 2005
@@ -1,4 +1,4 @@
-/* $Id: playturn.hpp,v 1.65 2005/03/19 10:26:43 gruikya Exp $ */
+/* $Id: playturn.hpp,v 1.66 2005/03/22 23:42:37 ydirson Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -13,13 +13,13 @@
#ifndef PLAYTURN_HPP_INCLUDED
#define PLAYTURN_HPP_INCLUDED
-class gamestatus;
class replay_network_sender;
#include "actions.hpp"
#include "config.hpp"
#include "display.hpp"
#include "events.hpp"
+#include "gamestatus.hpp"
#include "hotkeys.hpp"
#include "key.hpp"
#include "scoped_resource.hpp"
Index: wesnoth/src/replay.hpp
diff -u wesnoth/src/replay.hpp:1.30 wesnoth/src/replay.hpp:1.31
--- wesnoth/src/replay.hpp:1.30 Tue Mar 22 22:09:28 2005
+++ wesnoth/src/replay.hpp Tue Mar 22 23:42:37 2005
@@ -1,4 +1,4 @@
-/* $Id: replay.hpp,v 1.30 2005/03/22 22:09:28 ydirson Exp $ */
+/* $Id: replay.hpp,v 1.31 2005/03/22 23:42:37 ydirson Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -14,9 +14,9 @@
#define REPLAY_H_INCLUDED
class display;
+class gamestatus;
#include "config.hpp"
-#include "gamestatus.hpp"
#include "map.hpp"
#include "random.hpp"
#include "unit.hpp"
Index: wesnoth/src/reports.cpp
diff -u wesnoth/src/reports.cpp:1.62 wesnoth/src/reports.cpp:1.63
--- wesnoth/src/reports.cpp:1.62 Wed Mar 9 22:58:18 2005
+++ wesnoth/src/reports.cpp Tue Mar 22 23:42:37 2005
@@ -3,6 +3,7 @@
#include "actions.hpp"
#include "font.hpp"
#include "game_config.hpp"
+#include "gamestatus.hpp"
#include "gettext.hpp"
#include "language.hpp"
#include "reports.hpp"
Index: wesnoth/src/reports.hpp
diff -u wesnoth/src/reports.hpp:1.11 wesnoth/src/reports.hpp:1.12
--- wesnoth/src/reports.hpp:1.11 Sun Nov 28 11:46:57 2004
+++ wesnoth/src/reports.hpp Tue Mar 22 23:42:37 2005
@@ -5,7 +5,8 @@
#include <string>
#include <vector>
-#include "gamestatus.hpp"
+class gamestatus;
+
#include "map.hpp"
#include "team.hpp"
#include "unit.hpp"
Index: wesnoth/src/team.cpp
diff -u wesnoth/src/team.cpp:1.84 wesnoth/src/team.cpp:1.85
--- wesnoth/src/team.cpp:1.84 Tue Mar 22 22:09:28 2005
+++ wesnoth/src/team.cpp Tue Mar 22 23:42:37 2005
@@ -1,4 +1,4 @@
-/* $Id: team.cpp,v 1.84 2005/03/22 22:09:28 ydirson Exp $ */
+/* $Id: team.cpp,v 1.85 2005/03/22 23:42:37 ydirson Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -15,7 +15,7 @@
#include "game_config.hpp"
#include "game_events.hpp"
-#include "gamestatus.hpp"
+#include "game_errors.hpp"
#include "log.hpp"
#include "network.hpp"
#include "team.hpp"
@@ -718,7 +718,7 @@
}
if(side < 1 || side > int(teams->size())) {
- throw gamestatus::game_error("invalid side found in unit
definition");
+ throw game::game_error("invalid side found in unit definition");
}
}
Index: wesnoth/src/team.hpp
diff -u wesnoth/src/team.hpp:1.55 wesnoth/src/team.hpp:1.56
--- wesnoth/src/team.hpp:1.55 Sat Mar 19 21:26:30 2005
+++ wesnoth/src/team.hpp Tue Mar 22 23:42:37 2005
@@ -1,4 +1,4 @@
-/* $Id: team.hpp,v 1.55 2005/03/19 21:26:30 gruikya Exp $ */
+/* $Id: team.hpp,v 1.56 2005/03/22 23:42:37 ydirson Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -16,6 +16,8 @@
#include "config.hpp"
#include "map.hpp"
+struct time_of_day;
+
#include <set>
#include <string>
#include <vector>
@@ -234,8 +236,8 @@
bool is_observer();
-//function which will validate a side. Throws gamestatus::game_error
+//function which will validate a side. Throws game::game_error
//if the side is invalid
-void validate_side(int side); //throw gamestatus::game_error
+void validate_side(int side); //throw game::game_error
#endif
Index: wesnoth/src/unit.cpp
diff -u wesnoth/src/unit.cpp:1.130 wesnoth/src/unit.cpp:1.131
--- wesnoth/src/unit.cpp:1.130 Tue Mar 22 22:09:28 2005
+++ wesnoth/src/unit.cpp Tue Mar 22 23:42:37 2005
@@ -1,4 +1,4 @@
-/* $Id: unit.cpp,v 1.130 2005/03/22 22:09:28 ydirson Exp $ */
+/* $Id: unit.cpp,v 1.131 2005/03/22 23:42:37 ydirson Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -14,7 +14,7 @@
#include "global.hpp"
#include "game_config.hpp"
-#include "gamestatus.hpp"
+#include "game_errors.hpp"
#include "gettext.hpp"
#include "log.hpp"
#include "pathfind.hpp"
@@ -601,7 +601,7 @@
if(i != data.unit_types.end())
type_ = &i->second;
else
- throw gamestatus::load_game_failed("Unit not found: '" +
cfg["type"] + "'");
+ throw game::load_game_failed("Unit not found: '" + cfg["type"]
+ "'");
wassert(type_ != NULL);
Index: wesnoth/src/unit_display.cpp
diff -u wesnoth/src/unit_display.cpp:1.54 wesnoth/src/unit_display.cpp:1.55
--- wesnoth/src/unit_display.cpp:1.54 Tue Mar 22 01:49:40 2005
+++ wesnoth/src/unit_display.cpp Tue Mar 22 23:42:37 2005
@@ -4,6 +4,7 @@
#include "display.hpp"
#include "events.hpp"
#include "game_config.hpp"
+#include "gamestatus.hpp"
#include "halo.hpp"
#include "image.hpp"
#include "log.hpp"
Index: wesnoth/src/unit_types.cpp
diff -u wesnoth/src/unit_types.cpp:1.90 wesnoth/src/unit_types.cpp:1.91
--- wesnoth/src/unit_types.cpp:1.90 Tue Mar 22 01:14:14 2005
+++ wesnoth/src/unit_types.cpp Tue Mar 22 23:42:37 2005
@@ -1,4 +1,4 @@
-/* $Id: unit_types.cpp,v 1.90 2005/03/22 01:14:14 Sirp Exp $ */
+/* $Id: unit_types.cpp,v 1.91 2005/03/22 23:42:37 ydirson Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -14,7 +14,6 @@
#include "global.hpp"
#include "game_config.hpp"
-#include "gamestatus.hpp"
#include "gettext.hpp"
#include "log.hpp"
#include "unit_types.hpp"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Wesnoth-cvs-commits] wesnoth/src actions.cpp dialogs.cpp display.cpp...,
Yann Dirson <=