src/ai/default/default.h
branchNewGRF_ports
changeset 6872 1c4a4a609f85
parent 5726 8f399788f6c9
child 10724 68a692eacf22
equal deleted inserted replaced
6871:5a9dc001e1ad 6872:1c4a4a609f85
     1 /* $Id$ */
     1 /* $Id$ */
     2 
     2 
     3 #ifndef DEFAULT_H
     3 #ifndef DEFAULT_H
     4 #define DEFAULT_H
     4 #define DEFAULT_H
     5 
     5 
       
     6 #include "../../direction_type.h"
       
     7 #include "../../vehicle_type.h"
       
     8 #include "../../rail_type.h"
       
     9 
     6 void AiDoGameLoop(Player*);
    10 void AiDoGameLoop(Player*);
       
    11 void SaveLoad_AI(PlayerID id);
       
    12 
       
    13 struct AiBuildRec {
       
    14 	TileIndex spec_tile;
       
    15 	TileIndex use_tile;
       
    16 	byte rand_rng;
       
    17 	byte cur_building_rule;
       
    18 	byte unk6;
       
    19 	byte unk7;
       
    20 	byte buildcmd_a;
       
    21 	byte buildcmd_b;
       
    22 	byte direction;
       
    23 	CargoID cargo;
       
    24 };
       
    25 
       
    26 struct PlayerAI {
       
    27 	byte state;
       
    28 	byte tick;            ///< Used to determine how often to move
       
    29 	uint32 state_counter; ///< Can hold tile index!
       
    30 	uint16 timeout_counter;
       
    31 
       
    32 	byte state_mode;
       
    33 	byte banned_tile_count;
       
    34 	RailTypeByte railtype_to_use;
       
    35 
       
    36 	CargoID cargo_type;
       
    37 	byte num_wagons;
       
    38 	byte build_kind;
       
    39 	byte num_build_rec;
       
    40 	byte num_loco_to_build;
       
    41 	byte num_want_fullload;
       
    42 
       
    43 	byte route_type_mask;
       
    44 
       
    45 	TileIndex start_tile_a;
       
    46 	TileIndex cur_tile_a;
       
    47 	DiagDirectionByte cur_dir_a;
       
    48 	DiagDirectionByte start_dir_a;
       
    49 
       
    50 	TileIndex start_tile_b;
       
    51 	TileIndex cur_tile_b;
       
    52 	DiagDirectionByte cur_dir_b;
       
    53 	DiagDirectionByte start_dir_b;
       
    54 
       
    55 	Vehicle *cur_veh; ///< only used by some states
       
    56 
       
    57 	AiBuildRec src, dst, mid1, mid2;
       
    58 
       
    59 	VehicleID wagon_list[9];
       
    60 	byte order_list_blocks[20];
       
    61 
       
    62 	TileIndex banned_tiles[16];
       
    63 	byte banned_val[16];
       
    64 };
       
    65 
       
    66 extern PlayerAI _players_ai[MAX_PLAYERS];
     7 
    67 
     8 #endif
    68 #endif