16
16
#include " graphics/text.h"
17
17
#include " sound/sound_building.h"
18
18
#include " game/game.h"
19
+ #include " city/labor.h"
20
+ #include " widget/city/ornaments.h"
21
+
22
+ #include " graphics/animation.h"
23
+
24
+ namespace model {
25
+
26
+ struct clay_pit_t {
27
+ static constexpr e_building_type type = BUILDING_CLAY_PIT;
28
+ e_labor_category labor_category;
29
+ animations_t anim;
30
+ };
31
+
32
+ clay_pit_t clay_pit;
33
+
34
+ }
35
+
36
+ ANK_REGISTER_CONFIG_ITERATOR (config_load_building_raw_materials);
37
+ void config_load_building_raw_materials () {
38
+ g_config_arch.r_section (" building_clay_pit" , [] (archive arch) {
39
+ model::clay_pit.labor_category = arch.r_type <e_labor_category>(" labor_category" );
40
+ model::clay_pit.anim .load (arch);
41
+ });
42
+
43
+ city_labor_set_category (model::clay_pit);
44
+ }
19
45
20
46
static void building_raw_material_draw_info (object_info& c, const char * type, e_resource resource) {
21
47
auto &meta = building::get_info (type);
@@ -69,9 +95,6 @@ void building_copper_mine_draw_info(object_info& c) {
69
95
void building_timber_yard_draw_info (object_info& c) {
70
96
building_raw_material_draw_info (c, " timber_yard" , RESOURCE_TIMBER);
71
97
}
72
- void building_clay_pit_draw_info (object_info& c) {
73
- building_raw_material_draw_info (c, " clay_pit" , RESOURCE_CLAY);
74
- }
75
98
void building_reed_gatherer_draw_info (object_info& c) {
76
99
building_raw_material_draw_info (c, " reed_farm" , RESOURCE_REEDS);
77
100
}
@@ -105,3 +128,28 @@ void building_quarry_stone::on_create() {
105
128
void building_quarry_stone::window_info_background (object_info &c) {
106
129
building_raw_material_draw_info (c, " plainstone_quarry" , RESOURCE_STONE);
107
130
}
131
+
132
+ void building_clay_pit::on_create () {
133
+ base.output_resource_first_id = RESOURCE_CLAY;
134
+ }
135
+
136
+ void building_clay_pit::window_info_background (object_info &c) {
137
+ building_raw_material_draw_info (c, " clay_pit" , RESOURCE_CLAY);
138
+ }
139
+
140
+ int building_clay_pit::get_fire_risk (int value) const {
141
+ if (config_get (CONFIG_GP_CH_CLAY_PIT_FIRE_RISK_REDUCED)) {
142
+ return value / 2 ;
143
+ }
144
+
145
+ return value;
146
+ }
147
+
148
+ bool building_clay_pit::draw_ornaments_and_animations_height (painter &ctx, vec2i point, tile2i tile, color color_mask) {
149
+ if (worker_percentage () > 50 ) {
150
+ const animation_t &anim = model::clay_pit.anim [" work" ];
151
+ building_draw_normal_anim (ctx, point, &base, tile, anim, color_mask);
152
+ }
153
+
154
+ return true ;
155
+ }
0 commit comments