Mercurial > hg > openttd
annotate src/ai/default/default.h @ 9111:d48433370037 draft
(svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
author | rubidium <rubidium@openttd.org> |
---|---|
date | Tue, 06 May 2008 15:11:33 +0000 |
parents | 7d580c9c41fb |
children | c54d140df948 |
rev | line source |
---|---|
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
1 /* $Id$ */ |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
2 |
9111
d48433370037
(svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium <rubidium@openttd.org>
parents:
8254
diff
changeset
|
3 /** @file default.h The original AI. */ |
d48433370037
(svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium <rubidium@openttd.org>
parents:
8254
diff
changeset
|
4 |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
5 #ifndef DEFAULT_H |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
6 #define DEFAULT_H |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
7 |
8236
d1191295967a
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium <rubidium@openttd.org>
parents:
8229
diff
changeset
|
8 #include "../../direction_type.h" |
8254
7d580c9c41fb
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium <rubidium@openttd.org>
parents:
8236
diff
changeset
|
9 #include "../../vehicle_type.h" |
7d580c9c41fb
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium <rubidium@openttd.org>
parents:
8236
diff
changeset
|
10 #include "../../rail_type.h" |
8236
d1191295967a
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium <rubidium@openttd.org>
parents:
8229
diff
changeset
|
11 |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
12 void AiDoGameLoop(Player*); |
8229
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
13 void SaveLoad_AI(PlayerID id); |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
14 |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
15 struct AiBuildRec { |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
16 TileIndex spec_tile; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
17 TileIndex use_tile; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
18 byte rand_rng; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
19 byte cur_building_rule; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
20 byte unk6; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
21 byte unk7; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
22 byte buildcmd_a; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
23 byte buildcmd_b; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
24 byte direction; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
25 CargoID cargo; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
26 }; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
27 |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
28 struct PlayerAI { |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
29 byte state; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
30 byte tick; ///< Used to determine how often to move |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
31 uint32 state_counter; ///< Can hold tile index! |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
32 uint16 timeout_counter; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
33 |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
34 byte state_mode; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
35 byte banned_tile_count; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
36 RailTypeByte railtype_to_use; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
37 |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
38 CargoID cargo_type; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
39 byte num_wagons; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
40 byte build_kind; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
41 byte num_build_rec; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
42 byte num_loco_to_build; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
43 byte num_want_fullload; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
44 |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
45 byte route_type_mask; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
46 |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
47 TileIndex start_tile_a; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
48 TileIndex cur_tile_a; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
49 DiagDirectionByte cur_dir_a; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
50 DiagDirectionByte start_dir_a; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
51 |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
52 TileIndex start_tile_b; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
53 TileIndex cur_tile_b; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
54 DiagDirectionByte cur_dir_b; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
55 DiagDirectionByte start_dir_b; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
56 |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
57 Vehicle *cur_veh; ///< only used by some states |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
58 |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
59 AiBuildRec src, dst, mid1, mid2; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
60 |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
61 VehicleID wagon_list[9]; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
62 byte order_list_blocks[20]; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
63 |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
64 TileIndex banned_tiles[16]; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
65 byte banned_val[16]; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
66 }; |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
67 |
b550e02a1d3d
(svn r11792) -Codechange: move some (virtually) globally included AI related structs to a place where they are only included a few times.
rubidium <rubidium@openttd.org>
parents:
5475
diff
changeset
|
68 extern PlayerAI _players_ai[MAX_PLAYERS]; |
5475
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
69 |
eabf4b86aed6
(svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff
changeset
|
70 #endif |