2 * nullgame.c [FIXME]: Template defining the null game (in which no
3 * moves are permitted and nothing is ever drawn). This file exists
4 * solely as a basis for constructing new game definitions - it
5 * helps to have something which will compile from the word go and
6 * merely doesn't _do_ very much yet.
8 * Parts labelled FIXME actually want _removing_ (e.g. the dummy
9 * field in each of the required data structures, and this entire
10 * comment itself) when converting this source file into one
11 * describing a real game.
22 const char *const game_name
= "Null Game";
37 game_params
*default_params(void)
39 game_params
*ret
= snew(game_params
);
46 int game_fetch_preset(int i
, char **name
, game_params
**params
)
51 void free_params(game_params
*params
)
56 game_params
*dup_params(game_params
*params
)
58 game_params
*ret
= snew(game_params
);
59 *ret
= *params
; /* structure copy */
63 char *new_game_seed(game_params
*params
)
65 return dupstr("FIXME");
68 game_state
*new_game(game_params
*params
, char *seed
)
70 game_state
*state
= snew(game_state
);
77 game_state
*dup_game(game_state
*state
)
79 game_state
*ret
= snew(game_state
);
81 ret
->FIXME
= state
->FIXME
;
86 void free_game(game_state
*state
)
91 game_state
*make_move(game_state
*from
, int x
, int y
, int button
)
96 /* ----------------------------------------------------------------------
100 struct game_drawstate
{
104 void game_size(game_params
*params
, int *x
, int *y
)
106 *x
= *y
= 200; /* FIXME */
109 float *game_colours(frontend
*fe
, game_state
*state
, int *ncolours
)
111 float *ret
= snewn(3 * NCOLOURS
, float);
113 frontend_default_colour(fe
, &ret
[COL_BACKGROUND
* 3]);
115 *ncolours
= NCOLOURS
;
119 game_drawstate
*game_new_drawstate(game_state
*state
)
121 struct game_drawstate
*ds
= snew(struct game_drawstate
);
128 void game_free_drawstate(game_drawstate
*ds
)
133 void game_redraw(frontend
*fe
, game_drawstate
*ds
, game_state
*oldstate
,
134 game_state
*state
, float animtime
, float flashtime
)
138 float game_anim_length(game_state
*oldstate
, game_state
*newstate
)
143 float game_flash_length(game_state
*oldstate
, game_state
*newstate
)
148 int game_wants_statusbar(void)