File: controller.h

package info (click to toggle)
mah-jong 1.8-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,384 kB
  • ctags: 2,186
  • sloc: ansic: 26,312; perl: 393; makefile: 272; sh: 122
file content (44 lines) | stat: -rw-r--r-- 1,857 bytes parent folder | download | duplicates (4)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* $Header: /home/jcb/newmj/RCS/controller.h,v 11.3 2001/08/19 16:00:54 jcb Rel $
 * controller.h
 * Contains type definitions etc used by the controller program.
 */
/****************** COPYRIGHT STATEMENT **********************
 * This file is Copyright (c) 2000 by J. C. Bradfield.       *
 * Distribution and use is governed by the LICENCE file that *
 * accompanies this file.                                    *
 * The moral rights of the author are asserted.              *
 *                                                           *
 ***************** DISCLAIMER OF WARRANTY ********************
 * This code is not warranted fit for any purpose. See the   *
 * LICENCE file for further information.                     *
 *                                                           *
 *************************************************************/

#ifndef CONTROLLER_H_INCLUDED
#define CONTROLLER_H_INCLUDED 1

#include "tiles.h"
#include "player.h"
#include "protocol.h"
#include "game.h"

/* extra data in the game */
typedef struct {
  PlayerP caller; /* used to keep a copy of the winning player just
		     before mah-jong */
  /* array of pointers to CMsgs issued in this hand. This is
     used when reconnecting. The array is 512, since the maximum
     number of messages that can (relevantly) be issued in a hand
     is around 4 per tile, but that's highly unlikely ever to be
     reached -- but it can be, so say 1024. This ought to be dynamic... */
  int histcount;
  CMsgMsg *history[1024];
  /* this is used to keep the state at the start of the last
     hand, so we can print out the hand just completed */
  /* needs one Game Message and as many options as there may be */
  int prehistcount;
  CMsgMsg *prehistory[1+GOEnd];
} GameExtras;
#define gextras(g) ((GameExtras *)(g->userdata))

#endif /* CONTROLLER_H_INCLUDED */