Commit graph

235 commits

Author SHA1 Message Date
Eric House
5a65bca12a add board functions to figure layout (position and size of board,
tray, etc.), removing need for each client to do it itself.
2013-11-03 12:12:25 -08:00
Eric House
182ea7f862 make it possible to set DrawCtxt after opening/creating game 2013-10-31 08:06:44 -07:00
Eric House
88b380503e add function, not compiled by default, to return bounding rect of all
non-empty tiles. As a test, add menu that uses it to grey out that
region.
2013-10-27 21:51:30 -07:00
Eric House
78670e9650 fix bug: include wordlist name in bad word info passed into util function 2012-12-29 07:48:31 -08:00
Eric House
e90c5ee94f pass index of resigning player into util_notifyGameOver. Not yet
passed into java.
2012-10-09 05:31:12 -07:00
Eric House
2c89f13383 add turn as param to util_turnChanged, and call from server rather
than board.
2012-09-27 07:04:57 -07:00
Eric House
6ddd4a61c1 fix compile errors (mostly unused variables) found by gcc on latest
Ubuntu (12.04).
2012-09-25 07:28:02 -07:00
Eric House
2f8b6cceb5 pass additional param into callback -- unused so far. 2012-09-06 07:19:12 -07:00
Eric House
32e1530d3f i => ii; no other change 2012-08-22 07:44:21 -07:00
Eric House
8f04bfadaf modify engine score ranking to include estimate of bonus to be earned
if all tiles are used (ending the game and triggering penalties for
other players.)  Changes are protected by compile-time flags currently
not turned on.
2012-07-29 08:35:08 -07:00
Eric House
bfc68656cb move arrow to where removed tile was, and set its direction based on
whether removed tile and the next tile are in the same column or row.
2012-07-10 18:00:23 -07:00
Eric House
c272491db6 add compile-time option to have tap on empty tray space return one
tile instead of all of them.
2012-06-29 06:50:46 -07:00
Eric House
2564a660ad remove logging 2012-05-18 21:23:12 -07:00
Eric House
f51c0b39e6 use const where possible for game_writeToStream and others it calls.
No other code changes.
2012-03-11 18:28:14 -07:00
Andy2
b0470d5276 add new preference that when set prevents calculation and drawing of
crosshairs.
2011-12-06 18:17:55 -08:00
Andy2
3e21b7845a comment 2011-12-01 21:04:31 -08:00
Eric House
adb9b3853d fix bugs around new variable-length tiles array changes, and otherwise
improve storage of col/row data so that test runs succeed with
MAX_COLS of 16 or 32.  Still to do: test mid-game upgrade.
2011-11-28 18:46:08 -08:00
Andy2
210c59ef9b move bonus square values into model: add API to set an array, and API
to query model for values.  Now everybody else queries new model API
rather than client via util_getSquareBonus(), model uses its internal
values if present otherwise falls back to util_getSquareBonus(), and
internalizes the array as part of the game.  Now it should be easier
to have different bonus patterns and to have them exchanged as part of
network game init.
2011-11-16 19:01:11 -08:00
Andy2
86d5778ec3 remove 16x16 limitation on board size, replacing with 32x32. Change
is enabled by a compile-time flag so Android needn't follow yet.
2011-11-14 18:21:41 -08:00
Andy2
88f556356c dict_tileForString -> dict_tilesForString 2011-10-31 20:56:48 -07:00
Andy2
4eee7f8aa7 Pass selected tiles into new util function, and from there into java
world, so confirming query can include them.
2011-10-19 18:34:26 -07:00
Andy2
b31e829414 Remove file-format differences between debug and non-debug versions.
Fix curses to compile non-debug.
2011-10-18 18:52:37 -07:00
Andy2
0e6b4d749f When pen held on committed tile on board, cons up list of all words
played that include that tile and pass to new util_cellSquareHeld()
method.  In java implementation of that method, use existing lookup
activity code to display list of words.  Enabled on the C side by a
compile-time flag in case it has problems.  Right now the time spent
saving a game before launching the lookup activity, and reloading it
after, is pretty apparent, but that's in emulator which is slow.
2011-10-13 19:14:08 -07:00
Andy2
90f11abc37 add to game state passed into java world whether it's the cur selected
player's turn, and use that to enable/disable Pass/Turn done button.
2011-10-05 06:36:01 -07:00
Andy2
f8f06a7768 raise same error when try to commit exchange out-of-turn is raised for
out-of-turn move attempt -- and don't exit exchange mode.
2011-09-12 18:33:33 -07:00
Andy2
e709ea730c only exit exchange mode if user confirms trade 2011-09-09 21:30:40 -07:00
Andy2
c9c498786e add to game state whether any tiles selected. Use that to disable
'commit exchange' button when there's nothing to commit, and get rid
of error message used when committing nothing since it's now
impossible (on Android).
2011-09-09 19:04:25 -07:00
Andy2
66fb5f87fb don't exit trade mode if no tiles selected; fix warning string to match. 2011-09-09 18:40:19 -07:00
Andy2
e4b952222a unify two ways of saving words encountered during scoring, removing
one and changing the site that used it to use the other.  Not visible
outside of common, but should make it easier to harvest a list of all
words for one move or the entire game.
2011-09-02 19:11:04 -07:00
Andy2
2d2f3e23fd change signature of util_playerScoreHeld(): pass player num rather
than formatted text. Client code can use new
model_getPlayersLastScore() or whatever else it wants to build text to
show the user.
2011-09-02 18:36:03 -07:00
Andy2
99679357a8 Exit trade mode on "commit" even if no tiles selected (in keeping with
error message on Android); don't block trade if pending tiles are on
board; instead undo them. There's redo now so there's no need to
confirm, no data loss.
2011-09-02 06:48:06 -07:00
Andy2
e94524958f get rid of util_setInTrade(); fix passing of selBits when trading
(broken with prev checkin.)
2011-09-01 19:51:26 -07:00
Andy2
8e45dcd720 exit trade mode only in the case where we're asking user to confirm,
and do it before server can call callback that changes selPlayer so
it'll actually work.
2011-09-01 18:50:09 -07:00
Andy2
9c60a5c05b make sure util_setInTrade() gets called every time internal state
changes, including on creation/load from stream.
2011-08-31 06:33:36 -07:00
Eric House
c01981bc8f Make miniwindow stuff compile-time optional. The goal's to use native
features where they look better or are easier to manage, e.g. Toasts
and dialogs on Android.
2011-08-29 20:36:01 -07:00
Andy2
f4a11d2be5 ignore commit turn request when player has 0 tiles. This catches,
awkwardly, the case in a networked game where a player runs out of
tiles in his turn but the server hasn't responded yet to kill the
game.  It remains the player's turn and he can make lots of 0-point
moves while waiting.  (Making it the next player's turn would be the
right thing to do if that player were always on a different device.)
2011-07-12 07:13:21 -07:00
Andy2
3b7b4802a9 add ability to specify, track and use separate dictionaries for each
player.  Works for gtk client.  Compiles for Android but there's no UI
yet to specify more than one dict.  Management of dupicate dicts
without duplicating memory -- refcounting -- will be up to the
platforms.
2011-04-01 19:57:10 -07:00
Eric House
67a3349919 Don't move arrow on pen-up if pen-down was in a different cell. 2011-03-29 18:13:38 -07:00
Andy2
d9bb5197d4 Add two new menus to be available only when in trade mode. Hide and
show them and another group depending on whether trading at the time.
To make that work, replace the individual calls made to dis/enable
toolbar buttons with a single jin call that takes a struct full of
booleans and make that struct available in BoardActivity where menus
are hidden/shown.  Remove the individual calls from the jin interface.
2011-03-10 18:13:56 -08:00
Andy2
aa88503cfb have board_canHint() return false when trade in progress. 2011-03-08 07:40:38 -08:00
Andy2
828bd9aa4c fire user error rather than committing turn when trade attempted
without any tiles selected.
2011-03-07 06:28:43 -08:00
Andy2
d98a3fe232 when peeking is disabled (the default on android), don't allow
swapping to view of the current player's board if the current player
is remote -- because then won't be able to swap back to own view until
it's your turn.  Fixes annoyance in multi-device game on Android.
2011-01-21 21:32:52 -08:00
Andy2
cd5dedfa67 add compile-time flag to disable selection of tiles in tray (other
than as part of an exchange) and to remove feature where tapping empty
cell moves selected tile there.  This is to address user confusion on
Android, and I'll ask for testing before putting this in the main
branch.  This leaves only place-arrow-then-tap as an alternative to
drag-and-drop, and may annoy people.  Worth trying: disable only the
automatic selection of another tile after the selected one is dropped.
2011-01-12 19:00:48 -08:00
Andy2
f111b78714 switch from tracking robot intelligence as a per-game boolean
implemented (when not smart) as trying to match the human's score to a
per-robot value between 1 and 100 that gives the percentage of best
moves to store before picking randomly from among them.  So a 1 means
save only the best move and always pick it; 100 means save all the
best moves (how many are saved is compile-time configurable) and pick
one of them.  Because it's settable per-robot a smarter robot can be
played against a dumber one (though I may choose not to make it
settable per-robot on shipping versions.)
2011-01-10 06:44:28 -08:00
Andy2
dd3bd1f661 don't show hint buttons until there are tiles assigned 2010-11-06 21:31:53 -07:00
Andy2
5b33df4e25 modify model_getTile to take NULL for out parms where the result is
often ignored, then pass NULL instead of the address of variables
called 'ignore'.  Should be no behavior change.
2010-10-29 19:52:15 -07:00
Andy2
20312144dd tons of changes, still rough, snapshoted here: a gtk device vs device
game works to completion with both signing up as guests (no -s) with
one local and one remote player (identical commandlines.)  Not yet
tested: if any signs up as a host, reconnecting rather than
connecting, etc.  This is just a snapshot.
2010-09-10 01:30:40 -07:00
Andy2
5b3e41f4e9 fix bug: allow switch *to* player whose turn it is even if allowPeek
is off (typically because it was turned off after game was loaded and
while non-turn player's tiles are visible)
2010-07-17 07:11:46 -07:00
Andy2
639feb8965 nuke extra line -- change I forgot to save 2010-07-17 06:23:14 -07:00
Andy2
5b8cf716b3 add pref controlling whether can switch to look at tray of user whose
turn it isn't
2010-07-17 06:21:24 -07:00