File: logic.h

package info (click to toggle)
tworld 1.3.2-3
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 6,900 kB
  • ctags: 1,751
  • sloc: ansic: 12,877; perl: 2,465; makefile: 141
file content (30 lines) | stat: -rw-r--r-- 926 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* logic.h: Declarations for the game logic modules.
 *
 * Copyright (C) 2001-2006 by Brian Raiter, under the GNU General Public
 * License. No warranty. See COPYING for details.
 */

#ifndef	_logic_h_
#define	_logic_h_

#include	"state.h"

/* One game logic engine.
 */
typedef	struct gamelogic gamelogic;
struct gamelogic {
    int		ruleset;		  /* the ruleset */
    gamestate  *state;			  /* ptr to the current game state */
    int		localstateinfosize;	  /* how big to make localstateinfo */
    int	      (*initgame)(gamelogic*);	  /* prepare to play a game */
    int	      (*advancegame)(gamelogic*); /* advance the game one tick */
    int	      (*endgame)(gamelogic*);	  /* clean up after the game is done */
    void      (*shutdown)(gamelogic*);	  /* turn off the logic engine */
};

/* The available game logic engines.
 */
extern gamelogic *lynxlogicstartup(void);
extern gamelogic *mslogicstartup(void);

#endif