File: tship.h

package info (click to toggle)
nighthawk 1.0-15.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 1,424 kB
  • ctags: 18,064
  • sloc: fortran: 17,597; cpp: 4,950; makefile: 86; sh: 13
file content (80 lines) | stat: -rw-r--r-- 2,168 bytes parent folder | download | duplicates (6)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef _TSHIP_H
#define _TSHIP_H

#include "tfloor.h"
#include "tparadroid.h"
#include "tdroid_1xx.h"
#include "tdroid_2xx.h"
#include "tdroid_3xx.h"
#include "tdroid_4xx.h"
#include "tdroid_5xx.h"
#include "tdroid_6xx.h"
#include "tdroid_7xx.h"
#include "tdroid_8xx.h"
#include "tdroid_9xx.h"

typedef struct _tfloor_list
{
  tfloor              *curr;
  struct _tfloor_list *next;
} tfloor_list;

typedef struct _ttransport_list_link
{
  char                         floor[STR_LABEL_LEN];
  int                          floor_pos_x;
  int                          floor_pos_y;
  struct _ttransport_list_link *next;
} ttransport_list_link;

typedef struct _ttransport_list
{
  tfloor                  *floor;
  int                     diagram_px;
  int                     diagram_py;
  int                     floor_pos_x;
  int                     floor_pos_y;
  ttransport_list_link    *transport_list_link;
  struct _ttransport_list *next;
} ttransport_list;

class tship
{
public:
  int             ship_complete_f;
  int             ship_end_cd;
  int             state;
  char            name[STR_LABEL_LEN + 1];
  char            type[STR_LABEL_LEN + 1];
  tfloor_list     *floor_list;
  ttransport_list *transport_list,*curr_location;
  tbm             map_bm;
  tdroid          *droids[MAX_DROIDS];
  int             console_ptr;

  tship(void);
  int create_floor(tfloor_list **ptr,char *fname);
  tfloor *find_floor(char *name);
  ttransport_list *create_transport(
    ttransport_list **ptr,char *fn,int px,int py,int fx,int fy);
  ttransport_list *find_transport(char *name,int x,int y);
  int create_transport_link(
    ttransport_list_link **ptr,char *fn,int x,int y);
  void free_all_transport_links(ttransport_list_link **ptr);
  void free_all_transport(ttransport_list **ptr);
  void free_all_floor(tfloor_list **ptr);
  int load(char *shipname);
  void unload(void);
  void diagram_draw(void);
  void transport_set(void);
  void transport_change(void);
  void console_draw(void);
  void level_check_event();
  void level_bg_calc(void);
  void print_score(void);
  void print_info(void);
  void play_draw(void);
  void level_run(void);
};

#endif