xref: /netbsd/games/atc/struct.h (revision 6550d01e)
1 /*	$NetBSD: struct.h,v 1.6 2006/06/07 09:36:39 jnemeth Exp $	*/
2 
3 /*-
4  * Copyright (c) 1990, 1993
5  *	The Regents of the University of California.  All rights reserved.
6  *
7  * This code is derived from software contributed to Berkeley by
8  * Ed James.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  * 3. Neither the name of the University nor the names of its contributors
19  *    may be used to endorse or promote products derived from this software
20  *    without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32  * SUCH DAMAGE.
33  *
34  *	@(#)struct.h	8.1 (Berkeley) 5/31/93
35  */
36 
37 /*
38  * Copyright (c) 1987 by Ed James, UC Berkeley.  All rights reserved.
39  *
40  * Copy permission is hereby granted provided that this notice is
41  * retained on all partial or complete copies.
42  *
43  * For more info on this and all of my stuff, mail edjames@berkeley.edu.
44  */
45 
46 typedef struct {
47 	int	x, y;
48 	int	dir;	/* used only sometimes */
49 } SCREEN_POS;
50 
51 typedef struct {
52 	SCREEN_POS	p1, p2;
53 } LINE;
54 
55 typedef SCREEN_POS	EXIT;
56 typedef SCREEN_POS	BEACON;
57 typedef SCREEN_POS	AIRPORT;
58 
59 typedef struct {
60 	int	width, height;
61 	int	update_secs;
62 	int	newplane_time;
63 	int	num_exits;
64 	int	num_lines;
65 	int	num_beacons;
66 	int	num_airports;
67 	EXIT	*exit;
68 	LINE	*line;
69 	BEACON	*beacon;
70 	AIRPORT	*airport;
71 } C_SCREEN;
72 
73 typedef struct plane {
74 	struct plane	*next, *prev;
75 	int		status;
76 	int		plane_no;
77 	int		plane_type;
78 	int		orig_no;
79 	int		orig_type;
80 	int		dest_no;
81 	int		dest_type;
82 	int		altitude;
83 	int		new_altitude;
84 	int		dir;
85 	int		new_dir;
86 	int		fuel;
87 	int		xpos;
88 	int		ypos;
89 	int		delayd;
90 	int		delayd_no;
91 } PLANE;
92 
93 typedef struct {
94 	PLANE	*head, *tail;
95 } LIST;
96 
97 typedef struct {
98 	char	name[33];
99 	char	host[256];
100 	char	game[256];
101 	int	planes;
102 	int	time;
103 	int	real_time;
104 } SCORE;
105 
106 #define SCORE_SCANF_FMT	"%9s %255s %255s %d %d %d"
107 #define SCORE_NAME_LEN 33
108 #define SCORE_GAME_LEN 256
109 
110 typedef struct displacement {
111 	int	dx;
112 	int	dy;
113 } DISPLACEMENT;
114