Commit graph

210 commits

Author SHA1 Message Date
Olivier Teulière
5d98402891 Changed the prototype of PlayedRack::getRack() (and similar methods) 2012-01-26 21:10:41 +01:00
Olivier Teulière
e09f7f675e When all the moves are invalid for a turn, play the master move anyway 2012-01-17 23:49:09 +01:00
Olivier Teulière
13f4a3c346 Use the master move.
When no master move is defined, define a valid one using the best played
move (or the best playable move if all the played moves were invalid).
2012-01-17 23:35:16 +01:00
Olivier Teulière
1bc9c2f0f1 Implement (de)serialization of the MasterMoveCmd class 2012-01-17 23:15:05 +01:00
Olivier Teulière
744e90e6ca New command to define a master move. 2012-01-17 23:15:05 +01:00
Olivier Teulière
e327d4605d Always consider that the played move was played by the first player.
Knowing the actual player is not always possible, since potentially none
of the players has found the played move (for example in arbitration
mode). This ID is now only used to retrieve the rack from which the move
was formed, so any player ID will do.
The non-regression tests have been adapted accordingly.
2012-01-17 21:57:03 +01:00
Olivier Teulière
c81df46b5e Added a new type of move: NO_MOVE 2012-01-17 00:56:02 +01:00
Olivier Teulière
d32f3fdf81 Use assertions where appropriate 2012-01-17 00:56:02 +01:00
Olivier Teulière
482b5d674f Previewing a Round is now possible in all the game types.
It was only possible in Training mode. This change will be useful for
the future arbitration mdoe.
2012-01-17 00:43:19 +01:00
Olivier Teulière
90ce7e1111 Removed some useless code 2012-01-12 15:26:27 +01:00
Olivier Teulière
413d93c7cb Remove debug not meant to be committed. 2012-01-12 15:14:23 +01:00
Olivier Teulière
f2d25bc0d6 Include config.h before checking macro definitions 2012-01-05 20:43:57 +01:00
Olivier Teulière
9aea22d968 Use an enum for the variants 2011-08-28 19:25:26 +02:00
Olivier Teulière
56b66fea28 Added setters to GameParams, to simplify the code a little 2011-08-28 19:25:26 +02:00
Olivier Teulière
befe577fe7 Got rid of Game::getModeAsString() 2011-08-28 19:25:26 +02:00
Olivier Teulière
17bdd27899 Moved the dictionary to the GameParams class 2011-08-28 19:25:26 +02:00
Olivier Teulière
408c92df42 Moved the game mode to the GameParams class 2011-08-28 19:25:26 +02:00
Olivier Teulière
3d48facb55 Cosmetics 2011-08-28 19:25:26 +02:00
Olivier Teulière
d6fbd6bef1 Allow combining several variants in a single game 2011-08-28 18:47:25 +02:00
Olivier Teulière
38f3a456bb Handle the "7 among 8" variant in a few more places 2011-08-28 15:52:12 +02:00
Olivier Teulière
fd0bf204cc Fixed the variable used in board* 2011-08-27 21:55:49 +02:00
Olivier Teulière
fdc29871e5 New GameParams class to wrap a few game characteristics.
These characteristics will not change during the game.
2011-08-27 21:55:49 +02:00
Olivier Teulière
3b4750d3bf Round: the m_bonus field should be of type bool, not int. 2011-08-27 21:55:49 +02:00
Olivier Teulière
cfa88072a3 Replace the use of convertToMb() and convertToWc() with macros 2011-07-30 19:48:05 +00:00
Olivier Teulière
9e71372c42 Simplified the readFromUTF8() prototype 2011-07-30 19:46:47 +00:00
Olivier Teulière
424fd3af32 Display the points of the word entered by the player before validating it. 2011-07-16 23:31:17 +00:00
Olivier Teulière
23771f3f71 Indicate the end of the game 2011-01-30 00:23:45 +00:00
Olivier Teulière
7bb432b954 Removed a useless include 2011-01-29 23:50:14 +00:00
Olivier Teulière
0c76b9d781 Simplified the looging macros, and added logs in various key places. 2011-01-29 23:47:20 +00:00
Olivier Teulière
e175a6d8bc Added a new (optional) dependency on log4cxx, to enable logging.
If disabled (the default), everything is compiled away.
2011-01-16 21:30:30 +00:00
Olivier Teulière
c3785555b9 Print to stderr the complete stack trace in case of exception or segmentation fault.
This feature will only be activated in debug mode, and if available on the platform.
The symbols will even be demangled if possible (i.e. if compiled with g++).
2010-10-17 21:23:39 +00:00
Olivier Teulière
b7fff8b4a1 - Removed various C-style casts
- Factorized code in the Bag class
2010-03-06 16:54:20 +00:00
Olivier Teulière
5642bfa191 Fixed loading of games, for languages with multichar letters like Catalan 2010-03-06 16:53:37 +00:00
Olivier Teulière
7dcd9898ed Fixed a bug in PercentResults: AI players with a level lower than 100 could still play as if they were (almost) at level 100! 2010-02-20 13:31:12 +00:00
Olivier Teulière
65ae7075fd Make the destructor of the parent class virtual, since the class has virtual methods 2010-01-28 22:24:11 +00:00
Olivier Teulière
1756185f08 Compilation fix, when libconfig++ is missing 2010-01-28 22:23:47 +00:00
Olivier Teulière
2eb28d61c5 Use expat instead of libxml2: it is much smaller, and is easier to use with Arabica when cross-compiling for Windows 2009-12-06 00:07:35 +00:00
Olivier Teulière
3c7a84d543 Support saving/loading games (any game type) in XML format.
Status:
It works well, but there are still a few details to improve/fix

