1 #include "building.h"
2 
3 #include "building/type.h"
4 #include "scenario/data.h"
5 
scenario_building_allowed(int building_type)6 int scenario_building_allowed(int building_type)
7 {
8     switch (building_type) {
9         case BUILDING_ROAD:
10             return scenario.allowed_buildings[ALLOWED_BUILDING_ROAD];
11         case BUILDING_DRAGGABLE_RESERVOIR:
12         case BUILDING_AQUEDUCT:
13         case BUILDING_FOUNTAIN:
14             return scenario.allowed_buildings[ALLOWED_BUILDING_AQUEDUCT];
15         case BUILDING_WELL:
16             return scenario.allowed_buildings[ALLOWED_BUILDING_WELL];
17         case BUILDING_BARBER:
18             return scenario.allowed_buildings[ALLOWED_BUILDING_BARBER];
19         case BUILDING_BATHHOUSE:
20             return scenario.allowed_buildings[ALLOWED_BUILDING_BATHHOUSE];
21         case BUILDING_DOCTOR:
22             return scenario.allowed_buildings[ALLOWED_BUILDING_DOCTOR];
23         case BUILDING_HOSPITAL:
24             return scenario.allowed_buildings[ALLOWED_BUILDING_HOSPITAL];
25         case BUILDING_MENU_SMALL_TEMPLES:
26             return scenario.allowed_buildings[ALLOWED_BUILDING_SMALL_TEMPLES];
27         case BUILDING_MENU_LARGE_TEMPLES:
28             return scenario.allowed_buildings[ALLOWED_BUILDING_LARGE_TEMPLES];
29         case BUILDING_ORACLE:
30             return scenario.allowed_buildings[ALLOWED_BUILDING_ORACLE];
31         case BUILDING_SCHOOL:
32             return scenario.allowed_buildings[ALLOWED_BUILDING_SCHOOL];
33         case BUILDING_ACADEMY:
34             return scenario.allowed_buildings[ALLOWED_BUILDING_ACADEMY];
35         case BUILDING_LIBRARY:
36             return scenario.allowed_buildings[ALLOWED_BUILDING_LIBRARY];
37         case BUILDING_THEATER:
38             return scenario.allowed_buildings[ALLOWED_BUILDING_THEATER];
39         case BUILDING_AMPHITHEATER:
40             return scenario.allowed_buildings[ALLOWED_BUILDING_AMPHITHEATER];
41         case BUILDING_COLOSSEUM:
42             return scenario.allowed_buildings[ALLOWED_BUILDING_COLOSSEUM];
43         case BUILDING_HIPPODROME:
44             return scenario.allowed_buildings[ALLOWED_BUILDING_HIPPODROME];
45         case BUILDING_GLADIATOR_SCHOOL:
46             return scenario.allowed_buildings[ALLOWED_BUILDING_GLADIATOR_SCHOOL];
47         case BUILDING_LION_HOUSE:
48             return scenario.allowed_buildings[ALLOWED_BUILDING_LION_HOUSE];
49         case BUILDING_ACTOR_COLONY:
50             return scenario.allowed_buildings[ALLOWED_BUILDING_ACTOR_COLONY];
51         case BUILDING_CHARIOT_MAKER:
52             return scenario.allowed_buildings[ALLOWED_BUILDING_CHARIOT_MAKER];
53         case BUILDING_FORUM:
54             return scenario.allowed_buildings[ALLOWED_BUILDING_FORUM];
55         case BUILDING_SENATE_UPGRADED:
56             return scenario.allowed_buildings[ALLOWED_BUILDING_SENATE];
57         case BUILDING_GOVERNORS_HOUSE:
58         case BUILDING_GOVERNORS_VILLA:
59         case BUILDING_GOVERNORS_PALACE:
60             return scenario.allowed_buildings[ALLOWED_BUILDING_GOVERNOR_HOME];
61         case BUILDING_SMALL_STATUE:
62         case BUILDING_MEDIUM_STATUE:
63         case BUILDING_LARGE_STATUE:
64             return scenario.allowed_buildings[ALLOWED_BUILDING_STATUES];
65         case BUILDING_GARDENS:
66             return scenario.allowed_buildings[ALLOWED_BUILDING_GARDENS];
67         case BUILDING_PLAZA:
68             return scenario.allowed_buildings[ALLOWED_BUILDING_PLAZA];
69         case BUILDING_ENGINEERS_POST:
70             return scenario.allowed_buildings[ALLOWED_BUILDING_ENGINEERS_POST];
71         case BUILDING_MISSION_POST:
72             return scenario.allowed_buildings[ALLOWED_BUILDING_MISSION_POST];
73         case BUILDING_SHIPYARD:
74         case BUILDING_WHARF:
75             return scenario.allowed_buildings[ALLOWED_BUILDING_WHARF];
76         case BUILDING_DOCK:
77             return scenario.allowed_buildings[ALLOWED_BUILDING_DOCK];
78         case BUILDING_WALL:
79             return scenario.allowed_buildings[ALLOWED_BUILDING_WALL];
80         case BUILDING_TOWER:
81             return scenario.allowed_buildings[ALLOWED_BUILDING_TOWER];
82         case BUILDING_GATEHOUSE:
83             return scenario.allowed_buildings[ALLOWED_BUILDING_GATEHOUSE];
84         case BUILDING_PREFECTURE:
85             return scenario.allowed_buildings[ALLOWED_BUILDING_PREFECTURE];
86         case BUILDING_FORT:
87             return scenario.allowed_buildings[ALLOWED_BUILDING_FORT];
88         case BUILDING_MILITARY_ACADEMY:
89             return scenario.allowed_buildings[ALLOWED_BUILDING_MILITARY_ACADEMY];
90         case BUILDING_BARRACKS:
91             return scenario.allowed_buildings[ALLOWED_BUILDING_BARRACKS];
92         case BUILDING_DISTRIBUTION_CENTER_UNUSED:
93             return scenario.allowed_buildings[ALLOWED_BUILDING_DISTRIBUTION_CENTER];
94         case BUILDING_MENU_FARMS:
95             return scenario.allowed_buildings[ALLOWED_BUILDING_FARMS];
96         case BUILDING_MENU_RAW_MATERIALS:
97             return scenario.allowed_buildings[ALLOWED_BUILDING_RAW_MATERIALS];
98         case BUILDING_MENU_WORKSHOPS:
99             return scenario.allowed_buildings[ALLOWED_BUILDING_WORKSHOPS];
100         case BUILDING_MARKET:
101             return scenario.allowed_buildings[ALLOWED_BUILDING_MARKET];
102         case BUILDING_GRANARY:
103             return scenario.allowed_buildings[ALLOWED_BUILDING_GRANARY];
104         case BUILDING_WAREHOUSE:
105             return scenario.allowed_buildings[ALLOWED_BUILDING_WAREHOUSE];
106         case BUILDING_LOW_BRIDGE:
107         case BUILDING_SHIP_BRIDGE:
108             return scenario.allowed_buildings[ALLOWED_BUILDING_BRIDGE];
109     }
110     return 1;
111 }
112 
scenario_building_image_native_hut(void)113 int scenario_building_image_native_hut(void)
114 {
115     return scenario.native_images.hut;
116 }
117 
scenario_building_image_native_meeting(void)118 int scenario_building_image_native_meeting(void)
119 {
120     return scenario.native_images.meeting;
121 }
122 
scenario_building_image_native_crops(void)123 int scenario_building_image_native_crops(void)
124 {
125     return scenario.native_images.crops;
126 }
127