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