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";
23 const int game_can_configure = FALSE;
38 game_params *default_params(void)
40 game_params *ret = snew(game_params);
47 int game_fetch_preset(int i, char **name, game_params **params)
52 void free_params(game_params *params)
57 game_params *dup_params(game_params *params)
59 game_params *ret = snew(game_params);
60 *ret = *params; /* structure copy */
64 config_item *game_configure(game_params *params)
69 game_params *custom_params(config_item *cfg)
74 char *validate_params(game_params *params)
79 char *new_game_seed(game_params *params)
81 return dupstr("FIXME");
84 game_state *new_game(game_params *params, char *seed)
86 game_state *state = snew(game_state);
93 game_state *dup_game(game_state *state)
95 game_state *ret = snew(game_state);
97 ret->FIXME = state->FIXME;
102 void free_game(game_state *state)
107 game_state *make_move(game_state *from, int x, int y, int button)
112 /* ----------------------------------------------------------------------
116 struct game_drawstate {
120 void game_size(game_params *params, int *x, int *y)
122 *x = *y = 200; /* FIXME */
125 float *game_colours(frontend *fe, game_state *state, int *ncolours)
127 float *ret = snewn(3 * NCOLOURS, float);
129 frontend_default_colour(fe, &ret[COL_BACKGROUND * 3]);
131 *ncolours = NCOLOURS;
135 game_drawstate *game_new_drawstate(game_state *state)
137 struct game_drawstate *ds = snew(struct game_drawstate);
144 void game_free_drawstate(game_drawstate *ds)
149 void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
150 game_state *state, float animtime, float flashtime)
154 float game_anim_length(game_state *oldstate, game_state *newstate)
159 float game_flash_length(game_state *oldstate, game_state *newstate)
164 int game_wants_statusbar(void)