More details about the changes:
 - New dependency on Arabica and Libxml2 to parse the XML
 - Loading the old format is still supported for this release, but won't be supported anymore in the next one
 - Games are now only saved in the new format
 - In training mode, the player is now created externally, like in the other modes
 - Avoid using GameIO (the one from game/) whenever possible
 - Do not use a FILE* argument anymore when loading a game
 - Throw and catch exceptions correctly when a game cannot be loaded or saved
 - The non-regression tests now use a new method to print the game history
2009-11-29 16:01:31 +00:00
Olivier Teulière
bb13f634b3 Sort the training results using the dictionary order as alphabetical order 2009-07-03 23:00:12 +00:00
Olivier Teulière
02e4cb2970 - Invalid moves should be in the display form
- Moved some code from Header to Dictionary
2009-07-03 21:40:14 +00:00
Olivier Teulière
4fda3fed5e Support display and input strings in the dictionary header 2009-06-28 10:55:24 +00:00
Olivier Teulière
3a82ab75fd More uses of the display characters 2009-06-23 13:21:19 +00:00
Olivier Teulière
47e4b8c6b0 Simplifications 2009-06-23 12:56:40 +00:00
Olivier Teulière
7569a58bb7 Each letter (tile) now has a display string, defaulting to its internal char. It is not yet possible to change it.
This display string is used in the ncurses and Qt interfaces.

Display strings are types "wdstring" instead of plain "wstring" in a few places (not all of them) to help recognize them.
2009-06-23 12:41:53 +00:00
Olivier Teulière
7f1c0def1a - Do not allow vertical words for the first turn in duplicate mode
- Adapted unit tests
2009-03-18 18:54:41 +00:00
Olivier Teulière
3bde966efb Fixed a compilation warning (potential buffer overflow) 2009-03-18 18:53:57 +00:00
Olivier Teulière
6f14e34fe7 Allow the first word to be vertical 2009-03-12 18:56:25 +00:00
Olivier Teulière
6f9a343677 - Fixed the previous fix for joker games, for real this time
- Added tests for joker and explosive games in all modes
2009-02-21 16:56:32 +00:00
Olivier Teulière
903905c7bc Fixed a regression: joker games were not working correctly in version 1.8.
Thanks to Marcel Jolly for spotting this
2009-02-19 18:26:11 +00:00
Olivier Teulière
ed2a20a3e3 - Allow setting the coordinates of the played word by clicking on the board
- New PlayWordMediator class, to encapsulate the behaviour of the controls
   used to play a word
 - The Training mode now has input fields to play words directly, without
   choosing them in the search results
2009-02-19 18:25:17 +00:00