-
Notifications
You must be signed in to change notification settings - Fork 4
/
unit.h
71 lines (62 loc) · 1.63 KB
/
unit.h
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
/*
* Atlantis v1.0 13 September 1993
* Copyright 1993 by Russell Wallace
*
* This program may be freely used, modified and distributed. It may not be
* sold or used commercially without prior written permission from the author.
*/
#ifndef ATL_UNIT_H
#define ATL_UNIT_H
#include "settings.h"
#include "bool.h"
#include "spells.h"
#include "skills.h"
#include "items.h"
struct building;
struct ship;
struct faction;
struct region;
struct quicklist;
typedef struct unit {
struct unit * stack;
struct unit * next;
struct region * region;
struct faction *faction;
struct building *building;
struct ship *ship;
int no;
char * name_;
char * display_;
int number;
int money;
bool owner;
bool behind;
bool guard;
char thisorder[NAMESIZE];
char lastorder[NAMESIZE];
int combatspell;
int skills[MAXSKILLS];
int items[MAXITEMS];
bool spells[MAXSPELLS];
struct quicklist *orders;
int alias;
int dead;
int learning;
int n;
int *litems;
int side;
bool isnew;
} unit;
void unit_stack(struct unit* u, struct unit *stack);
void unit_unstack(struct unit* u);
struct unit * unit_getstack(struct unit *u);
struct unit * create_unit(struct faction * f, int no);
void free_unit(struct unit *u);
struct unit * findunitg(int n);
const char * unit_getname(const struct unit *u);
void unit_setname(struct unit *u, const char *name);
const char * unit_getdisplay(const struct unit *u);
void unit_setdisplay(struct unit *u, const char *display);
void unit_setbuilding(struct unit *self, struct building *b);
void unit_setship(struct unit *self, struct ship *s);
#endif