Commit graph

379 commits

Author SHA1 Message Date
Olivier Teulière
8acebbc889 Game::checkPlayedWord() now takes a Move instead of a Round 2012-12-29 17:46:18 +01:00
Olivier Teulière
dc3535c953 Coord: do not refuse lowercase coordinates.
It fixes a regression introduced in bedcc56.
2012-12-29 17:46:17 +01:00
Olivier Teulière
d55b3b2bdf Use toLower() and toUpper() 2012-12-29 17:46:17 +01:00
Olivier Teulière
05605a63ae Coord: remove useless code 2012-12-29 17:46:17 +01:00
Olivier Teulière
0097519e96 Turn: new findAllMatchingCmd() utility method 2012-12-29 17:44:39 +01:00
Olivier Teulière
bedcc561f3 Coord: do not accept invalid strings starting with valid coordinates 2012-12-18 16:03:44 +01:00
Olivier Teulière
19a93988ad Arbitration: new option to handle solos automatically.
The option is not yet accessible from the interface.
2012-12-05 23:56:20 +01:00
Olivier Teulière
4d38c99336 Move Arbitration::getPlayerEventCmd() into Duplicate 2012-12-05 22:05:31 +01:00
Olivier Teulière
8b3d6b9872 Use BOOST_FOREACH instead of an index-based loop 2012-12-05 21:23:25 +01:00
Olivier Teulière
e34cc25fe1 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.
2012-12-05 20:26:47 +01:00
Olivier Teulière
7832866652 Fixed compilation errors with newer g++ versions 2012-11-21 20:16:56 +01:00
Olivier Teulière
81f2507181 Arbitration: fix a bug when a word is checked manually.
The check didn't verify that it is actually possible to play the word
with the current rack.
2012-11-13 12:38:26 +01:00
Olivier Teulière
8858c54656 Minor cosmetics changes (more C++-like) 2012-10-24 15:23:59 +02:00
Olivier Teulière
08c3f2ccb2 Arbitration: when loading a saved game, make PlayerMoveCmd auto-executable.
This is not very clean, but without this the played moves of past turns
are not visible. This commit also fixes a test with was incorrect.
2012-10-24 11:11:24 +02:00
Olivier Teulière
34ed25e9e9 Saved games: save some statistics (not used when loading the game) 2012-10-24 00:32:48 +02:00
Olivier Teulière
c748d02950 Saved games: use the real player ID, not a modified one 2012-10-24 00:32:24 +02:00
Olivier Teulière
cf22315fd0 Saved games: improve an error message to give the context 2012-10-24 00:32:15 +02:00
Olivier Teulière
ef14d5e9d6 Saved games: use camelCase for attribute names 2012-10-24 00:31:51 +02:00
Olivier Teulière
b76f48f545 Save games: save and restore the table numbers 2012-10-22 17:35:29 +02:00
Olivier Teulière
c7831a28bd Do not specify template parameters when it is useless 2012-10-13 00:50:44 +02:00
Olivier Teulière
f6ced69c9e Make sure some class members are initialized (bugs reported by Coverity) 2012-10-11 23:21:32 +02:00
Olivier Teulière
0fa1c79563 Add myself to the authors, and fix some copyright headers 2012-10-11 13:45:24 +02:00
Olivier Teulière
4200e33c17 Change the copyright years for all the files modified in 2012 2012-10-11 13:45:24 +02:00
Olivier Teulière
c5591da9e5 Fix various strings 2012-10-06 22:17:43 +02:00
Olivier Teulière
e7aabdc4a2 Fix compilation warnings 2012-10-06 18:45:46 +02:00
Olivier Teulière
b84d112220 I18n of the load/save game exceptions 2012-10-06 18:18:21 +02:00
Olivier Teulière
e51d2f9a23 Rename TurnCmd into Turn (step 3) 2012-10-06 17:49:36 +02:00
Olivier Teulière
ec571d64e4 Rename TurnCmd into Turn (step 2) 2012-10-06 17:49:36 +02:00
Olivier Teulière
cfa90e6394 Rename TurnCmd into Turn (step 1) 2012-10-06 17:49:35 +02:00
Olivier Teulière
471dcf90e1 Rename Turn into TurnData (step 2) 2012-10-06 17:49:35 +02:00
Olivier Teulière
fa345a9f7b Rename Turn into TurnData (step 1) 2012-10-06 17:49:35 +02:00
Olivier Teulière
4acc731b17 Save game: write unknown commands as comments, to help debugging 2012-10-06 17:49:35 +02:00
Olivier Teulière
47a827e9d4 Remove useless code 2012-10-06 17:49:35 +02:00
Olivier Teulière
65ed44d66d Cosmetics 2012-10-06 17:49:35 +02:00
Olivier Teulière
ef5f8e63e9 Do not cache the score of the player.
Caching is almost useless here, and makes the code more complex.
2012-10-06 17:49:35 +02:00
Olivier Teulière
40944884e6 Remove Player::getPoints() 2012-10-06 17:49:35 +02:00
Olivier Teulière
c700f39ac7 Stats: display end game points for a free game 2012-10-06 17:49:35 +02:00
Olivier Teulière
b53295c782 Stats: compute the ranking based on the final score, not the intermediate one 2012-10-06 17:49:35 +02:00
Olivier Teulière
553d7f9cf0 Freegame: use PlayerEventCmd instead of PlayerPointsCmd 2012-10-06 17:49:34 +02:00
Olivier Teulière
2ab95b5ed9 Get rid of old CVS files 2012-10-06 01:44:33 +02:00
Olivier Teulière
a800863c1f Arbitration: do not handle solos automatically.
The arbitrator has to specify them manually. Otherwise, we cannot know
when a turn is complete and thus we cannot determine if solos can/should
be applied.
2012-10-05 12:52:42 +02:00
Olivier Teulière
66cfd66681 Improve logging of the turns history 2012-10-05 12:38:55 +02:00
Olivier Teulière
38d7093341 Add an assertion 2012-10-05 10:28:54 +02:00
Olivier Teulière
bcc2aedbff Improve the detection of finished games for duplicate and arbitration modes 2012-10-05 01:42:46 +02:00
Olivier Teulière
f1123e1229 Fix a very rare bug in rack generation 2012-10-05 01:25:01 +02:00
Olivier Teulière
937138c21d Split the helperSetRackRandom() method.
There is now one method to check whether the rack can be drawn, and
another one (still called helperSetRackRandom()) to do all the work.
2012-10-05 01:24:56 +02:00
Olivier Teulière
58c88a3078 Let the PlayerMoveCmd decide whether it is human independent.
It fixes problems when trying to replay turns on a loaded game.
2012-10-05 00:27:47 +02:00
Olivier Teulière
74d4572a0a Arbitration: fix the "Replay turn" feature for games with only AI players 2012-10-05 00:27:34 +02:00
Olivier Teulière
beb6e9a395 Fix the recursion limit for the first turn.
It was never a problem until now because the size of the board is
greater than twice the size of the rack.
2012-08-26 22:18:13 +02:00
Olivier Teulière
cbdf6d010d Various minor improvements (no functional change) 2012-06-27 21:33:19 +02:00
Olivier Teulière
06aad1b274 Create the configuration directory with all the intermediate directories (like mkdir -p) 2012-06-09 19:19:06 +02:00
Olivier Teulière
6dbfcc5f99 Arbitration: the Random button now takes the remaining letters into account 2012-05-30 20:37:47 +02:00
Olivier Teulière
2b6b85cce3 Arbitration: allow removing penalties 2012-05-20 22:12:42 +02:00
Olivier Teulière
3c29804148 Savegames: save/load properly the warnings, penalties and solos 2012-05-20 21:31:45 +02:00
Olivier Teulière
1ad1ef7425 Arbitration: use the same solo-related settings as in duplicate mode 2012-05-05 19:58:31 +02:00
Olivier Teulière
0095302b88 Use dedicated getters for the Move type: this is simpler to use and more readable 2012-05-05 19:45:44 +02:00
Olivier Teulière
6ba32f4835 New utility methods to retrieve the total number of penalty (or solo) points for a player 2012-05-05 19:45:44 +02:00
Olivier Teulière
572d172640 Arbitration: new option to specify the number of "authorized" warnings. Not used yet. 2012-05-05 19:45:44 +02:00
Olivier Teulière
e6c1a180c8 Arbitration: by convention, use negative values to indicate a penalty 2012-05-05 19:45:44 +02:00
Olivier Teulière
917c94fd5e Display the total number of warnings of a player in the corresponding history tab title 2012-04-28 15:34:38 +02:00
Olivier Teulière
c4fad05ffd Arbitration: new option to deactivate the automatic random rack 2012-04-28 15:34:37 +02:00
Olivier Teulière
de5783d51a Auto-save the current game regularly, to reduce the loss in case of crash 2012-04-28 15:34:37 +02:00
Olivier Teulière
36bfa92761 Arbitration: a few fixes to improve usage of the text interface 2012-04-28 15:34:37 +02:00
Olivier Teulière
afb45d62c4 Preferences: removed the option to link the rack with the 7+1 dictionary tool 2012-04-28 15:34:36 +02:00
Olivier Teulière
1086051e56 Fixed loading of duplicate games 2012-04-16 20:32:57 +02:00
Olivier Teulière
0b3120a792 Duplicate: assign a "no move" pseudo-move to all players when starting a turn 2012-04-11 20:02:18 +02:00
Olivier Teulière
196e02f9ad Duplicate: get rid of the MarkPlayedCmd class 2012-04-11 20:02:18 +02:00
Olivier Teulière
1db5ccea8b Arbitration: assign a "no move" pseudo-move to all players when starting a turn 2012-04-11 20:02:18 +02:00
Olivier Teulière
4e61dd85ce FreeGame: generate "no move" pseudo-moves
Now each player has a move at each turn, in all the game modes.
This should help to simplify the code in a few places...
2012-04-11 20:02:15 +02:00
Olivier Teulière
21ee07cc3b Move::ComputeRackForMove() now returns a PlayedRack instead of a simple Rack 2012-04-10 08:51:12 +02:00
Olivier Teulière
c423da2425 Saved games: increase the XML format version, to indicate incompatibilities 2012-04-08 20:57:46 +02:00
Olivier Teulière
76d761ad8d Saved games: do not write a playerid attribute for the MasterMove tag 2012-04-08 20:57:46 +02:00
Olivier Teulière
a5f13e3ba7 Saved games: write the dictionary letters as display strings 2012-04-08 20:57:46 +02:00
Olivier Teulière
53adb5d91b Saved games: do not support the (very) old format anymore 2012-04-08 20:57:46 +02:00
Olivier Teulière
1e57b56f9d Fixed compilation warnings 2012-04-07 13:29:07 +02:00
Olivier Teulière
5ee10b7c91 Fixed a bug introduced in d32f3fdf 2012-04-07 13:28:04 +02:00
Olivier Teulière
d6a2fc6e4e PublicGame: more direct access to the game current rack 2012-03-26 07:49:25 +02:00
Olivier Teulière
e017e73cd9 Handle penalties in the core 2012-03-26 07:49:25 +02:00
Olivier Teulière
84e46bef85 Handle warnings and solos in the core 2012-03-26 07:49:25 +02:00
Olivier Teulière
7de3374fae Code factorization 2012-03-26 07:49:25 +02:00
Olivier Teulière
3d724166b6 Allow inserting and dropping a single command in the history. 2012-03-26 07:49:24 +02:00
Olivier Teulière
c37107ed87 Write more information in a saved game: dictionary info and move points 2012-03-22 08:46:21 +01:00
Olivier Teulière
b1e7381b39 Players can now have a table number 2012-03-19 22:49:58 +01:00
Olivier Teulière
f3b2442cc0 Arbitration: improved the refresh of search results 2012-03-17 23:53:40 +01:00
Olivier Teulière
3a8ac20a0a Arbitration: allow ending the turn even if some players have no assigned move 2012-03-17 23:53:31 +01:00
Olivier Teulière
bfab57f6ac Changed the way to re-assign a player move.
Re-assigning a move is not limited anymore to the last turn (only to the
current turn, and even that limitation could be removed without too much
work).
2012-03-14 20:40:23 +01:00
Olivier Teulière
435d3a2f42 New methods to replace a command in the current turn (even if it is not the last one) 2012-03-14 20:40:23 +01:00
Olivier Teulière
c9f61d7ac8 Search on the game rack, not on the player one 2012-03-11 16:59:16 +01:00
Olivier Teulière
0fa7bc91c6 Arbitration mode: allow editing the rack manually 2012-03-11 00:24:29 +01:00
Olivier Teulière
25a36ec9cd Arbitration mode: allow setting the rack randomly 2012-03-11 00:24:21 +01:00
Olivier Teulière
9c82c8f7bc Reset the master move before setting the racks, for a better behaviour at the end of the game 2012-03-11 00:23:39 +01:00
Olivier Teulière
cf6cec0527 Improved the findMatchingCmd() method 2012-03-10 18:06:41 +01:00
Olivier Teulière
9160e6bc99 New preference to save the search results limit in arbitration mode 2012-03-10 18:06:41 +01:00
Olivier Teulière
05a51101db New arbitration mode, dedicate to arbitration of duplicate games.
It is mostly working, but many things are still missing.
In particular:
 - ability to enter (or change) moves for a past turn
 - ability to change the rack (manually, or randomly)
 - ability to add/remove players during the game
 - support for solos, warnings, penalties
 - support for table number
 - more ergonomic interface
 - non regression tests
 - ... and probably bugs to fix
2012-03-10 18:06:41 +01:00
Olivier Teulière
f44048f31a New utility method to find a matching command 2012-03-06 08:56:03 +01:00
Olivier Teulière
d5c53b92d0 New Round::countJokersFromRack() utility method 2012-03-04 22:58:53 +01:00
Olivier Teulière
22fd6484f3 Correctly retrieve the game rack 2012-02-25 23:51:30 +01:00
Olivier Teulière
4077a25fa0 Use the GameMoveCmd command 2012-02-25 23:25:40 +01:00
Olivier Teulière
df806594ae New GameRackCmd class, not used yet 2012-02-25 23:17:04 +01:00
Olivier Teulière
f1c8bd587b Really fixed detection of the first turn (commit 43954a9 was wrong) 2012-02-25 23:17:04 +01:00