2009-04-14 05:27:32 +02:00
|
|
|
/* -*- fill-column: 78; compile-command: "cd ../linux && make -j3 MEMDEBUG=TRUE"; -*- */
|
2003-11-01 06:35:29 +01:00
|
|
|
/*
|
2009-04-14 05:27:32 +02:00
|
|
|
* Copyright 1997 - 2009 by Eric House (xwords@eehouse.org). All rights
|
|
|
|
* reserved.
|
2003-11-01 06:35:29 +01:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _MODEL_H_
|
|
|
|
#define _MODEL_H_
|
|
|
|
|
|
|
|
#include "comtypes.h"
|
|
|
|
#include "dictnry.h"
|
|
|
|
#include "mempool.h"
|
|
|
|
|
|
|
|
#ifdef CPLUS
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2011-11-29 03:46:08 +01:00
|
|
|
#define NUMCOLS_NBITS_4 4
|
|
|
|
#if 16 < MAX_COLS && MAX_COLS <= 32
|
|
|
|
# define NUMCOLS_NBITS_5 5
|
2011-11-15 03:21:41 +01:00
|
|
|
#endif
|
2003-11-01 06:35:29 +01:00
|
|
|
|
|
|
|
#ifdef EIGHT_TILES
|
2011-10-22 03:51:33 +02:00
|
|
|
# define NTILES_NBITS 4
|
2003-11-01 06:35:29 +01:00
|
|
|
#else
|
2011-10-22 03:51:33 +02:00
|
|
|
# define NTILES_NBITS 3
|
2003-11-01 06:35:29 +01:00
|
|
|
#endif
|
|
|
|
|
2009-02-01 17:03:31 +01:00
|
|
|
/* Try making this 0, as some local rules, e.g. Spanish, allow. Will need to
|
|
|
|
* add UI to limit the number of tiles selected to that remaining in the pool.
|
|
|
|
*/
|
2003-11-01 06:35:29 +01:00
|
|
|
#define MIN_TRADE_TILES MAX_TRAY_TILES
|
2009-02-01 17:03:31 +01:00
|
|
|
|
2003-11-01 06:35:29 +01:00
|
|
|
/* apply to CellTile */
|
2006-08-09 06:56:34 +02:00
|
|
|
#define TILE_VALUE_MASK 0x003F
|
|
|
|
#define TILE_BLANK_BIT 0x0040
|
2003-11-01 06:35:29 +01:00
|
|
|
#define IS_BLANK(t) (((t)&TILE_BLANK_BIT)!= 0)
|
2006-08-09 06:56:34 +02:00
|
|
|
#define TILE_EMPTY_BIT 0x0080
|
|
|
|
#define TILE_PENDING_BIT 0x0100
|
|
|
|
#define PREV_MOVE_BIT 0x200
|
2003-11-01 06:35:29 +01:00
|
|
|
|
2006-08-09 06:56:34 +02:00
|
|
|
#define CELL_OWNER_MASK 0x0C00
|
|
|
|
#define CELL_OWNER_OFFSET 10
|
2003-11-01 06:35:29 +01:00
|
|
|
#define CELL_OWNER(t) (((t)&CELL_OWNER_MASK) >> CELL_OWNER_OFFSET)
|
|
|
|
|
2008-05-31 05:26:16 +02:00
|
|
|
#define MAX_UNIQUE_TILES 64 /* max tile non-blank faces */
|
2003-11-01 06:35:29 +01:00
|
|
|
#define MAX_NUM_BLANKS 4
|
|
|
|
|
|
|
|
/* Used by scoring code and engine as fast representation of moves. */
|
|
|
|
typedef struct MoveInfoTile {
|
2008-05-31 05:26:16 +02:00
|
|
|
XP_U8 varCoord; /* 5 bits ok (0-16 for 17x17 board) */
|
|
|
|
Tile tile; /* 6 bits will do */
|
2003-11-01 06:35:29 +01:00
|
|
|
} MoveInfoTile;
|
|
|
|
|
|
|
|
typedef struct MoveInfo {
|
2008-05-31 05:26:16 +02:00
|
|
|
XP_U8 nTiles; /* 4 bits: 0-7 */
|
|
|
|
XP_U8 commonCoord; /* 5 bits: 0-16 if 17x17 possible */
|
|
|
|
XP_Bool isHorizontal; /* 1 bit */
|
2003-11-01 06:35:29 +01:00
|
|
|
/* If this is to go on an undo stack, we need player num here, or the code
|
|
|
|
has to keep track of it *and* there must be exactly one entry per
|
|
|
|
player per turn. */
|
|
|
|
MoveInfoTile tiles[MAX_TRAY_TILES];
|
|
|
|
} MoveInfo;
|
|
|
|
|
2014-08-26 15:55:26 +02:00
|
|
|
typedef struct _LastMoveInfo {
|
|
|
|
const XP_UCHAR* name;
|
|
|
|
XP_U8 moveType;
|
|
|
|
XP_U16 score;
|
|
|
|
XP_U16 nTiles;
|
|
|
|
XP_UCHAR word[MAX_COLS+1];
|
|
|
|
} LastMoveInfo;
|
|
|
|
|
2003-11-01 06:35:29 +01:00
|
|
|
typedef XP_U8 TrayTile;
|
|
|
|
typedef struct TrayTileSet {
|
|
|
|
XP_U8 nTiles;
|
|
|
|
TrayTile tiles[MAX_TRAY_TILES];
|
|
|
|
} TrayTileSet;
|
|
|
|
|
|
|
|
typedef struct BlankQueue {
|
|
|
|
XP_U16 nBlanks;
|
|
|
|
XP_U8 col[MAX_NUM_BLANKS];
|
|
|
|
XP_U8 row[MAX_NUM_BLANKS];
|
|
|
|
} BlankQueue;
|
|
|
|
|
2008-05-31 05:26:16 +02:00
|
|
|
typedef XP_U8 TileBit; /* bits indicating selection of tiles in tray */
|
2003-11-01 06:35:29 +01:00
|
|
|
#define ALLTILES ((TileBit)~(0xFF<<(MAX_TRAY_TILES)))
|
|
|
|
|
|
|
|
#define ILLEGAL_MOVE_SCORE (-1)
|
|
|
|
|
|
|
|
#define EMPTY_TILE TILE_EMPTY_BIT
|
|
|
|
#define TILE_IS_EMPTY(t) (((t)&TILE_EMPTY_BIT)!=0)
|
|
|
|
#define REVERSED_TILE TILE_PENDING_BIT /* reuse that bit for tile drawing
|
2008-05-31 05:26:16 +02:00
|
|
|
only */
|
2003-11-01 06:35:29 +01:00
|
|
|
|
|
|
|
|
2011-04-02 04:57:10 +02:00
|
|
|
ModelCtxt* model_make( MPFORMAL DictionaryCtxt* dict, const PlayerDicts* dicts,
|
2011-11-29 03:46:08 +01:00
|
|
|
XW_UtilCtxt* util, XP_U16 nCols );
|
2003-11-01 06:35:29 +01:00
|
|
|
|
|
|
|
ModelCtxt* model_makeFromStream( MPFORMAL XWStreamCtxt* stream,
|
2011-04-02 04:57:10 +02:00
|
|
|
DictionaryCtxt* dict, const PlayerDicts* dicts,
|
|
|
|
XW_UtilCtxt* util );
|
2003-11-01 06:35:29 +01:00
|
|
|
|
2012-03-12 02:28:14 +01:00
|
|
|
void model_writeToStream( const ModelCtxt* model, XWStreamCtxt* stream );
|
2003-11-01 06:35:29 +01:00
|
|
|
|
2011-04-13 15:45:22 +02:00
|
|
|
#ifdef TEXT_MODEL
|
|
|
|
void model_writeToTextStream( const ModelCtxt* model, XWStreamCtxt* stream );
|
|
|
|
#endif
|
|
|
|
|
2011-11-29 03:46:08 +01:00
|
|
|
void model_setSize( ModelCtxt* model, XP_U16 boardSize );
|
2003-11-01 06:35:29 +01:00
|
|
|
void model_destroy( ModelCtxt* model );
|
2012-05-28 20:07:59 +02:00
|
|
|
XP_U32 model_getHash( const ModelCtxt* model, XP_U16 version );
|
|
|
|
XP_Bool model_hashMatches( const ModelCtxt* model, XP_U32 hash );
|
2003-11-01 06:35:29 +01:00
|
|
|
void model_setNPlayers( ModelCtxt* model, XP_U16 numPlayers );
|
2010-11-20 03:22:39 +01:00
|
|
|
XP_U16 model_getNPlayers( const ModelCtxt* model );
|
2003-11-01 06:35:29 +01:00
|
|
|
|
|
|
|
void model_setDictionary( ModelCtxt* model, DictionaryCtxt* dict );
|
2009-04-05 21:20:22 +02:00
|
|
|
DictionaryCtxt* model_getDictionary( const ModelCtxt* model );
|
2003-11-01 06:35:29 +01:00
|
|
|
|
2011-04-02 04:57:10 +02:00
|
|
|
void model_setPlayerDicts( ModelCtxt* model, const PlayerDicts* dicts );
|
|
|
|
DictionaryCtxt* model_getPlayerDict( const ModelCtxt* model, XP_U16 playerNum );
|
|
|
|
|
2008-05-06 14:49:37 +02:00
|
|
|
XP_Bool model_getTile( const ModelCtxt* model, XP_U16 col, XP_U16 row,
|
2003-11-30 19:51:05 +01:00
|
|
|
XP_Bool getPending, XP_S16 turn,
|
|
|
|
Tile* tile, XP_Bool* isBlank,
|
|
|
|
XP_Bool* isPending, XP_Bool* isRecent );
|
2003-11-01 06:35:29 +01:00
|
|
|
|
|
|
|
void model_listPlacedBlanks( ModelCtxt* model, XP_U16 turn,
|
2003-11-30 19:51:05 +01:00
|
|
|
XP_Bool includePending, BlankQueue* bcp );
|
2003-11-01 06:35:29 +01:00
|
|
|
|
|
|
|
XP_U16 model_getCellOwner( ModelCtxt* model, XP_U16 col, XP_U16 row );
|
|
|
|
|
|
|
|
void model_assignPlayerTiles( ModelCtxt* model, XP_S16 turn,
|
2010-06-17 15:43:16 +02:00
|
|
|
const TrayTileSet* tiles );
|
2011-10-20 03:34:26 +02:00
|
|
|
Tile model_getPlayerTile( const ModelCtxt* model, XP_S16 turn, XP_S16 index );
|
2003-11-01 06:35:29 +01:00
|
|
|
|
|
|
|
Tile model_removePlayerTile( ModelCtxt* model, XP_S16 turn, XP_S16 index );
|
|
|
|
void model_addPlayerTile( ModelCtxt* model, XP_S16 turn, XP_S16 index,
|
2003-11-30 19:51:05 +01:00
|
|
|
Tile tile );
|
2008-03-09 00:16:21 +01:00
|
|
|
void model_moveTileOnTray( ModelCtxt* model, XP_S16 turn, XP_S16 indexCur,
|
|
|
|
XP_S16 indexNew );
|
2014-09-30 14:57:21 +02:00
|
|
|
XP_U16 model_getDividerLoc( const ModelCtxt* model, XP_S16 turn );
|
2014-10-14 15:24:41 +02:00
|
|
|
void model_setDividerLoc( ModelCtxt* model, XP_S16 turn, XP_U16 loc );
|
2003-11-01 06:35:29 +01:00
|
|
|
|
|
|
|
/* As an optimization, return a pointer to the model's array of tiles for a
|
|
|
|
player. Don't even think about modifying the array!!!! */
|
2010-07-02 03:55:49 +02:00
|
|
|
const TrayTileSet* model_getPlayerTiles( const ModelCtxt* model, XP_S16 turn );
|
2003-11-01 06:35:29 +01:00
|
|
|
|
2011-11-11 03:26:32 +01:00
|
|
|
#ifdef DEBUG
|
|
|
|
XP_UCHAR* formatTileSet( const TrayTileSet* tiles, XP_UCHAR* buf, XP_U16 len );
|
|
|
|
#endif
|
|
|
|
|
2010-06-17 15:43:16 +02:00
|
|
|
void model_sortTiles( ModelCtxt* model, XP_S16 turn );
|
2003-11-01 06:35:29 +01:00
|
|
|
XP_U16 model_getNumTilesInTray( ModelCtxt* model, XP_S16 turn );
|
|
|
|
XP_U16 model_getNumTilesTotal( ModelCtxt* model, XP_S16 turn );
|
2008-03-09 00:16:21 +01:00
|
|
|
void model_moveBoardToTray( ModelCtxt* model, XP_S16 turn,
|
|
|
|
XP_U16 col, XP_U16 row, XP_U16 trayOffset );
|
2003-11-01 06:35:29 +01:00
|
|
|
void model_moveTrayToBoard( ModelCtxt* model, XP_S16 turn, XP_U16 col,
|
2003-11-30 19:51:05 +01:00
|
|
|
XP_U16 row, XP_S16 tileIndex, Tile blankFace );
|
2008-06-08 01:07:31 +02:00
|
|
|
XP_Bool model_moveTileOnBoard( ModelCtxt* model, XP_S16 turn, XP_U16 colCur,
|
|
|
|
XP_U16 rowCur, XP_U16 colNew, XP_U16 rowNew );
|
2010-07-03 03:52:55 +02:00
|
|
|
XP_Bool model_redoPendingTiles( ModelCtxt* model, XP_S16 turn );
|
|
|
|
|
2008-03-09 00:16:21 +01:00
|
|
|
|
2003-11-01 06:35:29 +01:00
|
|
|
XP_S16 model_trayContains( ModelCtxt* model, XP_S16 turn, Tile tile );
|
|
|
|
|
|
|
|
|
2008-05-06 14:49:37 +02:00
|
|
|
XP_U16 model_numRows( const ModelCtxt* model );
|
|
|
|
XP_U16 model_numCols( const ModelCtxt* model );
|
2003-11-01 06:35:29 +01:00
|
|
|
|
|
|
|
/* XP_U16 model_numTilesCurrentTray( ModelCtxt* model ); */
|
|
|
|
/* Tile model_currentTrayTile( ModelCtxt* model, XP_U16 index ); */
|
|
|
|
void model_addToCurrentMove( ModelCtxt* model, XP_S16 turn,
|
2003-11-30 19:51:05 +01:00
|
|
|
XP_U16 col, XP_U16 row,
|
|
|
|
Tile tile, XP_Bool isBlank );
|
2010-07-01 05:25:34 +02:00
|
|
|
XP_U16 model_getCurrentMoveCount( const ModelCtxt* model, XP_S16 turn );
|
2003-11-01 06:35:29 +01:00
|
|
|
|
2012-07-11 03:00:23 +02:00
|
|
|
XP_Bool model_getCurrentMoveIsVertical( const ModelCtxt* model, XP_S16 turn,
|
|
|
|
XP_Bool* isHorizontal );
|
|
|
|
|
2003-11-01 06:35:29 +01:00
|
|
|
void model_getCurrentMoveTile( ModelCtxt* model, XP_S16 turn, XP_S16* index,
|
2003-11-30 19:51:05 +01:00
|
|
|
Tile* tile, XP_U16* col, XP_U16* row,
|
|
|
|
XP_Bool* isBlank );
|
2003-11-01 06:35:29 +01:00
|
|
|
|
2012-05-04 04:02:42 +02:00
|
|
|
XP_Bool model_commitTurn( ModelCtxt* model, XP_S16 player,
|
|
|
|
TrayTileSet* newTiles );
|
2003-11-01 06:35:29 +01:00
|
|
|
void model_commitRejectedPhony( ModelCtxt* model, XP_S16 player );
|
|
|
|
void model_makeTileTrade( ModelCtxt* model, XP_S16 player,
|
2011-10-20 03:34:26 +02:00
|
|
|
const TrayTileSet* oldTiles,
|
|
|
|
const TrayTileSet* newTiles );
|
2013-12-03 16:06:48 +01:00
|
|
|
XP_Bool model_canUndo( const ModelCtxt* model );
|
2003-11-01 06:35:29 +01:00
|
|
|
XP_Bool model_undoLatestMoves( ModelCtxt* model, PoolContext* pool,
|
|
|
|
XP_U16 nMovesSought, XP_U16* turn,
|
|
|
|
XP_S16* moveNum );
|
|
|
|
void model_rejectPreviousMove( ModelCtxt* model, PoolContext* pool,
|
|
|
|
XP_U16* turn );
|
|
|
|
|
|
|
|
void model_trayToStream( ModelCtxt* model, XP_S16 turn,
|
|
|
|
XWStreamCtxt* stream );
|
|
|
|
void model_currentMoveToStream( ModelCtxt* model, XP_S16 turn,
|
|
|
|
XWStreamCtxt* stream);
|
2012-05-01 16:58:11 +02:00
|
|
|
XP_Bool model_makeTurnFromStream( ModelCtxt* model, XP_U16 playerNum,
|
|
|
|
XWStreamCtxt* stream );
|
2003-11-01 06:35:29 +01:00
|
|
|
void model_makeTurnFromMoveInfo( ModelCtxt* model, XP_U16 playerNum,
|
2011-09-19 02:20:01 +02:00
|
|
|
const MoveInfo* newMove );
|
2003-11-01 06:35:29 +01:00
|
|
|
|
|
|
|
void model_resetCurrentTurn( ModelCtxt* model, XP_S16 turn );
|
2010-03-14 00:09:53 +01:00
|
|
|
XP_S16 model_getNMoves( const ModelCtxt* model );
|
2003-11-01 06:35:29 +01:00
|
|
|
|
2010-07-01 05:25:34 +02:00
|
|
|
/* Are there two or more tiles visible */
|
2010-07-08 15:38:51 +02:00
|
|
|
XP_U16 model_visTileCount( const ModelCtxt* model, XP_U16 turn,
|
|
|
|
XP_Bool trayVisible );
|
2010-07-02 03:55:49 +02:00
|
|
|
XP_Bool model_canShuffle( const ModelCtxt* model, XP_U16 turn,
|
|
|
|
XP_Bool trayVisible );
|
2010-07-03 20:38:37 +02:00
|
|
|
XP_Bool model_canTogglePending( const ModelCtxt* model, XP_U16 turn );
|
2010-07-01 05:25:34 +02:00
|
|
|
|
2003-11-01 06:35:29 +01:00
|
|
|
/********************* notification ********************/
|
|
|
|
typedef void (*BoardListener)(void* data, XP_U16 turn, XP_U16 col,
|
|
|
|
XP_U16 row, XP_Bool added );
|
|
|
|
void model_setBoardListener( ModelCtxt* model, BoardListener bl,
|
|
|
|
void* data );
|
2008-03-09 00:16:21 +01:00
|
|
|
typedef void (*TrayListener)( void* data, XP_U16 turn,
|
|
|
|
XP_S16 index1, XP_S16 index2 );
|
2003-11-01 06:35:29 +01:00
|
|
|
void model_setTrayListener( ModelCtxt* model, TrayListener bl,
|
|
|
|
void* data );
|
2011-04-02 04:57:10 +02:00
|
|
|
typedef void (*DictListener)( void* data, XP_S16 playerNum,
|
|
|
|
const DictionaryCtxt* oldDict,
|
2008-09-05 14:11:37 +02:00
|
|
|
const DictionaryCtxt* newDict );
|
|
|
|
void model_setDictListener( ModelCtxt* model, DictListener dl,
|
|
|
|
void* data );
|
2003-11-01 06:35:29 +01:00
|
|
|
void model_foreachPendingCell( ModelCtxt* model, XP_S16 turn,
|
|
|
|
BoardListener bl, void* data );
|
|
|
|
void model_foreachPrevCell( ModelCtxt* model, BoardListener bl, void* data );
|
|
|
|
|
|
|
|
void model_writeGameHistory( ModelCtxt* model, XWStreamCtxt* stream,
|
|
|
|
ServerCtxt* server, /* for player names */
|
|
|
|
XP_Bool gameOver );
|
|
|
|
|
|
|
|
/* for the tile values dialog: total all the tiles in players trays and
|
|
|
|
tentatively placed on the board. */
|
2004-11-06 03:50:01 +01:00
|
|
|
void model_countAllTrayTiles( ModelCtxt* model, XP_U16* counts,
|
|
|
|
XP_S16 excludePlayer );
|
2003-11-01 06:35:29 +01:00
|
|
|
|
|
|
|
/********************* scoring ********************/
|
|
|
|
|
2011-09-03 04:11:04 +02:00
|
|
|
typedef XP_Bool (*WordNotifierProc)( const XP_UCHAR* word, XP_Bool isLegal,
|
2012-09-06 16:19:12 +02:00
|
|
|
const DictionaryCtxt* dict,
|
2011-10-14 04:14:08 +02:00
|
|
|
#ifdef XWFEATURE_BOARDWORDS
|
|
|
|
const MoveInfo* movei, XP_U16 start,
|
|
|
|
XP_U16 end,
|
|
|
|
#endif
|
2011-09-03 04:11:04 +02:00
|
|
|
void* closure );
|
2003-11-01 06:35:29 +01:00
|
|
|
typedef struct WordNotifierInfo {
|
|
|
|
WordNotifierProc proc;
|
|
|
|
void* closure;
|
|
|
|
} WordNotifierInfo;
|
|
|
|
|
|
|
|
XP_Bool getCurrentMoveScoreIfLegal( ModelCtxt* model, XP_S16 turn,
|
2011-09-19 02:20:01 +02:00
|
|
|
XWStreamCtxt* stream,
|
|
|
|
WordNotifierInfo* wni, XP_S16* score );
|
2003-11-01 06:35:29 +01:00
|
|
|
XP_S16 model_getPlayerScore( ModelCtxt* model, XP_S16 player );
|
2004-04-30 10:29:49 +02:00
|
|
|
|
|
|
|
XP_Bool model_getPlayersLastScore( ModelCtxt* model, XP_S16 player,
|
2014-08-27 06:37:33 +02:00
|
|
|
LastMoveInfo* info );
|
2011-10-14 04:14:08 +02:00
|
|
|
#ifdef XWFEATURE_BOARDWORDS
|
|
|
|
void model_listWordsThrough( ModelCtxt* model, XP_U16 col, XP_U16 row,
|
|
|
|
XWStreamCtxt* stream );
|
|
|
|
#endif
|
2004-04-30 10:29:49 +02:00
|
|
|
|
2005-03-15 04:31:52 +01:00
|
|
|
/* Have there been too many passes (so game should end)? */
|
|
|
|
XP_Bool model_recentPassCountOk( ModelCtxt* model );
|
|
|
|
|
2011-11-17 04:01:11 +01:00
|
|
|
XWBonusType model_getSquareBonus( const ModelCtxt* model,
|
|
|
|
XP_U16 col, XP_U16 row );
|
2011-11-18 16:43:37 +01:00
|
|
|
#ifdef STREAM_VERS_BIGBOARD
|
2011-11-17 04:01:11 +01:00
|
|
|
void model_setSquareBonuses( ModelCtxt* model, XWBonusType* bonuses,
|
|
|
|
XP_U16 nBonuses );
|
2011-11-18 16:43:37 +01:00
|
|
|
#endif
|
2011-11-17 04:01:11 +01:00
|
|
|
|
2003-11-01 06:35:29 +01:00
|
|
|
XP_Bool model_checkMoveLegal( ModelCtxt* model, XP_S16 player,
|
|
|
|
XWStreamCtxt* stream,
|
|
|
|
WordNotifierInfo* notifyInfo );
|
|
|
|
|
2009-02-23 05:01:15 +01:00
|
|
|
typedef struct _ScoresArray { XP_S16 arr[MAX_NUM_PLAYERS]; } ScoresArray;
|
|
|
|
void model_figureFinalScores( ModelCtxt* model, ScoresArray* scores,
|
|
|
|
ScoresArray* tilePenalties );
|
2003-11-01 06:35:29 +01:00
|
|
|
|
|
|
|
/* figureMoveScore is meant only for the engine's use */
|
2011-04-02 04:57:10 +02:00
|
|
|
XP_U16 figureMoveScore( const ModelCtxt* model, XP_U16 turn, MoveInfo* mvInfo,
|
2003-11-01 06:35:29 +01:00
|
|
|
EngineCtxt* engine, XWStreamCtxt* stream,
|
2011-09-03 04:11:04 +02:00
|
|
|
WordNotifierInfo* notifyInfo );
|
2003-11-01 06:35:29 +01:00
|
|
|
|
2011-10-03 01:21:09 +02:00
|
|
|
/* tap into internal WordNotifierInfo */
|
2011-10-05 03:54:53 +02:00
|
|
|
WordNotifierInfo* model_initWordCounter( ModelCtxt* model, XWStreamCtxt* stream );
|
2011-10-03 01:21:09 +02:00
|
|
|
|
2003-11-01 06:35:29 +01:00
|
|
|
/********************* persistence ********************/
|
|
|
|
#ifdef INCLUDE_IO_SUPPORT
|
|
|
|
void model_load( ModelCtxt* model, XP_Stream* inStream );
|
|
|
|
void model_store( ModelCtxt* model, XP_Stream* outStream );
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2003-11-16 18:10:14 +01:00
|
|
|
/* a utility function needed by server too. Not a clean design, this. */
|
|
|
|
void model_packTilesUtil( ModelCtxt* model, PoolContext* pool,
|
|
|
|
XP_Bool includeBlank,
|
2009-04-07 06:23:56 +02:00
|
|
|
XP_U16* nUsed, const XP_UCHAR** texts,
|
2003-11-16 18:10:14 +01:00
|
|
|
Tile* tiles );
|
|
|
|
|
|
|
|
|
2003-11-01 06:35:29 +01:00
|
|
|
#ifdef CPLUS
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|