-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathempire-comp_move.ads
141 lines (120 loc) · 4.76 KB
/
empire-comp_move.ads
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
with Empire.Mapping;
package Empire.Comp_Move is
procedure Comp_Move;
private
Emap : View_Map; -- pruned explore map
-- Define ratios for numbers of cities we want producing each object.
--
-- Early in the game, we want to produce armies, patrols, and transports
-- for rapid expansion. After a while, we add fighters and other ships for
-- exploration. Later, we add ships of all kinds for control of the sea.
Ratios : array (Integer range <>) of Piece_Value_Array :=
(1 => (ARMY => 60, TRANSPORT => 20, PATROL => 10, others => 0),
2 =>
(ARMY => 90,
TRANSPORT => 40,
FIGHTER | PATROL | DESTROYER | SUBMARINE => 10,
others => 0),
3 =>
(ARMY => 120,
TRANSPORT => 60,
FIGHTER | PATROL => 20,
DESTROYER | SUBMARINE | CARRIER | BATTLESHIP => 10,
others => 0),
4 =>
(ARMY => 150,
TRANSPORT => 70,
FIGHTER | PATROL => 30,
DESTROYER | SUBMARINE => 20,
CARRIER | BATTLESHIP => 10,
others => 0));
subtype Ratio_Range is Integer range Ratios'First .. Ratios'Last;
Ratio : Ratio_Range;
-- how close an army must be to a transport to be considered 'near' it
LOAD_RADIUS : constant Integer := 2;
-- weight we assign to a user city on a continent where he has one and we
-- have none (and unowned cities are one or zero)
SINGLE_USER_CITY_WEIGHT : constant Integer := 2;
procedure Do_Cities;
procedure Do_Pieces;
procedure Comp_Prod
(Cityp : in out City_Info_T;
Is_Land_Locked : in Boolean);
procedure Comp_Set_Needed
(Cityp : in out City_Info_T;
City_Count : in out Piece_Value_Array;
Army_Ok : in Boolean;
Is_Land_Locked : in Boolean);
procedure Comp_Set_Prod
(Cityp : in out City_Info_T;
Ptype : in Piece_Type_T);
function Need_More
(City_Count : in Piece_Value_Array;
Prod1 : in Piece_Type_T;
Prod2 : in Piece_Type_T) return Piece_Type_T;
function Overproduced
(Cityp : in City_Info_T;
City_Count : in Piece_Value_Array) return Boolean;
procedure Cpiece_Move (Obj : in out Piece_Info_P);
procedure Army_Move (Obj : in out Piece_Info_P);
procedure Fighter_Move (Obj : in out Piece_Info_P);
procedure Ship_Move (Obj : in out Piece_Info_P);
procedure Transport_Move (Obj : in out Piece_Info_P);
procedure Move1 (Obj : in out Piece_Info_P);
function Move_Away
(Vmap : in View_Map;
Loc : in Location_T;
Terrain : in Acceptable_Content_Array) return Location_T;
procedure Move_Objective
(Obj : in out Piece_Info_P;
Pathmap : in out Mapping.Path_Map;
Loc : in Location_T;
Adj_List : in Content_Value_Array);
Could_Not_Load : exception;
procedure Load_Army (Obj : in Piece_Info_P);
procedure Find_Best_Tt (Best : in out Piece_Info_P; Loc : in Location_T);
function Find_Attack
(Loc : in Location_T;
Obj_List : in Content_Value_Array;
Terrain : Acceptable_Terrain_Array) return Location_T;
function Land_Locked (Loc : in Location_T) return Boolean;
function Nearby_Count (Loc : in Location_T) return Integer;
function Nearby_Load
(Obj : in Piece_Info_P;
Loc : in Location_T) return Boolean;
procedure Make_Army_Load_Map
(Obj : in Piece_Info_P;
xmap : in out View_Map;
Vmap : in View_Map);
procedure Make_Tt_Load_Map (Xmap : in out View_Map; Vmap : in View_Map);
procedure Make_Unload_Map (Xmap : in out View_Map; Vmap : in View_Map);
procedure Unmark_Explore_Locs (Xmap : in out View_Map);
-- utility func to turn a numeric weight into a Content_Display_T for Comp_Map
function Comp_Map_Weight (Weight : in Natural) return Content_Display_T;
function Vmap_Water
(Vmap : in View_Map;
Loc : in Location_T) return Continent_Map;
function Vmap_Land
(Vmap : in View_Map;
Loc : in Location_T) return Continent_Map;
function Vmap_Flood_Fill
(Vmap : in View_Map;
Loc : in Location_T;
Good_Terrain : in Acceptable_Content_Array) return Continent_Map;
type Explore_Map_T is record
Land : Integer;
Water : Integer;
end record;
type Explore_Map is array (Location_T) of Explore_Map_T;
procedure Vmap_Prune_Explore_Locs (Vmap : in out View_Map);
procedure Expand_Prune
(Vmap : in out View_Map;
Exmap : in out Explore_Map;
Loc : in Location_T;
Ttype : in Terrain_T;
To : in out Location_Vector;
Explored : in out Integer);
function Vmap_Cont_Scan
(Cont_Map : in Continent_Map;
Vmap : in View_Map) return Scan_Counts_T;
end Empire.Comp_Move;