From e34cc25fe17e94d18eb2c80e914450dfac970603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Teuli=C3=A8re?= Date: Wed, 5 Dec 2012 20:26:47 +0100 Subject: [PATCH] Move commands to the game/cmd/ sub-directory. The abstract Command class (from which all the others inherit) is still game/, to hide the cmd/ subdir from most clients. --- configure.in | 4 +++- game/Makefile.am | 12 ++++++------ game/arbitration.cpp | 6 +++--- game/{ => cmd}/game_move_cmd.cpp | 2 +- game/{ => cmd}/game_move_cmd.h | 0 game/{ => cmd}/game_rack_cmd.cpp | 2 +- game/{ => cmd}/game_rack_cmd.h | 0 game/{ => cmd}/master_move_cmd.cpp | 3 ++- game/{ => cmd}/master_move_cmd.h | 0 game/{ => cmd}/player_event_cmd.cpp | 2 +- game/{ => cmd}/player_event_cmd.h | 0 game/{ => cmd}/player_move_cmd.cpp | 2 +- game/{ => cmd}/player_move_cmd.h | 0 game/{ => cmd}/player_rack_cmd.cpp | 2 +- game/{ => cmd}/player_rack_cmd.h | 0 game/duplicate.cpp | 12 ++++++------ game/freegame.cpp | 10 +++++----- game/training.cpp | 8 ++++---- game/xml_reader.cpp | 12 ++++++------ game/xml_writer.cpp | 12 ++++++------ 20 files changed, 46 insertions(+), 43 deletions(-) rename game/{ => cmd}/game_move_cmd.cpp (99%) rename game/{ => cmd}/game_move_cmd.h (100%) rename game/{ => cmd}/game_rack_cmd.cpp (98%) rename game/{ => cmd}/game_rack_cmd.h (100%) rename game/{ => cmd}/master_move_cmd.cpp (98%) rename game/{ => cmd}/master_move_cmd.h (100%) rename game/{ => cmd}/player_event_cmd.cpp (98%) rename game/{ => cmd}/player_event_cmd.h (100%) rename game/{ => cmd}/player_move_cmd.cpp (98%) rename game/{ => cmd}/player_move_cmd.h (100%) rename game/{ => cmd}/player_rack_cmd.cpp (98%) rename game/{ => cmd}/player_rack_cmd.h (100%) diff --git a/configure.in b/configure.in index 8f80340..4d4ea0e 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,9 @@ dnl configure.in for Eliot dnl -------------------------------------------------------------- AC_INIT(eliot, 2.1-git) AC_CONFIG_SRCDIR(qt/main.cpp) -AM_INIT_AUTOMAKE +dnl See http://www.flameeyes.eu/autotools-mythbuster/automake/nonrecursive.html +dnl for the subdir-objets arguments (used at the moment for game/cmd/) +AM_INIT_AUTOMAKE([subdir-objects]) AM_CONFIG_HEADER(config.h) AC_CANONICAL_HOST AC_CANONICAL_BUILD diff --git a/game/Makefile.am b/game/Makefile.am index 3a70e6b..96c28db 100644 --- a/game/Makefile.am +++ b/game/Makefile.am @@ -35,9 +35,9 @@ libgame_a_SOURCES= \ turn_data.cpp turn_data.h \ history.cpp history.h \ player.cpp player.h \ - player_event_cmd.cpp player_event_cmd.h \ - player_move_cmd.cpp player_move_cmd.h \ - player_rack_cmd.cpp player_rack_cmd.h \ + cmd/player_event_cmd.cpp cmd/player_event_cmd.h \ + cmd/player_move_cmd.cpp cmd/player_move_cmd.h \ + cmd/player_rack_cmd.cpp cmd/player_rack_cmd.h \ ai_player.h \ ai_percent.cpp ai_percent.h \ game_params.h \ @@ -48,12 +48,12 @@ libgame_a_SOURCES= \ settings.cpp settings.h \ navigation.cpp navigation.h \ game.cpp game.h \ - game_move_cmd.h game_move_cmd.cpp \ - game_rack_cmd.h game_rack_cmd.cpp \ + cmd/game_move_cmd.h cmd/game_move_cmd.cpp \ + cmd/game_rack_cmd.h cmd/game_rack_cmd.cpp \ + cmd/master_move_cmd.h cmd/master_move_cmd.cpp \ turn.cpp turn.h \ duplicate.cpp duplicate.h \ arbitration.cpp arbitration.h \ - master_move_cmd.h master_move_cmd.cpp \ freegame.cpp freegame.h \ training.cpp training.h \ public_game.cpp public_game.h \ diff --git a/game/arbitration.cpp b/game/arbitration.cpp index 683e3f6..2e127a7 100644 --- a/game/arbitration.cpp +++ b/game/arbitration.cpp @@ -26,10 +26,10 @@ #include "rack.h" #include "player.h" #include "turn.h" -#include "game_rack_cmd.h" #include "results.h" -#include "player_move_cmd.h" -#include "player_event_cmd.h" +#include "cmd/game_rack_cmd.h" +#include "cmd/player_move_cmd.h" +#include "cmd/player_event_cmd.h" #include "settings.h" #include "encoding.h" #include "debug.h" diff --git a/game/game_move_cmd.cpp b/game/cmd/game_move_cmd.cpp similarity index 99% rename from game/game_move_cmd.cpp rename to game/cmd/game_move_cmd.cpp index 3306f8c..be62836 100644 --- a/game/game_move_cmd.cpp +++ b/game/cmd/game_move_cmd.cpp @@ -20,7 +20,7 @@ #include -#include "game_move_cmd.h" +#include "cmd/game_move_cmd.h" #include "player.h" #include "game_params.h" #include "game.h" diff --git a/game/game_move_cmd.h b/game/cmd/game_move_cmd.h similarity index 100% rename from game/game_move_cmd.h rename to game/cmd/game_move_cmd.h diff --git a/game/game_rack_cmd.cpp b/game/cmd/game_rack_cmd.cpp similarity index 98% rename from game/game_rack_cmd.cpp rename to game/cmd/game_rack_cmd.cpp index 1abc315..ca4c286 100644 --- a/game/game_rack_cmd.cpp +++ b/game/cmd/game_rack_cmd.cpp @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *****************************************************************************/ -#include "game_rack_cmd.h" +#include "cmd/game_rack_cmd.h" #include "game.h" diff --git a/game/game_rack_cmd.h b/game/cmd/game_rack_cmd.h similarity index 100% rename from game/game_rack_cmd.h rename to game/cmd/game_rack_cmd.h diff --git a/game/master_move_cmd.cpp b/game/cmd/master_move_cmd.cpp similarity index 98% rename from game/master_move_cmd.cpp rename to game/cmd/master_move_cmd.cpp index c9b18c8..528aac2 100644 --- a/game/master_move_cmd.cpp +++ b/game/cmd/master_move_cmd.cpp @@ -19,7 +19,8 @@ *****************************************************************************/ #include -#include "master_move_cmd.h" + +#include "cmd/master_move_cmd.h" #include "duplicate.h" using namespace std; diff --git a/game/master_move_cmd.h b/game/cmd/master_move_cmd.h similarity index 100% rename from game/master_move_cmd.h rename to game/cmd/master_move_cmd.h diff --git a/game/player_event_cmd.cpp b/game/cmd/player_event_cmd.cpp similarity index 98% rename from game/player_event_cmd.cpp rename to game/cmd/player_event_cmd.cpp index 67ca60d..764a979 100644 --- a/game/player_event_cmd.cpp +++ b/game/cmd/player_event_cmd.cpp @@ -20,7 +20,7 @@ #include -#include "player_event_cmd.h" +#include "cmd/player_event_cmd.h" #include "player.h" #include "debug.h" diff --git a/game/player_event_cmd.h b/game/cmd/player_event_cmd.h similarity index 100% rename from game/player_event_cmd.h rename to game/cmd/player_event_cmd.h diff --git a/game/player_move_cmd.cpp b/game/cmd/player_move_cmd.cpp similarity index 98% rename from game/player_move_cmd.cpp rename to game/cmd/player_move_cmd.cpp index 39fc312..918a5cd 100644 --- a/game/player_move_cmd.cpp +++ b/game/cmd/player_move_cmd.cpp @@ -20,7 +20,7 @@ #include -#include "player_move_cmd.h" +#include "cmd/player_move_cmd.h" #include "player.h" diff --git a/game/player_move_cmd.h b/game/cmd/player_move_cmd.h similarity index 100% rename from game/player_move_cmd.h rename to game/cmd/player_move_cmd.h diff --git a/game/player_rack_cmd.cpp b/game/cmd/player_rack_cmd.cpp similarity index 98% rename from game/player_rack_cmd.cpp rename to game/cmd/player_rack_cmd.cpp index 5a590ea..9abcd9e 100644 --- a/game/player_rack_cmd.cpp +++ b/game/cmd/player_rack_cmd.cpp @@ -20,7 +20,7 @@ #include -#include "player_rack_cmd.h" +#include "cmd/player_rack_cmd.h" #include "player.h" diff --git a/game/player_rack_cmd.h b/game/cmd/player_rack_cmd.h similarity index 100% rename from game/player_rack_cmd.h rename to game/cmd/player_rack_cmd.h diff --git a/game/duplicate.cpp b/game/duplicate.cpp index 6c071bc..14314fa 100644 --- a/game/duplicate.cpp +++ b/game/duplicate.cpp @@ -39,12 +39,12 @@ #include "pldrack.h" #include "results.h" #include "player.h" -#include "player_move_cmd.h" -#include "player_rack_cmd.h" -#include "player_event_cmd.h" -#include "game_move_cmd.h" -#include "game_rack_cmd.h" -#include "master_move_cmd.h" +#include "cmd/player_move_cmd.h" +#include "cmd/player_rack_cmd.h" +#include "cmd/player_event_cmd.h" +#include "cmd/game_move_cmd.h" +#include "cmd/game_rack_cmd.h" +#include "cmd/master_move_cmd.h" #include "ai_player.h" #include "navigation.h" #include "turn.h" diff --git a/game/freegame.cpp b/game/freegame.cpp index 2c91b25..9d78d15 100644 --- a/game/freegame.cpp +++ b/game/freegame.cpp @@ -33,11 +33,11 @@ #include "pldrack.h" #include "results.h" #include "player.h" -#include "player_event_cmd.h" -#include "player_move_cmd.h" -#include "player_rack_cmd.h" -#include "game_move_cmd.h" -#include "game_rack_cmd.h" +#include "cmd/player_event_cmd.h" +#include "cmd/player_move_cmd.h" +#include "cmd/player_rack_cmd.h" +#include "cmd/game_move_cmd.h" +#include "cmd/game_rack_cmd.h" #include "ai_player.h" #include "settings.h" #include "turn_data.h" diff --git a/game/training.cpp b/game/training.cpp index b3dec65..ac1b997 100644 --- a/game/training.cpp +++ b/game/training.cpp @@ -39,10 +39,10 @@ #include "move.h" #include "pldrack.h" #include "player.h" -#include "player_move_cmd.h" -#include "player_rack_cmd.h" -#include "game_move_cmd.h" -#include "game_rack_cmd.h" +#include "cmd/player_move_cmd.h" +#include "cmd/player_rack_cmd.h" +#include "cmd/game_move_cmd.h" +#include "cmd/game_rack_cmd.h" #include "encoding.h" #include "debug.h" diff --git a/game/xml_reader.cpp b/game/xml_reader.cpp index 55e365e..241ce5a 100644 --- a/game/xml_reader.cpp +++ b/game/xml_reader.cpp @@ -53,12 +53,12 @@ #include "player.h" #include "ai_percent.h" #include "encoding.h" -#include "game_rack_cmd.h" -#include "game_move_cmd.h" -#include "player_rack_cmd.h" -#include "player_move_cmd.h" -#include "player_event_cmd.h" -#include "master_move_cmd.h" +#include "cmd/game_rack_cmd.h" +#include "cmd/game_move_cmd.h" +#include "cmd/player_rack_cmd.h" +#include "cmd/player_move_cmd.h" +#include "cmd/player_event_cmd.h" +#include "cmd/master_move_cmd.h" #include "navigation.h" #include "header.h" diff --git a/game/xml_writer.cpp b/game/xml_writer.cpp index dc31524..c026008 100644 --- a/game/xml_writer.cpp +++ b/game/xml_writer.cpp @@ -42,12 +42,12 @@ #include "ai_percent.h" #include "game_exception.h" #include "turn.h" -#include "game_rack_cmd.h" -#include "game_move_cmd.h" -#include "player_rack_cmd.h" -#include "player_move_cmd.h" -#include "player_event_cmd.h" -#include "master_move_cmd.h" +#include "cmd/game_rack_cmd.h" +#include "cmd/game_move_cmd.h" +#include "cmd/player_rack_cmd.h" +#include "cmd/player_move_cmd.h" +#include "cmd/player_event_cmd.h" +#include "cmd/master_move_cmd.h" #include "dic.h" #include "header.h"