xref: /original-bsd/games/mille/types.c (revision 91abda3c)
1 /*
2  * Copyright (c) 1982 Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  */
7 
8 #ifndef lint
9 static char sccsid[] = "@(#)types.c	5.4 (Berkeley) 06/01/90";
10 #endif /* not lint */
11 
12 # include	"mille.h"
13 
14 /*
15  * @(#)types.c	1.1 (Berkeley) 4/1/82
16  */
17 
18 isrepair(card)
19 reg CARD	card; {
20 
21 	return card == C_GAS || card == C_SPARE || card == C_REPAIRS || card == C_INIT;
22 }
23 
24 safety(card)
25 reg CARD	card; {
26 
27 	switch (card) {
28 	  case C_EMPTY:
29 	  case C_GAS:
30 	  case C_GAS_SAFE:
31 		return C_GAS_SAFE;
32 	  case C_FLAT:
33 	  case C_SPARE:
34 	  case C_SPARE_SAFE:
35 		return C_SPARE_SAFE;
36 	  case C_CRASH:
37 	  case C_REPAIRS:
38 	  case C_DRIVE_SAFE:
39 		return C_DRIVE_SAFE;
40 	  case C_GO:
41 	  case C_STOP:
42 	  case C_RIGHT_WAY:
43 	  case C_LIMIT:
44 	  case C_END_LIMIT:
45 		return C_RIGHT_WAY;
46 	}
47 	/* NOTREACHED */
48 }
49 
50