Merge lp:~widelands-dev/widelands/bug-1395278-tribes-a-p into lp:widelands
- bug-1395278-tribes-a-p
- Merge into trunk
Proposed by
GunChleoc
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 7809 | ||||
Proposed branch: | lp:~widelands-dev/widelands/bug-1395278-tribes-a-p | ||||
Merge into: | lp:widelands | ||||
Diff against target: |
3668 lines (+724/-724) 29 files modified
src/ai/defaultai.cc (+1/-1) src/graphic/animation.cc (+6/-6) src/graphic/diranimations.h (+4/-4) src/logic/map_objects/tribes/battle.cc (+99/-99) src/logic/map_objects/tribes/battle.h (+11/-11) src/logic/map_objects/tribes/building.cc (+116/-116) src/logic/map_objects/tribes/building.h (+50/-50) src/logic/map_objects/tribes/carrier.cc (+23/-23) src/logic/map_objects/tribes/carrier.h (+2/-2) src/logic/map_objects/tribes/constructionsite.cc (+62/-62) src/logic/map_objects/tribes/constructionsite.h (+5/-5) src/logic/map_objects/tribes/dismantlesite.cc (+27/-27) src/logic/map_objects/tribes/militarysite.cc (+114/-114) src/logic/map_objects/tribes/militarysite.h (+26/-26) src/logic/map_objects/tribes/partially_finished_building.cc (+29/-29) src/logic/map_objects/tribes/partially_finished_building.h (+12/-12) src/logic/map_objects/tribes/production_program.cc (+4/-4) src/logic/map_objects/tribes/productionsite.cc (+1/-1) src/logic/map_objects/tribes/warehouse.cc (+4/-4) src/logic/player.cc (+5/-5) src/logic/player.h (+1/-1) src/map_io/map_building_packet.cc (+2/-2) src/map_io/map_buildingdata_packet.cc (+86/-86) src/scripting/lua_map.cc (+1/-1) src/wui/building_ui.cc (+13/-13) src/wui/buildingwindow.cc (+4/-4) src/wui/fieldaction.cc (+1/-1) src/wui/soldiercapacitycontrol.cc (+5/-5) src/wui/soldierlist.cc (+10/-10) |
||||
To merge this branch: | bzr merge lp:~widelands-dev/widelands/bug-1395278-tribes-a-p | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
SirVer | code | Approve | |
Review via email: mp+285395@code.launchpad.net |
Commit message
Fixed member variable names in src/logic/
Description of the change
Fixed member variable names in src/logic/
To post a comment you must log in.
Revision history for this message
bunnybot (widelandsofficial) wrote : | # |
Revision history for this message
SirVer (sirver) wrote : | # |
lgtm.
@bunnybot merge
review:
Approve
(code)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/ai/defaultai.cc' |
2 | --- src/ai/defaultai.cc 2016-02-03 10:01:08 +0000 |
3 | +++ src/ai/defaultai.cc 2016-02-08 18:17:36 +0000 |
4 | @@ -3114,7 +3114,7 @@ |
5 | |
6 | // Get max radius of recursive workarea |
7 | WorkareaInfo::size_type radius = 0; |
8 | - const WorkareaInfo& workarea_info = site.bo->desc->m_workarea_info; |
9 | + const WorkareaInfo& workarea_info = site.bo->desc->workarea_info_; |
10 | for (const std::pair<uint32_t, std::set<std::string>>& temp_info : workarea_info) { |
11 | if (radius < temp_info.first) { |
12 | radius = temp_info.first; |
13 | |
14 | === modified file 'src/graphic/animation.cc' |
15 | --- src/graphic/animation.cc 2016-01-28 05:24:34 +0000 |
16 | +++ src/graphic/animation.cc 2016-02-08 18:17:36 +0000 |
17 | @@ -299,12 +299,12 @@ |
18 | uint32_t dir5, |
19 | uint32_t dir6) |
20 | { |
21 | - m_animations[0] = dir1; |
22 | - m_animations[1] = dir2; |
23 | - m_animations[2] = dir3; |
24 | - m_animations[3] = dir4; |
25 | - m_animations[4] = dir5; |
26 | - m_animations[5] = dir6; |
27 | + animations_[0] = dir1; |
28 | + animations_[1] = dir2; |
29 | + animations_[2] = dir3; |
30 | + animations_[3] = dir4; |
31 | + animations_[4] = dir5; |
32 | + animations_[5] = dir6; |
33 | } |
34 | |
35 | /* |
36 | |
37 | === modified file 'src/graphic/diranimations.h' |
38 | --- src/graphic/diranimations.h 2016-01-17 19:54:32 +0000 |
39 | +++ src/graphic/diranimations.h 2016-02-08 18:17:36 +0000 |
40 | @@ -33,20 +33,20 @@ |
41 | uint32_t dir4 = 0, uint32_t dir5 = 0, uint32_t dir6 = 0); |
42 | |
43 | uint32_t get_animation(Widelands::Direction const dir) const { |
44 | - return m_animations[dir - 1]; |
45 | + return animations_[dir - 1]; |
46 | } |
47 | void set_animation(const Widelands::Direction dir, const uint32_t anim) { |
48 | - m_animations[dir - 1] = anim; |
49 | + animations_[dir - 1] = anim; |
50 | } |
51 | |
52 | static DirAnimations null() { |
53 | return DirAnimations(0); // Since real animation IDs are positive, this is safe |
54 | } |
55 | |
56 | - operator bool() const {return m_animations[0];} |
57 | + operator bool() const {return animations_[0];} |
58 | |
59 | private: |
60 | - uint32_t m_animations[6]; |
61 | + uint32_t animations_[6]; |
62 | }; |
63 | |
64 | #endif // end of include guard: WL_GRAPHIC_DIRANIMATIONS_H |
65 | |
66 | === modified file 'src/logic/map_objects/tribes/battle.cc' |
67 | --- src/logic/map_objects/tribes/battle.cc 2015-11-28 22:29:26 +0000 |
68 | +++ src/logic/map_objects/tribes/battle.cc 2016-02-08 18:17:36 +0000 |
69 | @@ -45,22 +45,22 @@ |
70 | Battle::Battle () |
71 | : |
72 | MapObject(&g_battle_descr), |
73 | - m_first(nullptr), |
74 | - m_second(nullptr), |
75 | - m_creationtime(0), |
76 | - m_readyflags(0), |
77 | - m_damage(0), |
78 | - m_first_strikes(true), |
79 | - m_last_attack_hits(false) |
80 | + first_(nullptr), |
81 | + second_(nullptr), |
82 | + creationtime_(0), |
83 | + readyflags_(0), |
84 | + damage_(0), |
85 | + first_strikes_(true), |
86 | + last_attack_hits_(false) |
87 | {} |
88 | |
89 | Battle::Battle(Game & game, Soldier & First, Soldier & Second) : |
90 | MapObject (&g_battle_descr), |
91 | - m_first (&First), |
92 | - m_second (&Second), |
93 | - m_readyflags (0), |
94 | - m_damage (0), |
95 | - m_first_strikes(true) |
96 | + first_ (&First), |
97 | + second_ (&Second), |
98 | + readyflags_ (0), |
99 | + damage_ (0), |
100 | + first_strikes_(true) |
101 | { |
102 | assert(First.get_owner() != Second.get_owner()); |
103 | { |
104 | @@ -81,30 +81,30 @@ |
105 | { |
106 | MapObject::init(egbase); |
107 | |
108 | - m_creationtime = egbase.get_gametime(); |
109 | + creationtime_ = egbase.get_gametime(); |
110 | |
111 | Game& game = dynamic_cast<Game&>(egbase); |
112 | |
113 | - if (Battle* battle = m_first ->get_battle()) { |
114 | - battle->cancel(game, *m_first); |
115 | - } |
116 | - m_first->set_battle(game, this); |
117 | - if (Battle* battle = m_second->get_battle()) { |
118 | - battle->cancel(game, *m_second); |
119 | - } |
120 | - m_second->set_battle(game, this); |
121 | + if (Battle* battle = first_ ->get_battle()) { |
122 | + battle->cancel(game, *first_); |
123 | + } |
124 | + first_->set_battle(game, this); |
125 | + if (Battle* battle = second_->get_battle()) { |
126 | + battle->cancel(game, *second_); |
127 | + } |
128 | + second_->set_battle(game, this); |
129 | } |
130 | |
131 | |
132 | void Battle::cleanup (EditorGameBase & egbase) |
133 | { |
134 | - if (m_first) { |
135 | - m_first ->set_battle(dynamic_cast<Game&>(egbase), nullptr); |
136 | - m_first = nullptr; |
137 | + if (first_) { |
138 | + first_ ->set_battle(dynamic_cast<Game&>(egbase), nullptr); |
139 | + first_ = nullptr; |
140 | } |
141 | - if (m_second) { |
142 | - m_second->set_battle(dynamic_cast<Game&>(egbase), nullptr); |
143 | - m_second = nullptr; |
144 | + if (second_) { |
145 | + second_->set_battle(dynamic_cast<Game&>(egbase), nullptr); |
146 | + second_ = nullptr; |
147 | } |
148 | |
149 | MapObject::cleanup(egbase); |
150 | @@ -116,11 +116,11 @@ |
151 | */ |
152 | void Battle::cancel(Game & game, Soldier & soldier) |
153 | { |
154 | - if (&soldier == m_first) { |
155 | - m_first = nullptr; |
156 | + if (&soldier == first_) { |
157 | + first_ = nullptr; |
158 | soldier.set_battle(game, nullptr); |
159 | - } else if (&soldier == m_second) { |
160 | - m_second = nullptr; |
161 | + } else if (&soldier == second_) { |
162 | + second_ = nullptr; |
163 | soldier.set_battle(game, nullptr); |
164 | } else |
165 | return; |
166 | @@ -131,17 +131,17 @@ |
167 | |
168 | bool Battle::locked(Game & game) |
169 | { |
170 | - if (!m_first || !m_second) |
171 | + if (!first_ || !second_) |
172 | return false; |
173 | - if (game.get_gametime() - m_creationtime < 1000) |
174 | + if (game.get_gametime() - creationtime_ < 1000) |
175 | return true; // don't change battles around willy-nilly |
176 | - return m_first->get_position() == m_second->get_position(); |
177 | + return first_->get_position() == second_->get_position(); |
178 | } |
179 | |
180 | Soldier * Battle::opponent(Soldier& soldier) |
181 | { |
182 | - assert(m_first == &soldier || m_second == &soldier); |
183 | - Soldier* other_soldier = m_first == &soldier ? m_second : m_first; |
184 | + assert(first_ == &soldier || second_ == &soldier); |
185 | + Soldier* other_soldier = first_ == &soldier ? second_ : first_; |
186 | return other_soldier; |
187 | } |
188 | |
189 | @@ -153,35 +153,35 @@ |
190 | void Battle::get_battle_work(Game & game, Soldier & soldier) |
191 | { |
192 | // Identify what soldier is calling the routine |
193 | - uint8_t const this_soldier_is = &soldier == m_first ? 1 : 2; |
194 | + uint8_t const this_soldier_is = &soldier == first_ ? 1 : 2; |
195 | |
196 | - assert(m_first->get_battle() == this || m_second->get_battle() == this); |
197 | + assert(first_->get_battle() == this || second_->get_battle() == this); |
198 | |
199 | // Created this four 'states' of the battle: |
200 | // *First time entered, one enters : |
201 | - // oneReadyToFight, mark m_readyflags as he is ready to fight |
202 | + // oneReadyToFight, mark readyflags_ as he is ready to fight |
203 | // *Next time, the opponent enters: |
204 | - // bothReadyToFight, mark m_readyflags as 3 (round fighted) |
205 | + // bothReadyToFight, mark readyflags_ as 3 (round fighted) |
206 | // *Next time, the first enters again: |
207 | - // roundFought, reset m_readyflags |
208 | + // roundFought, reset readyflags_ |
209 | // *Opponent not on field yet, so one enters : |
210 | // waitingForOpponent, if others are false |
211 | |
212 | - bool const oneReadyToFight = (m_readyflags == 0); |
213 | - bool const roundFought = (m_readyflags == 3); |
214 | - bool const bothReadyToFight = ((this_soldier_is | m_readyflags) == 3) && |
215 | + bool const oneReadyToFight = (readyflags_ == 0); |
216 | + bool const roundFought = (readyflags_ == 3); |
217 | + bool const bothReadyToFight = ((this_soldier_is | readyflags_) == 3) && |
218 | (!roundFought); |
219 | bool const waitingForOpponent = !(oneReadyToFight || roundFought || bothReadyToFight); |
220 | std::string what_anim; |
221 | |
222 | // Apply pending damage |
223 | - if (m_damage && oneReadyToFight) { |
224 | + if (damage_ && oneReadyToFight) { |
225 | // Current attacker is last defender, so damage goes to current attacker |
226 | - if (m_first_strikes) |
227 | - m_first ->damage(m_damage); |
228 | + if (first_strikes_) |
229 | + first_ ->damage(damage_); |
230 | else |
231 | - m_second->damage(m_damage); |
232 | - m_damage = 0; |
233 | + second_->damage(damage_); |
234 | + damage_ = 0; |
235 | } |
236 | |
237 | if (soldier.get_current_hitpoints() < 1) { |
238 | @@ -194,15 +194,15 @@ |
239 | return schedule_destroy(game); |
240 | } |
241 | |
242 | - if (!m_first || !m_second) |
243 | + if (!first_ || !second_) |
244 | return soldier.skip_act(); |
245 | |
246 | // Here is a timeout to prevent battle freezes |
247 | - if (waitingForOpponent && (game.get_gametime() - m_creationtime) > 90 * 1000) { |
248 | + if (waitingForOpponent && (game.get_gametime() - creationtime_) > 90 * 1000) { |
249 | molog("[battle] soldier %u waiting for opponent %u too long (%5d sec), cancelling battle...\n", |
250 | soldier.serial(), |
251 | opponent(soldier)->serial(), |
252 | - (game.get_gametime() - m_creationtime) / 1000); |
253 | + (game.get_gametime() - creationtime_) / 1000); |
254 | cancel(game, soldier); |
255 | return; |
256 | } |
257 | @@ -220,9 +220,9 @@ |
258 | // |
259 | if (oneReadyToFight) { |
260 | // My opponent is not ready to battle. Idle until he wakes me up. |
261 | - assert(m_readyflags == 0); |
262 | - m_readyflags = this_soldier_is; |
263 | - assert(m_readyflags == this_soldier_is); |
264 | + assert(readyflags_ == 0); |
265 | + readyflags_ = this_soldier_is; |
266 | + assert(readyflags_ == this_soldier_is); |
267 | |
268 | what_anim = this_soldier_is == 1 ? |
269 | "evade_success_e" : |
270 | @@ -236,12 +236,12 @@ |
271 | // Time for one of us to hurt the other. Which one is on turn is decided |
272 | // by calculate_round. |
273 | assert |
274 | - ((m_readyflags == 1 && this_soldier_is == 2) || |
275 | - (m_readyflags == 2 && this_soldier_is == 1)); |
276 | + ((readyflags_ == 1 && this_soldier_is == 2) || |
277 | + (readyflags_ == 2 && this_soldier_is == 1)); |
278 | |
279 | // Both are now ready, mark flags, so our opponent can get new animation |
280 | - m_readyflags = 3; |
281 | - assert(m_readyflags == 3); |
282 | + readyflags_ = 3; |
283 | + assert(readyflags_ == 3); |
284 | |
285 | // Resolve combat turn |
286 | calculate_round(game); |
287 | @@ -253,23 +253,23 @@ |
288 | if (roundFought) { |
289 | // Both of us were already ready. That means that we already fought and |
290 | // it is time to wait until both become ready. |
291 | - m_readyflags = 0; |
292 | + readyflags_ = 0; |
293 | } |
294 | |
295 | - // The function calculate_round inverts value of m_first_strikes, so |
296 | - // attacker will be the m_first when m_first_strikes = false and |
297 | - // attacker will be m_second when m_first_strikes = true |
298 | + // The function calculate_round inverts value of first_strikes_, so |
299 | + // attacker will be the first_ when first_strikes_ = false and |
300 | + // attacker will be second_ when first_strikes_ = true |
301 | molog |
302 | ("[battle] (%u) vs (%u) is %d, first strikes %d, last hit %d\n", |
303 | soldier.serial(), |
304 | opponent(soldier)->serial(), |
305 | this_soldier_is, |
306 | - m_first_strikes, |
307 | - m_last_attack_hits); |
308 | + first_strikes_, |
309 | + last_attack_hits_); |
310 | |
311 | if (this_soldier_is == 1) { |
312 | - if (m_first_strikes) { |
313 | - if (m_last_attack_hits) { |
314 | + if (first_strikes_) { |
315 | + if (last_attack_hits_) { |
316 | what_anim = "evade_failure_e"; |
317 | } |
318 | else { |
319 | @@ -277,7 +277,7 @@ |
320 | } |
321 | } |
322 | else { |
323 | - if (m_last_attack_hits) { |
324 | + if (last_attack_hits_) { |
325 | what_anim = "attack_success_e"; |
326 | } |
327 | else { |
328 | @@ -285,8 +285,8 @@ |
329 | } |
330 | } |
331 | } else { |
332 | - if (m_first_strikes) { |
333 | - if (m_last_attack_hits) { |
334 | + if (first_strikes_) { |
335 | + if (last_attack_hits_) { |
336 | what_anim = "attack_success_w"; |
337 | } |
338 | else { |
339 | @@ -294,7 +294,7 @@ |
340 | } |
341 | } |
342 | else { |
343 | - if (m_last_attack_hits) { |
344 | + if (last_attack_hits_) { |
345 | what_anim = "evade_failure_w"; |
346 | } |
347 | else { |
348 | @@ -312,25 +312,25 @@ |
349 | |
350 | void Battle::calculate_round(Game & game) |
351 | { |
352 | - assert(!m_damage); |
353 | + assert(!damage_); |
354 | |
355 | Soldier * attacker; |
356 | Soldier * defender; |
357 | |
358 | - if (m_first_strikes) { |
359 | - attacker = m_first; |
360 | - defender = m_second; |
361 | + if (first_strikes_) { |
362 | + attacker = first_; |
363 | + defender = second_; |
364 | } else { |
365 | - attacker = m_second; |
366 | - defender = m_first; |
367 | + attacker = second_; |
368 | + defender = first_; |
369 | } |
370 | |
371 | - m_first_strikes = !m_first_strikes; |
372 | + first_strikes_ = !first_strikes_; |
373 | |
374 | uint32_t const hit = game.logic_rand() % 100; |
375 | if (hit > defender->get_evade()) { |
376 | // Attacker hits! |
377 | - m_last_attack_hits = true; |
378 | + last_attack_hits_ = true; |
379 | |
380 | assert(attacker->get_min_attack() <= attacker->get_max_attack()); |
381 | uint32_t const attack = |
382 | @@ -338,11 +338,11 @@ |
383 | (game.logic_rand() |
384 | % |
385 | (1 + attacker->get_max_attack() - attacker->get_min_attack())); |
386 | - m_damage = attack - (attack * defender->get_defense()) / 100; |
387 | + damage_ = attack - (attack * defender->get_defense()) / 100; |
388 | } |
389 | else { |
390 | // Defender evaded |
391 | - m_last_attack_hits = false; |
392 | + last_attack_hits_ = false; |
393 | } |
394 | } |
395 | |
396 | @@ -363,12 +363,12 @@ |
397 | |
398 | Battle & battle = get<Battle>(); |
399 | |
400 | - battle.m_creationtime = fr.signed_32(); |
401 | - battle.m_readyflags = fr.unsigned_8(); |
402 | - battle.m_first_strikes = fr.unsigned_8(); |
403 | - battle.m_damage = fr.unsigned_32(); |
404 | - m_first = fr.unsigned_32(); |
405 | - m_second = fr.unsigned_32(); |
406 | + battle.creationtime_ = fr.signed_32(); |
407 | + battle.readyflags_ = fr.unsigned_8(); |
408 | + battle.first_strikes_ = fr.unsigned_8(); |
409 | + battle.damage_ = fr.unsigned_32(); |
410 | + first_ = fr.unsigned_32(); |
411 | + second_ = fr.unsigned_32(); |
412 | } |
413 | |
414 | void Battle::Loader::load_pointers() |
415 | @@ -376,17 +376,17 @@ |
416 | Battle & battle = get<Battle>(); |
417 | try { |
418 | MapObject::Loader::load_pointers(); |
419 | - if (m_first) |
420 | + if (first_) |
421 | try { |
422 | - battle.m_first = &mol().get<Soldier>(m_first); |
423 | + battle.first_ = &mol().get<Soldier>(first_); |
424 | } catch (const WException & e) { |
425 | - throw wexception("soldier 1 (%u): %s", m_first, e.what()); |
426 | + throw wexception("soldier 1 (%u): %s", first_, e.what()); |
427 | } |
428 | - if (m_second) |
429 | + if (second_) |
430 | try { |
431 | - battle.m_second = &mol().get<Soldier>(m_second); |
432 | + battle.second_ = &mol().get<Soldier>(second_); |
433 | } catch (const WException & e) { |
434 | - throw wexception("soldier 2 (%u): %s", m_second, e.what()); |
435 | + throw wexception("soldier 2 (%u): %s", second_, e.what()); |
436 | } |
437 | } catch (const WException & e) { |
438 | throw wexception("battle: %s", e.what()); |
439 | @@ -401,14 +401,14 @@ |
440 | |
441 | MapObject::save(egbase, mos, fw); |
442 | |
443 | - fw.signed_32(m_creationtime); |
444 | - fw.unsigned_8(m_readyflags); |
445 | - fw.unsigned_8(m_first_strikes); |
446 | - fw.unsigned_32(m_damage); |
447 | + fw.signed_32(creationtime_); |
448 | + fw.unsigned_8(readyflags_); |
449 | + fw.unsigned_8(first_strikes_); |
450 | + fw.unsigned_32(damage_); |
451 | |
452 | // And now, the serials of the soldiers ! |
453 | - fw.unsigned_32(m_first ? mos.get_object_file_index(*m_first) : 0); |
454 | - fw.unsigned_32(m_second ? mos.get_object_file_index(*m_second) : 0); |
455 | + fw.unsigned_32(first_ ? mos.get_object_file_index(*first_) : 0); |
456 | + fw.unsigned_32(second_ ? mos.get_object_file_index(*second_) : 0); |
457 | } |
458 | |
459 | |
460 | |
461 | === modified file 'src/logic/map_objects/tribes/battle.h' |
462 | --- src/logic/map_objects/tribes/battle.h 2015-11-29 09:43:15 +0000 |
463 | +++ src/logic/map_objects/tribes/battle.h 2016-02-08 18:17:36 +0000 |
464 | @@ -66,8 +66,8 @@ |
465 | bool locked(Game &); |
466 | |
467 | // The two soldiers involved in this fight. |
468 | - Soldier * first() {return m_first;} |
469 | - Soldier * second() {return m_second;} |
470 | + Soldier * first() {return first_;} |
471 | + Soldier * second() {return second_;} |
472 | |
473 | // Returns the other soldier involved in this battle. CHECKs that the given |
474 | // soldier is participating in this battle. Can return nullptr, but I have |
475 | @@ -83,41 +83,41 @@ |
476 | virtual void load(FileRead &); |
477 | void load_pointers() override; |
478 | |
479 | - Serial m_first; |
480 | - Serial m_second; |
481 | + Serial first_; |
482 | + Serial second_; |
483 | }; |
484 | |
485 | void calculate_round(Game &); |
486 | |
487 | - Soldier * m_first; |
488 | - Soldier * m_second; |
489 | + Soldier * first_; |
490 | + Soldier * second_; |
491 | |
492 | /** |
493 | * Gametime when the battle was created. |
494 | */ |
495 | - int32_t m_creationtime; |
496 | + int32_t creationtime_; |
497 | |
498 | /** |
499 | * 1 if only the first soldier is ready, 2 if only the second soldier |
500 | * is ready, 3 if both are ready. |
501 | */ |
502 | - uint8_t m_readyflags; |
503 | + uint8_t readyflags_; |
504 | |
505 | /** |
506 | * Damage pending to apply. Damage is applied at end of round so animations |
507 | * can show current action. |
508 | */ |
509 | - uint32_t m_damage; |
510 | + uint32_t damage_; |
511 | |
512 | /** |
513 | * \c true if the first soldier is the next to strike. |
514 | */ |
515 | - bool m_first_strikes; |
516 | + bool first_strikes_; |
517 | |
518 | /** |
519 | * \c true if the last turn attacker damaged his opponent |
520 | */ |
521 | - bool m_last_attack_hits; |
522 | + bool last_attack_hits_; |
523 | }; |
524 | |
525 | } |
526 | |
527 | === modified file 'src/logic/map_objects/tribes/building.cc' |
528 | --- src/logic/map_objects/tribes/building.cc 2016-02-07 09:30:20 +0000 |
529 | +++ src/logic/map_objects/tribes/building.cc 2016-02-08 18:17:36 +0000 |
530 | @@ -60,15 +60,15 @@ |
531 | : |
532 | MapObjectDescr(_type, table.get_string("name"), init_descname, table), |
533 | egbase_ (egbase), |
534 | - m_buildable (false), |
535 | - m_size (BaseImmovable::SMALL), |
536 | - m_mine (false), |
537 | - m_port (false), |
538 | - m_enhancement (INVALID_INDEX), |
539 | - m_enhanced_from (INVALID_INDEX), |
540 | - m_enhanced_building(false), |
541 | - m_hints (table.get_table("aihints")), |
542 | - m_vision_range (0) |
543 | + buildable_ (false), |
544 | + size_ (BaseImmovable::SMALL), |
545 | + mine_ (false), |
546 | + port_ (false), |
547 | + enhancement_ (INVALID_INDEX), |
548 | + enhanced_from_ (INVALID_INDEX), |
549 | + enhanced_building_(false), |
550 | + hints_ (table.get_table("aihints")), |
551 | + vision_range_ (0) |
552 | { |
553 | if (!is_animation_known("idle")) { |
554 | throw GameDataError("Building %s has no idle animation", table.get_string("name").c_str()); |
555 | @@ -84,17 +84,17 @@ |
556 | try { |
557 | const std::string size = table.get_string("size"); |
558 | if (boost::iequals(size, "small")) { |
559 | - m_size = BaseImmovable::SMALL; |
560 | + size_ = BaseImmovable::SMALL; |
561 | } else if (boost::iequals(size, "medium")) { |
562 | - m_size = BaseImmovable::MEDIUM; |
563 | + size_ = BaseImmovable::MEDIUM; |
564 | } else if (boost::iequals(size, "big")) { |
565 | - m_size = BaseImmovable::BIG; |
566 | + size_ = BaseImmovable::BIG; |
567 | } else if (boost::iequals(size, "mine")) { |
568 | - m_size = BaseImmovable::SMALL; |
569 | - m_mine = true; |
570 | + size_ = BaseImmovable::SMALL; |
571 | + mine_ = true; |
572 | } else if (boost::iequals(size, "port")) { |
573 | - m_size = BaseImmovable::BIG; |
574 | - m_port = true; |
575 | + size_ = BaseImmovable::BIG; |
576 | + port_ = true; |
577 | } else { |
578 | throw GameDataError |
579 | ("expected %s but found \"%s\"", |
580 | @@ -106,7 +106,7 @@ |
581 | } |
582 | |
583 | // Parse build options |
584 | - m_destructible = table.has_key("destructible") ? table.get_bool("destructible") : true; |
585 | + destructible_ = table.has_key("destructible") ? table.get_bool("destructible") : true; |
586 | |
587 | if (table.has_key("enhancement")) { |
588 | const std::string enh = table.get_string("enhancement"); |
589 | @@ -116,14 +116,14 @@ |
590 | } |
591 | DescriptionIndex const en_i = egbase_.tribes().building_index(enh); |
592 | if (egbase_.tribes().building_exists(en_i)) { |
593 | - m_enhancement = en_i; |
594 | + enhancement_ = en_i; |
595 | |
596 | // Merge the enhancements workarea info into this building's |
597 | // workarea info. |
598 | const BuildingDescr * tmp_enhancement = egbase_.tribes().get_building_descr(en_i); |
599 | - for (std::pair<uint32_t, std::set<std::string>> area : tmp_enhancement->m_workarea_info) |
600 | + for (std::pair<uint32_t, std::set<std::string>> area : tmp_enhancement->workarea_info_) |
601 | { |
602 | - std::set<std::string> & strs = m_workarea_info[area.first]; |
603 | + std::set<std::string> & strs = workarea_info_[area.first]; |
604 | for (std::string str : area.second) |
605 | strs.insert(str); |
606 | } |
607 | @@ -135,10 +135,10 @@ |
608 | } |
609 | |
610 | if (table.has_key("buildcost")) { |
611 | - m_buildable = true; |
612 | + buildable_ = true; |
613 | try { |
614 | - m_buildcost = Buildcost(table.get_table("buildcost"), egbase_.tribes()); |
615 | - m_return_dismantle = Buildcost(table.get_table("return_on_dismantle"), egbase_.tribes()); |
616 | + buildcost_ = Buildcost(table.get_table("buildcost"), egbase_.tribes()); |
617 | + return_dismantle_ = Buildcost(table.get_table("return_on_dismantle"), egbase_.tribes()); |
618 | } catch (const WException & e) { |
619 | throw wexception |
620 | ("A buildable building must define \"buildcost\" and \"return_on_dismantle\": %s", |
621 | @@ -146,10 +146,10 @@ |
622 | } |
623 | } |
624 | if (table.has_key("enhancement_cost")) { |
625 | - m_enhanced_building = true; |
626 | + enhanced_building_ = true; |
627 | try { |
628 | - m_enhance_cost = Buildcost(table.get_table("enhancement_cost"), egbase_.tribes()); |
629 | - m_return_enhanced = Buildcost(table.get_table("return_on_dismantle_on_enhanced"), egbase_.tribes()); |
630 | + enhance_cost_ = Buildcost(table.get_table("enhancement_cost"), egbase_.tribes()); |
631 | + return_enhanced_ = Buildcost(table.get_table("return_on_dismantle_on_enhanced"), egbase_.tribes()); |
632 | } catch (const WException & e) { |
633 | throw wexception |
634 | ("An enhanced building must define \"enhancement_cost\"" |
635 | @@ -159,10 +159,10 @@ |
636 | |
637 | helptext_script_ = table.get_string("helptext_script"); |
638 | |
639 | - m_needs_seafaring = table.has_key("needs_seafaring") ? table.get_bool("needs_seafaring") : false; |
640 | + needs_seafaring_ = table.has_key("needs_seafaring") ? table.get_bool("needs_seafaring") : false; |
641 | |
642 | if (table.has_key("vision_range")) { |
643 | - m_vision_range = table.get_int("vision_range"); |
644 | + vision_range_ = table.get_int("vision_range"); |
645 | } |
646 | } |
647 | |
648 | @@ -177,10 +177,10 @@ |
649 | const |
650 | { |
651 | Building & b = construct ? create_constructionsite() : create_object(); |
652 | - b.m_position = pos; |
653 | + b.position_ = pos; |
654 | b.set_owner(&owner); |
655 | for (DescriptionIndex idx : former_buildings) { |
656 | - b.m_old_buildings.push_back(idx); |
657 | + b.old_buildings_.push_back(idx); |
658 | } |
659 | if (loading) { |
660 | b.Building::init(egbase); |
661 | @@ -192,7 +192,7 @@ |
662 | |
663 | |
664 | int32_t BuildingDescr::suitability(const Map &, FCoords const fc) const { |
665 | - return m_size <= (fc.field->nodecaps() & Widelands::BUILDCAPS_SIZEMASK); |
666 | + return size_ <= (fc.field->nodecaps() & Widelands::BUILDCAPS_SIZEMASK); |
667 | } |
668 | |
669 | /** |
670 | @@ -212,7 +212,7 @@ |
671 | */ |
672 | uint32_t BuildingDescr::vision_range() const |
673 | { |
674 | - return m_vision_range ? m_vision_range : get_conquers() + 4; |
675 | + return vision_range_ ? vision_range_ : get_conquers() + 4; |
676 | } |
677 | |
678 | |
679 | @@ -244,18 +244,18 @@ |
680 | |
681 | Building::Building(const BuildingDescr & building_descr) : |
682 | PlayerImmovable(building_descr), |
683 | - m_optionswindow(nullptr), |
684 | - m_flag (nullptr), |
685 | - m_anim(0), |
686 | - m_animstart(0), |
687 | - m_leave_time(0), |
688 | - m_defeating_player(0), |
689 | - m_seeing(false) |
690 | + optionswindow_(nullptr), |
691 | + flag_ (nullptr), |
692 | + anim_(0), |
693 | + animstart_(0), |
694 | + leave_time_(0), |
695 | + defeating_player_(0), |
696 | + seeing_(false) |
697 | {} |
698 | |
699 | Building::~Building() |
700 | { |
701 | - if (m_optionswindow) |
702 | + if (optionswindow_) |
703 | hide_options(); |
704 | } |
705 | |
706 | @@ -294,9 +294,9 @@ |
707 | return false; |
708 | }; |
709 | |
710 | - m_leave_queue.erase( |
711 | - std::remove_if(m_leave_queue.begin(), m_leave_queue.end(), should_be_deleted), |
712 | - m_leave_queue.end()); |
713 | + leave_queue_.erase( |
714 | + std::remove_if(leave_queue_.begin(), leave_queue_.end(), should_be_deleted), |
715 | + leave_queue_.end()); |
716 | } |
717 | |
718 | int32_t Building::get_size() const {return descr().get_size();} |
719 | @@ -305,7 +305,7 @@ |
720 | |
721 | Flag & Building::base_flag() |
722 | { |
723 | - return *m_flag; |
724 | + return *flag_; |
725 | } |
726 | |
727 | |
728 | @@ -331,8 +331,8 @@ |
729 | |
730 | void Building::start_animation(EditorGameBase & egbase, uint32_t const anim) |
731 | { |
732 | - m_anim = anim; |
733 | - m_animstart = egbase.get_gametime(); |
734 | + anim_ = anim; |
735 | + animstart_ = egbase.get_gametime(); |
736 | } |
737 | |
738 | /* |
739 | @@ -349,29 +349,29 @@ |
740 | Map & map = egbase.map(); |
741 | Coords neighb; |
742 | |
743 | - set_position(egbase, m_position); |
744 | + set_position(egbase, position_); |
745 | |
746 | if (get_size() == BIG) { |
747 | - map.get_ln(m_position, &neighb); |
748 | - set_position(egbase, neighb); |
749 | - |
750 | - map.get_tln(m_position, &neighb); |
751 | - set_position(egbase, neighb); |
752 | - |
753 | - map.get_trn(m_position, &neighb); |
754 | + map.get_ln(position_, &neighb); |
755 | + set_position(egbase, neighb); |
756 | + |
757 | + map.get_tln(position_, &neighb); |
758 | + set_position(egbase, neighb); |
759 | + |
760 | + map.get_trn(position_, &neighb); |
761 | set_position(egbase, neighb); |
762 | } |
763 | |
764 | // Make sure the flag is there |
765 | |
766 | |
767 | - map.get_brn(m_position, &neighb); |
768 | + map.get_brn(position_, &neighb); |
769 | { |
770 | Flag * flag = dynamic_cast<Flag *>(map.get_immovable(neighb)); |
771 | if (!flag) |
772 | flag = |
773 | new Flag (egbase, owner(), neighb); |
774 | - m_flag = flag; |
775 | + flag_ = flag; |
776 | flag->attach_building(egbase, *this); |
777 | } |
778 | |
779 | @@ -381,14 +381,14 @@ |
780 | else |
781 | start_animation(egbase, descr().get_animation("idle")); |
782 | |
783 | - m_leave_time = egbase.get_gametime(); |
784 | + leave_time_ = egbase.get_gametime(); |
785 | } |
786 | |
787 | |
788 | void Building::cleanup(EditorGameBase & egbase) |
789 | { |
790 | - if (m_defeating_player) { |
791 | - Player & defeating_player = egbase.player(m_defeating_player); |
792 | + if (defeating_player_) { |
793 | + Player & defeating_player = egbase.player(defeating_player_); |
794 | if (descr().get_conquers()) { |
795 | owner() .count_msite_lost (); |
796 | defeating_player.count_msite_defeated (); |
797 | @@ -399,22 +399,22 @@ |
798 | } |
799 | |
800 | // Remove from flag |
801 | - m_flag->detach_building(egbase); |
802 | + flag_->detach_building(egbase); |
803 | |
804 | // Unset the building |
805 | - unset_position(egbase, m_position); |
806 | + unset_position(egbase, position_); |
807 | |
808 | if (get_size() == BIG) { |
809 | Map & map = egbase.map(); |
810 | Coords neighb; |
811 | |
812 | - map.get_ln(m_position, &neighb); |
813 | - unset_position(egbase, neighb); |
814 | - |
815 | - map.get_tln(m_position, &neighb); |
816 | - unset_position(egbase, neighb); |
817 | - |
818 | - map.get_trn(m_position, &neighb); |
819 | + map.get_ln(position_, &neighb); |
820 | + unset_position(egbase, neighb); |
821 | + |
822 | + map.get_tln(position_, &neighb); |
823 | + unset_position(egbase, neighb); |
824 | + |
825 | + map.get_trn(position_, &neighb); |
826 | unset_position(egbase, neighb); |
827 | } |
828 | |
829 | @@ -447,18 +447,18 @@ |
830 | { |
831 | PositionList rv; |
832 | |
833 | - rv.push_back(m_position); |
834 | + rv.push_back(position_); |
835 | if (get_size() == BIG) { |
836 | Map & map = egbase.map(); |
837 | Coords neighb; |
838 | |
839 | - map.get_ln(m_position, &neighb); |
840 | - rv.push_back(neighb); |
841 | - |
842 | - map.get_tln(m_position, &neighb); |
843 | - rv.push_back(neighb); |
844 | - |
845 | - map.get_trn(m_position, &neighb); |
846 | + map.get_ln(position_, &neighb); |
847 | + rv.push_back(neighb); |
848 | + |
849 | + map.get_tln(position_, &neighb); |
850 | + rv.push_back(neighb); |
851 | + |
852 | + map.get_trn(position_, &neighb); |
853 | rv.push_back(neighb); |
854 | } |
855 | return rv; |
856 | @@ -474,7 +474,7 @@ |
857 | void Building::destroy(EditorGameBase & egbase) |
858 | { |
859 | const bool fire = burn_on_destroy(); |
860 | - const Coords pos = m_position; |
861 | + const Coords pos = position_; |
862 | PlayerImmovable::destroy(egbase); |
863 | // We are deleted. Only use stack variables beyond this point |
864 | if (fire) |
865 | @@ -541,24 +541,24 @@ |
866 | */ |
867 | bool Building::leave_check_and_wait(Game & game, Worker & w) |
868 | { |
869 | - if (&w == m_leave_allow.get(game)) { |
870 | - m_leave_allow = nullptr; |
871 | + if (&w == leave_allow_.get(game)) { |
872 | + leave_allow_ = nullptr; |
873 | return true; |
874 | } |
875 | |
876 | // Check time and queue |
877 | uint32_t const time = game.get_gametime(); |
878 | |
879 | - if (m_leave_queue.empty()) { |
880 | - if (m_leave_time <= time) { |
881 | - m_leave_time = time + BUILDING_LEAVE_INTERVAL; |
882 | + if (leave_queue_.empty()) { |
883 | + if (leave_time_ <= time) { |
884 | + leave_time_ = time + BUILDING_LEAVE_INTERVAL; |
885 | return true; |
886 | } |
887 | |
888 | - schedule_act(game, m_leave_time - time); |
889 | + schedule_act(game, leave_time_ - time); |
890 | } |
891 | |
892 | - m_leave_queue.push_back(&w); |
893 | + leave_queue_.push_back(&w); |
894 | return false; |
895 | } |
896 | |
897 | @@ -574,10 +574,10 @@ |
898 | void Building::leave_skip(Game &, Worker & w) |
899 | { |
900 | LeaveQueue::iterator const it = |
901 | - std::find(m_leave_queue.begin(), m_leave_queue.end(), &w); |
902 | + std::find(leave_queue_.begin(), leave_queue_.end(), &w); |
903 | |
904 | - if (it != m_leave_queue.end()) |
905 | - m_leave_queue.erase(it); |
906 | + if (it != leave_queue_.end()) |
907 | + leave_queue_.erase(it); |
908 | } |
909 | |
910 | |
911 | @@ -590,31 +590,31 @@ |
912 | { |
913 | uint32_t const time = game.get_gametime(); |
914 | |
915 | - if (m_leave_time <= time) { |
916 | + if (leave_time_ <= time) { |
917 | bool wakeup = false; |
918 | |
919 | // Wake up one worker |
920 | - while (!m_leave_queue.empty()) { |
921 | - upcast(Worker, worker, m_leave_queue[0].get(game)); |
922 | + while (!leave_queue_.empty()) { |
923 | + upcast(Worker, worker, leave_queue_[0].get(game)); |
924 | |
925 | - m_leave_queue.erase(m_leave_queue.begin()); |
926 | + leave_queue_.erase(leave_queue_.begin()); |
927 | |
928 | if (worker) { |
929 | - m_leave_allow = worker; |
930 | + leave_allow_ = worker; |
931 | |
932 | if (worker->wakeup_leave_building(game, *this)) { |
933 | - m_leave_time = time + BUILDING_LEAVE_INTERVAL; |
934 | + leave_time_ = time + BUILDING_LEAVE_INTERVAL; |
935 | wakeup = true; |
936 | break; |
937 | } |
938 | } |
939 | } |
940 | |
941 | - if (!m_leave_queue.empty()) |
942 | - schedule_act(game, m_leave_time - time); |
943 | + if (!leave_queue_.empty()) |
944 | + schedule_act(game, leave_time_ - time); |
945 | |
946 | if (!wakeup) |
947 | - m_leave_time = time; // make sure leave_time doesn't get too far behind |
948 | + leave_time_ = time; // make sure leave_time doesn't get too far behind |
949 | } |
950 | |
951 | PlayerImmovable::act(game, data); |
952 | @@ -647,9 +647,9 @@ |
953 | void Building::draw |
954 | (const EditorGameBase& game, RenderTarget& dst, const FCoords& coords, const Point& pos) |
955 | { |
956 | - if (coords == m_position) { // draw big buildings only once |
957 | + if (coords == position_) { // draw big buildings only once |
958 | dst.blit_animation( |
959 | - pos, m_anim, game.get_gametime() - m_animstart, get_owner()->get_playercolor()); |
960 | + pos, anim_, game.get_gametime() - animstart_, get_owner()->get_playercolor()); |
961 | |
962 | // door animation? |
963 | |
964 | @@ -699,8 +699,8 @@ |
965 | // if priority is defined for specific ware, |
966 | // combine base priority and ware priority |
967 | std::map<DescriptionIndex, int32_t>::const_iterator it = |
968 | - m_ware_priorities.find(ware_index); |
969 | - if (it != m_ware_priorities.end()) |
970 | + ware_priorities_.find(ware_index); |
971 | + if (it != ware_priorities_.end()) |
972 | priority = adjust |
973 | ? (priority * it->second / DEFAULT_PRIORITY) |
974 | : it->second; |
975 | @@ -716,11 +716,11 @@ |
976 | void Building::collect_priorities |
977 | (std::map<int32_t, std::map<DescriptionIndex, int32_t> > & p) const |
978 | { |
979 | - if (m_ware_priorities.empty()) |
980 | + if (ware_priorities_.empty()) |
981 | return; |
982 | std::map<DescriptionIndex, int32_t> & ware_priorities = p[wwWARE]; |
983 | std::map<DescriptionIndex, int32_t>::const_iterator it; |
984 | - for (it = m_ware_priorities.begin(); it != m_ware_priorities.end(); ++it) { |
985 | + for (it = ware_priorities_.begin(); it != ware_priorities_.end(); ++it) { |
986 | if (it->second == DEFAULT_PRIORITY) |
987 | continue; |
988 | ware_priorities[it->first] = it->second; |
989 | @@ -736,7 +736,7 @@ |
990 | int32_t const new_priority) |
991 | { |
992 | if (type == wwWARE) { |
993 | - m_ware_priorities[ware_index] = new_priority; |
994 | + ware_priorities_[ware_index] = new_priority; |
995 | } |
996 | } |
997 | |
998 | @@ -744,21 +744,21 @@ |
999 | void Building::log_general_info(const EditorGameBase & egbase) { |
1000 | PlayerImmovable::log_general_info(egbase); |
1001 | |
1002 | - molog("m_position: (%i, %i)\n", m_position.x, m_position.y); |
1003 | - molog("m_flag: %p\n", m_flag); |
1004 | + molog("position: (%i, %i)\n", position_.x, position_.y); |
1005 | + molog("flag: %p\n", flag_); |
1006 | molog |
1007 | ("* position: (%i, %i)\n", |
1008 | - m_flag->get_position().x, m_flag->get_position().y); |
1009 | - |
1010 | - molog("m_anim: %s\n", descr().get_animation_name(m_anim).c_str()); |
1011 | - molog("m_animstart: %i\n", m_animstart); |
1012 | - |
1013 | - molog("m_leave_time: %i\n", m_leave_time); |
1014 | + flag_->get_position().x, flag_->get_position().y); |
1015 | + |
1016 | + molog("anim: %s\n", descr().get_animation_name(anim_).c_str()); |
1017 | + molog("animstart: %i\n", animstart_); |
1018 | + |
1019 | + molog("leave_time: %i\n", leave_time_); |
1020 | |
1021 | molog |
1022 | - ("m_leave_queue.size(): %lu\n", |
1023 | - static_cast<long unsigned int>(m_leave_queue.size())); |
1024 | - molog("m_leave_allow.get(): %p\n", m_leave_allow.get(egbase)); |
1025 | + ("leave_queue.size(): %lu\n", |
1026 | + static_cast<long unsigned int>(leave_queue_.size())); |
1027 | + molog("leave_allow.get(): %p\n", leave_allow_.get(egbase)); |
1028 | } |
1029 | |
1030 | |
1031 | @@ -788,7 +788,7 @@ |
1032 | */ |
1033 | void Building::set_seeing(bool see) |
1034 | { |
1035 | - if (see == m_seeing) |
1036 | + if (see == seeing_) |
1037 | return; |
1038 | |
1039 | Player & player = owner(); |
1040 | @@ -801,7 +801,7 @@ |
1041 | player.unsee_area |
1042 | (Area<FCoords>(map.get_fcoords(get_position()), descr().vision_range())); |
1043 | |
1044 | - m_seeing = see; |
1045 | + seeing_ = see; |
1046 | } |
1047 | |
1048 | /** |
1049 | |
1050 | === modified file 'src/logic/map_objects/tribes/building.h' |
1051 | --- src/logic/map_objects/tribes/building.h 2016-02-02 12:47:45 +0000 |
1052 | +++ src/logic/map_objects/tribes/building.h 2016-02-08 18:17:36 +0000 |
1053 | @@ -66,43 +66,43 @@ |
1054 | const LuaTable& t, const EditorGameBase& egbase); |
1055 | ~BuildingDescr() override {} |
1056 | |
1057 | - bool is_buildable () const {return m_buildable;} |
1058 | - bool is_destructible() const {return m_destructible;} |
1059 | - bool is_enhanced () const {return m_enhanced_building;} |
1060 | + bool is_buildable () const {return buildable_;} |
1061 | + bool is_destructible() const {return destructible_;} |
1062 | + bool is_enhanced () const {return enhanced_building_;} |
1063 | |
1064 | /** |
1065 | * The build cost for direct construction |
1066 | */ |
1067 | - const Buildcost & buildcost() const {return m_buildcost;} |
1068 | + const Buildcost & buildcost() const {return buildcost_;} |
1069 | |
1070 | /** |
1071 | * Returned wares for dismantling |
1072 | */ |
1073 | - const Buildcost & returned_wares() const {return m_return_dismantle;} |
1074 | + const Buildcost & returned_wares() const {return return_dismantle_;} |
1075 | |
1076 | /** |
1077 | * The build cost for enhancing a previous building |
1078 | */ |
1079 | - const Buildcost & enhancement_cost() const {return m_enhance_cost;} |
1080 | + const Buildcost & enhancement_cost() const {return enhance_cost_;} |
1081 | |
1082 | /** |
1083 | * The returned wares for a enhaced building |
1084 | */ |
1085 | - const Buildcost & returned_wares_enhanced() const {return m_return_enhanced;} |
1086 | + const Buildcost & returned_wares_enhanced() const {return return_enhanced_;} |
1087 | |
1088 | std::string helptext_script() const {return helptext_script_;} |
1089 | - int32_t get_size() const {return m_size;} |
1090 | - bool get_ismine() const {return m_mine;} |
1091 | - bool get_isport() const {return m_port;} |
1092 | - bool needs_seafaring() const {return m_needs_seafaring;} |
1093 | + int32_t get_size() const {return size_;} |
1094 | + bool get_ismine() const {return mine_;} |
1095 | + bool get_isport() const {return port_;} |
1096 | + bool needs_seafaring() const {return needs_seafaring_;} |
1097 | |
1098 | // Returns the enhancement this building can become or |
1099 | // INVALID_INDEX if it cannot be enhanced. |
1100 | - const DescriptionIndex & enhancement() const {return m_enhancement;} |
1101 | + const DescriptionIndex & enhancement() const {return enhancement_;} |
1102 | // Returns the building from which this building can be enhanced or |
1103 | // INVALID_INDEX if it cannot be built as an enhanced building. |
1104 | - const DescriptionIndex& enhanced_from() const {return m_enhanced_from;} |
1105 | - void set_enhanced_from(const DescriptionIndex& index) {m_enhanced_from = index;} |
1106 | + const DescriptionIndex& enhanced_from() const {return enhanced_from_;} |
1107 | + void set_enhanced_from(const DescriptionIndex& index) {enhanced_from_ = index;} |
1108 | |
1109 | /// Create a building of this type in the game. Calls init, which does |
1110 | /// different things for different types of buildings (such as conquering |
1111 | @@ -123,10 +123,10 @@ |
1112 | virtual uint32_t get_conquers() const; |
1113 | virtual uint32_t vision_range() const; |
1114 | |
1115 | - WorkareaInfo m_workarea_info; |
1116 | + WorkareaInfo workarea_info_; |
1117 | |
1118 | virtual int32_t suitability(const Map &, FCoords) const; |
1119 | - const BuildingHints & hints() const {return m_hints;} |
1120 | + const BuildingHints & hints() const {return hints_;} |
1121 | |
1122 | protected: |
1123 | virtual Building & create_object() const = 0; |
1124 | @@ -134,24 +134,24 @@ |
1125 | |
1126 | private: |
1127 | const EditorGameBase& egbase_; |
1128 | - bool m_buildable; // the player can build this himself |
1129 | - bool m_destructible; // the player can destruct this himself |
1130 | - Buildcost m_buildcost; |
1131 | - Buildcost m_return_dismantle; // Returned wares on dismantle |
1132 | - Buildcost m_enhance_cost; // cost for enhancing |
1133 | - Buildcost m_return_enhanced; // Returned ware for dismantling an enhanced building |
1134 | + bool buildable_; // the player can build this himself |
1135 | + bool destructible_; // the player can destruct this himself |
1136 | + Buildcost buildcost_; |
1137 | + Buildcost return_dismantle_; // Returned wares on dismantle |
1138 | + Buildcost enhance_cost_; // cost for enhancing |
1139 | + Buildcost return_enhanced_; // Returned ware for dismantling an enhanced building |
1140 | std::string helptext_script_; // The path and filename to the building's helptext script |
1141 | - int32_t m_size; // size of the building |
1142 | - bool m_mine; |
1143 | - bool m_port; |
1144 | - bool m_needs_seafaring; // This building should only be built on seafaring maps. |
1145 | - DescriptionIndex m_enhancement; |
1146 | - DescriptionIndex m_enhanced_from; // The building this building was enhanced from, or INVALID_INDEX |
1147 | - bool m_enhanced_building; // if it is one, it is bulldozable |
1148 | - BuildingHints m_hints; // hints (knowledge) for computer players |
1149 | + int32_t size_; // size of the building |
1150 | + bool mine_; |
1151 | + bool port_; |
1152 | + bool needs_seafaring_; // This building should only be built on seafaring maps. |
1153 | + DescriptionIndex enhancement_; |
1154 | + DescriptionIndex enhanced_from_; // The building this building was enhanced from, or INVALID_INDEX |
1155 | + bool enhanced_building_; // if it is one, it is bulldozable |
1156 | + BuildingHints hints_; // hints (knowledge) for computer players |
1157 | |
1158 | // for migration, 0 is the default, meaning get_conquers() + 4 |
1159 | - uint32_t m_vision_range; |
1160 | + uint32_t vision_range_; |
1161 | DISALLOW_COPY_AND_ASSIGN(BuildingDescr); |
1162 | }; |
1163 | |
1164 | @@ -190,7 +190,7 @@ |
1165 | Flag & base_flag() override; |
1166 | virtual uint32_t get_playercaps() const; |
1167 | |
1168 | - virtual Coords get_position() const {return m_position;} |
1169 | + virtual Coords get_position() const {return position_;} |
1170 | PositionList get_positions (const EditorGameBase &) const override; |
1171 | |
1172 | std::string info_string(const InfoStringFormat& format); |
1173 | @@ -198,8 +198,8 @@ |
1174 | // Return the overlay string that is displayed on the map view when enabled |
1175 | // by the player. |
1176 | const std::string& update_and_get_statistics_string() { |
1177 | - update_statistics_string(&m_statistics_string); |
1178 | - return m_statistics_string; |
1179 | + update_statistics_string(&statistics_string_); |
1180 | + return statistics_string_; |
1181 | } |
1182 | |
1183 | /// \returns the queue for a ware type or \throws WException. |
1184 | @@ -238,7 +238,7 @@ |
1185 | * be the one being dismantled. |
1186 | */ |
1187 | const FormerBuildings get_former_buildings() { |
1188 | - return m_old_buildings; |
1189 | + return old_buildings_; |
1190 | } |
1191 | |
1192 | void log_general_info(const EditorGameBase &) override; |
1193 | @@ -249,7 +249,7 @@ |
1194 | |
1195 | /// Stores the PlayerNumber of the player who has defeated this building. |
1196 | void set_defeating_player(PlayerNumber const player_number) { |
1197 | - m_defeating_player = player_number; |
1198 | + defeating_player_ = player_number; |
1199 | } |
1200 | |
1201 | void add_worker(Worker &) override; |
1202 | @@ -287,35 +287,35 @@ |
1203 | |
1204 | void set_seeing(bool see); |
1205 | |
1206 | - UI::Window * m_optionswindow; |
1207 | - Coords m_position; |
1208 | - Flag * m_flag; |
1209 | + UI::Window * optionswindow_; |
1210 | + Coords position_; |
1211 | + Flag * flag_; |
1212 | |
1213 | - uint32_t m_anim; |
1214 | - int32_t m_animstart; |
1215 | + uint32_t anim_; |
1216 | + int32_t animstart_; |
1217 | |
1218 | using LeaveQueue = std::vector<OPtr<Worker>>; |
1219 | - LeaveQueue m_leave_queue; // FIFO queue of workers leaving the building |
1220 | - uint32_t m_leave_time; // when to wake the next one from leave queue |
1221 | - ObjectPointer m_leave_allow; // worker that is allowed to leave now |
1222 | + LeaveQueue leave_queue_; // FIFO queue of workers leaving the building |
1223 | + uint32_t leave_time_; // when to wake the next one from leave queue |
1224 | + ObjectPointer leave_allow_; // worker that is allowed to leave now |
1225 | |
1226 | // The player who has defeated this building. |
1227 | - PlayerNumber m_defeating_player; |
1228 | + PlayerNumber defeating_player_; |
1229 | |
1230 | - int32_t m_priority; // base priority |
1231 | - std::map<DescriptionIndex, int32_t> m_ware_priorities; |
1232 | + int32_t priority_; // base priority |
1233 | + std::map<DescriptionIndex, int32_t> ware_priorities_; |
1234 | |
1235 | /// Whether we see our vision_range area based on workers in the building |
1236 | - bool m_seeing; |
1237 | + bool seeing_; |
1238 | |
1239 | // Signals connected for the option window |
1240 | std::vector<boost::signals2::connection> options_window_connections; |
1241 | |
1242 | // The former buildings names, with the current one in last position. |
1243 | - FormerBuildings m_old_buildings; |
1244 | + FormerBuildings old_buildings_; |
1245 | |
1246 | private: |
1247 | - std::string m_statistics_string; |
1248 | + std::string statistics_string_; |
1249 | }; |
1250 | |
1251 | } |
1252 | |
1253 | === modified file 'src/logic/map_objects/tribes/carrier.cc' |
1254 | --- src/logic/map_objects/tribes/carrier.cc 2015-11-28 22:29:26 +0000 |
1255 | +++ src/logic/map_objects/tribes/carrier.cc 2016-02-08 18:17:36 +0000 |
1256 | @@ -53,7 +53,7 @@ |
1257 | |
1258 | top_state().ivar1 = 0; |
1259 | |
1260 | - m_promised_pickup_to = NOONE; |
1261 | + promised_pickup_to_ = NOONE; |
1262 | } |
1263 | |
1264 | |
1265 | @@ -85,13 +85,13 @@ |
1266 | } |
1267 | |
1268 | // Check for pending wares |
1269 | - if (m_promised_pickup_to == NOONE) |
1270 | + if (promised_pickup_to_ == NOONE) |
1271 | find_pending_ware(game); |
1272 | |
1273 | - if (m_promised_pickup_to != NOONE) { |
1274 | + if (promised_pickup_to_ != NOONE) { |
1275 | if (state.ivar1) { |
1276 | state.ivar1 = 0; |
1277 | - return start_task_transport(game, m_promised_pickup_to); |
1278 | + return start_task_transport(game, promised_pickup_to_); |
1279 | } else { |
1280 | // Short delay before we move to pick up |
1281 | state.ivar1 = 1; |
1282 | @@ -126,10 +126,10 @@ |
1283 | */ |
1284 | void Carrier::road_pop(Game & game, State & /* state */) |
1285 | { |
1286 | - if (m_promised_pickup_to != NOONE && get_location(game)) { |
1287 | + if (promised_pickup_to_ != NOONE && get_location(game)) { |
1288 | Road & road = dynamic_cast<Road&>(*get_location(game)); |
1289 | - Flag & flag = road.get_flag(static_cast<Road::FlagId>(m_promised_pickup_to)); |
1290 | - Flag & otherflag = road.get_flag(static_cast<Road::FlagId>(m_promised_pickup_to ^ 1)); |
1291 | + Flag & flag = road.get_flag(static_cast<Road::FlagId>(promised_pickup_to_)); |
1292 | + Flag & otherflag = road.get_flag(static_cast<Road::FlagId>(promised_pickup_to_ ^ 1)); |
1293 | |
1294 | flag.cancel_pickup(game, otherflag); |
1295 | } |
1296 | @@ -274,7 +274,7 @@ |
1297 | int32_t const ivar1 = state.ivar1; |
1298 | if (!start_task_walktoflag(game, ivar1)) { |
1299 | |
1300 | - m_promised_pickup_to = NOONE; |
1301 | + promised_pickup_to_ = NOONE; |
1302 | |
1303 | Road & road = dynamic_cast<Road&>(*get_location(game)); |
1304 | Flag & flag = road.get_flag(static_cast<Road::FlagId>(ivar1)); |
1305 | @@ -307,7 +307,7 @@ |
1306 | Road & road = dynamic_cast<Road&>(*get_location(game)); |
1307 | Flag & flag = road.get_flag(static_cast<Road::FlagId>(state.ivar1 ^ 1)); |
1308 | |
1309 | - if (m_promised_pickup_to == (state.ivar1 ^ 1)) { |
1310 | + if (promised_pickup_to_ == (state.ivar1 ^ 1)) { |
1311 | // If there's an ware we acked, we can drop ours even if the flag is |
1312 | // flooded |
1313 | other = |
1314 | @@ -319,13 +319,13 @@ |
1315 | ("[Carrier]: strange: acked ware from busy flag no longer " |
1316 | "present.\n"); |
1317 | |
1318 | - m_promised_pickup_to = NOONE; |
1319 | + promised_pickup_to_ = NOONE; |
1320 | set_animation(game, descr().get_animation("idle")); |
1321 | return schedule_act(game, 20); |
1322 | } |
1323 | |
1324 | - state.ivar1 = m_promised_pickup_to; |
1325 | - m_promised_pickup_to = NOONE; |
1326 | + state.ivar1 = promised_pickup_to_; |
1327 | + promised_pickup_to_ = NOONE; |
1328 | } |
1329 | |
1330 | // Drop our ware |
1331 | @@ -382,7 +382,7 @@ |
1332 | Flag & otherflag = road.get_flag(static_cast<Road::FlagId>(state.ivar1)); |
1333 | |
1334 | |
1335 | - if (m_promised_pickup_to == (state.ivar1 ^ 1)) { |
1336 | + if (promised_pickup_to_ == (state.ivar1 ^ 1)) { |
1337 | // All is well, we already acked an ware that we can pick up |
1338 | // from this flag |
1339 | return false; |
1340 | @@ -392,7 +392,7 @@ |
1341 | ("MO(%u): transport: overload exchange: flag %u is fucked up", |
1342 | serial(), flag.serial()); |
1343 | |
1344 | - m_promised_pickup_to = state.ivar1 ^ 1; |
1345 | + promised_pickup_to_ = state.ivar1 ^ 1; |
1346 | return false; |
1347 | } else if (!start_task_walktoflag(game, state.ivar1 ^ 1, true)) |
1348 | start_task_waitforcapacity(game, flag); // wait one node away |
1349 | @@ -411,7 +411,7 @@ |
1350 | State & state = top_state(); |
1351 | |
1352 | // Check if we've already acked something |
1353 | - if (m_promised_pickup_to != NOONE) |
1354 | + if (promised_pickup_to_ != NOONE) |
1355 | return false; |
1356 | |
1357 | // If we are currently in a transport. |
1358 | @@ -438,7 +438,7 @@ |
1359 | return false; |
1360 | |
1361 | // Ack it if we haven't |
1362 | - m_promised_pickup_to = flag; |
1363 | + promised_pickup_to_ = flag; |
1364 | |
1365 | if (state.task == &taskRoad) |
1366 | send_signal(game, "ware"); |
1367 | @@ -450,7 +450,7 @@ |
1368 | |
1369 | |
1370 | /** |
1371 | - * Find a pending ware on one of the road's flags, ack it and set m_promised_pickup_to |
1372 | + * Find a pending ware on one of the road's flags, ack it and set promised_pickup_to_ |
1373 | * accordingly. |
1374 | */ |
1375 | void Carrier::find_pending_ware(Game & game) |
1376 | @@ -458,7 +458,7 @@ |
1377 | Road & road = dynamic_cast<Road&>(*get_location(game)); |
1378 | uint32_t havewarebits = 0; |
1379 | |
1380 | - assert(m_promised_pickup_to == NOONE); |
1381 | + assert(promised_pickup_to_ == NOONE); |
1382 | |
1383 | if (road.get_flag(Road::FlagStart).has_pending_ware |
1384 | (game, road.get_flag(Road::FlagEnd))) { |
1385 | @@ -477,7 +477,7 @@ |
1386 | |
1387 | // Ack our decision |
1388 | if (havewarebits == 1) { |
1389 | - m_promised_pickup_to = START_FLAG; |
1390 | + promised_pickup_to_ = START_FLAG; |
1391 | if |
1392 | (! |
1393 | road.get_flag(Road::FlagStart).ack_pickup |
1394 | @@ -486,7 +486,7 @@ |
1395 | ("Carrier::find_pending_ware: start flag is messed up"); |
1396 | |
1397 | } else if (havewarebits == 2) { |
1398 | - m_promised_pickup_to = END_FLAG; |
1399 | + promised_pickup_to_ = END_FLAG; |
1400 | if |
1401 | (! |
1402 | road.get_flag(Road::FlagEnd).ack_pickup |
1403 | @@ -575,7 +575,7 @@ |
1404 | |
1405 | Worker::log_general_info(egbase); |
1406 | |
1407 | - molog("m_promised_pickup_to = %i\n", m_promised_pickup_to); |
1408 | + molog("promised_pickup_to = %i\n", promised_pickup_to_); |
1409 | } |
1410 | |
1411 | /* |
1412 | @@ -601,7 +601,7 @@ |
1413 | uint8_t packet_version = fr.unsigned_8(); |
1414 | if (packet_version == kCurrentPacketVersion) { |
1415 | Carrier & carrier = get<Carrier>(); |
1416 | - carrier.m_promised_pickup_to = fr.signed_32(); |
1417 | + carrier.promised_pickup_to_ = fr.signed_32(); |
1418 | } else { |
1419 | throw UnhandledVersionError("Carrier", packet_version, kCurrentPacketVersion); |
1420 | } |
1421 | @@ -628,7 +628,7 @@ |
1422 | Worker::do_save(egbase, mos, fw); |
1423 | |
1424 | fw.unsigned_8(kCurrentPacketVersion); |
1425 | - fw.signed_32(m_promised_pickup_to); |
1426 | + fw.signed_32(promised_pickup_to_); |
1427 | } |
1428 | |
1429 | /** |
1430 | |
1431 | === modified file 'src/logic/map_objects/tribes/carrier.h' |
1432 | --- src/logic/map_objects/tribes/carrier.h 2016-01-31 15:31:00 +0000 |
1433 | +++ src/logic/map_objects/tribes/carrier.h 2016-02-08 18:17:36 +0000 |
1434 | @@ -48,7 +48,7 @@ |
1435 | MO_DESCR(CarrierDescr) |
1436 | |
1437 | Carrier(const CarrierDescr & carrier_descr) |
1438 | - : Worker(carrier_descr), m_promised_pickup_to(NOONE) |
1439 | + : Worker(carrier_descr), promised_pickup_to_(NOONE) |
1440 | {} |
1441 | virtual ~Carrier() {} |
1442 | |
1443 | @@ -86,7 +86,7 @@ |
1444 | static const int32_t NOONE = -1; |
1445 | static const int32_t START_FLAG = 0; |
1446 | static const int32_t END_FLAG = 1; |
1447 | - int32_t m_promised_pickup_to; |
1448 | + int32_t promised_pickup_to_; |
1449 | |
1450 | // saving and loading |
1451 | protected: |
1452 | |
1453 | === modified file 'src/logic/map_objects/tribes/constructionsite.cc' |
1454 | --- src/logic/map_objects/tribes/constructionsite.cc 2016-01-17 19:54:32 +0000 |
1455 | +++ src/logic/map_objects/tribes/constructionsite.cc 2016-02-08 18:17:36 +0000 |
1456 | @@ -65,8 +65,8 @@ |
1457 | |
1458 | ConstructionSite::ConstructionSite(const ConstructionSiteDescr & cs_descr) : |
1459 | PartiallyFinishedBuilding (cs_descr), |
1460 | -m_fetchfromflag (0), |
1461 | -m_builder_idle (false) |
1462 | +fetchfromflag_ (0), |
1463 | +builder_idle_ (false) |
1464 | {} |
1465 | |
1466 | |
1467 | @@ -83,14 +83,14 @@ |
1468 | ======= |
1469 | */ |
1470 | WaresQueue & ConstructionSite::waresqueue(DescriptionIndex const wi) { |
1471 | - for (WaresQueue * ware : m_wares) { |
1472 | + for (WaresQueue * ware : wares_) { |
1473 | if (ware->get_ware() == wi) { |
1474 | return *ware; |
1475 | } |
1476 | } |
1477 | throw wexception |
1478 | ("%s (%u) (building %s) has no WaresQueue for %u", |
1479 | - descr().name().c_str(), serial(), m_building->name().c_str(), wi); |
1480 | + descr().name().c_str(), serial(), building_->name().c_str(), wi); |
1481 | } |
1482 | |
1483 | |
1484 | @@ -102,7 +102,7 @@ |
1485 | void ConstructionSite::set_building(const BuildingDescr & building_descr) { |
1486 | PartiallyFinishedBuilding::set_building(building_descr); |
1487 | |
1488 | - m_info.becomes = &building_descr; |
1489 | + info_.becomes = &building_descr; |
1490 | } |
1491 | |
1492 | /* |
1493 | @@ -115,31 +115,31 @@ |
1494 | PartiallyFinishedBuilding::init(egbase); |
1495 | |
1496 | const std::map<DescriptionIndex, uint8_t> * buildcost; |
1497 | - if (!m_old_buildings.empty()) { |
1498 | + if (!old_buildings_.empty()) { |
1499 | // Enhancement |
1500 | - DescriptionIndex was_index = m_old_buildings.back(); |
1501 | + DescriptionIndex was_index = old_buildings_.back(); |
1502 | const BuildingDescr* was_descr = owner().tribe().get_building_descr(was_index); |
1503 | - m_info.was = was_descr; |
1504 | - buildcost = &m_building->enhancement_cost(); |
1505 | + info_.was = was_descr; |
1506 | + buildcost = &building_->enhancement_cost(); |
1507 | } else { |
1508 | - buildcost = &m_building->buildcost(); |
1509 | + buildcost = &building_->buildcost(); |
1510 | } |
1511 | |
1512 | // TODO(unknown): figure out whether planing is necessary |
1513 | |
1514 | // initialize the wares queues |
1515 | size_t const buildcost_size = buildcost->size(); |
1516 | - m_wares.resize(buildcost_size); |
1517 | + wares_.resize(buildcost_size); |
1518 | std::map<DescriptionIndex, uint8_t>::const_iterator it = buildcost->begin(); |
1519 | |
1520 | for (size_t i = 0; i < buildcost_size; ++i, ++it) { |
1521 | WaresQueue & wq = |
1522 | - *(m_wares[i] = new WaresQueue(*this, it->first, it->second)); |
1523 | + *(wares_[i] = new WaresQueue(*this, it->first, it->second)); |
1524 | |
1525 | wq.set_callback(ConstructionSite::wares_queue_callback, this); |
1526 | wq.set_consume_interval(CONSTRUCTIONSITE_STEP_TIME); |
1527 | |
1528 | - m_work_steps += it->second; |
1529 | + work_steps_ += it->second; |
1530 | } |
1531 | } |
1532 | |
1533 | @@ -154,19 +154,19 @@ |
1534 | { |
1535 | PartiallyFinishedBuilding::cleanup(egbase); |
1536 | |
1537 | - if (m_work_steps <= m_work_completed) { |
1538 | + if (work_steps_ <= work_completed_) { |
1539 | // Put the real building in place |
1540 | - DescriptionIndex becomes_idx = owner().tribe().building_index(m_building->name()); |
1541 | - m_old_buildings.push_back(becomes_idx); |
1542 | + DescriptionIndex becomes_idx = owner().tribe().building_index(building_->name()); |
1543 | + old_buildings_.push_back(becomes_idx); |
1544 | Building & b = |
1545 | - m_building->create(egbase, owner(), m_position, false, false, m_old_buildings); |
1546 | - if (Worker * const builder = m_builder.get(egbase)) { |
1547 | + building_->create(egbase, owner(), position_, false, false, old_buildings_); |
1548 | + if (Worker * const builder = builder_.get(egbase)) { |
1549 | builder->reset_tasks(dynamic_cast<Game&>(egbase)); |
1550 | builder->set_location(&b); |
1551 | } |
1552 | // Open the new building window if needed |
1553 | - if (m_optionswindow) { |
1554 | - Point window_position = m_optionswindow->get_pos(); |
1555 | + if (optionswindow_) { |
1556 | + Point window_position = optionswindow_->get_pos(); |
1557 | hide_options(); |
1558 | InteractiveGameBase & igbase = |
1559 | dynamic_cast<InteractiveGameBase&>(*egbase.get_ibase()); |
1560 | @@ -183,10 +183,10 @@ |
1561 | */ |
1562 | bool ConstructionSite::burn_on_destroy() |
1563 | { |
1564 | - if (m_work_completed >= m_work_steps) |
1565 | + if (work_completed_ >= work_steps_) |
1566 | return false; // completed, so don't burn |
1567 | |
1568 | - return m_work_completed || !m_old_buildings.empty(); |
1569 | + return work_completed_ || !old_buildings_.empty(); |
1570 | } |
1571 | |
1572 | /* |
1573 | @@ -196,9 +196,9 @@ |
1574 | */ |
1575 | bool ConstructionSite::fetch_from_flag(Game & game) |
1576 | { |
1577 | - ++m_fetchfromflag; |
1578 | + ++fetchfromflag_; |
1579 | |
1580 | - if (Worker * const builder = m_builder.get(game)) |
1581 | + if (Worker * const builder = builder_.get(game)) |
1582 | builder->update_task_buildingwork(game); |
1583 | |
1584 | return true; |
1585 | @@ -211,7 +211,7 @@ |
1586 | =============== |
1587 | */ |
1588 | bool ConstructionSite::get_building_work(Game & game, Worker & worker, bool) { |
1589 | - if (&worker != m_builder.get(game)) { |
1590 | + if (&worker != builder_.get(game)) { |
1591 | // Not our construction worker; e.g. a miner leaving a mine |
1592 | // that is supposed to be enhanced. Make him return to a warehouse |
1593 | worker.pop_task(game); |
1594 | @@ -219,40 +219,40 @@ |
1595 | return true; |
1596 | } |
1597 | |
1598 | - if (!m_work_steps) // Happens for building without buildcost. |
1599 | + if (!work_steps_) // Happens for building without buildcost. |
1600 | schedule_destroy(game); // Complete the building immediately. |
1601 | |
1602 | // Check if one step has completed |
1603 | - if (m_working) { |
1604 | - if (static_cast<int32_t>(game.get_gametime() - m_work_steptime) < 0) { |
1605 | + if (working_) { |
1606 | + if (static_cast<int32_t>(game.get_gametime() - work_steptime_) < 0) { |
1607 | worker.start_task_idle |
1608 | (game, |
1609 | worker.descr().get_animation("work"), |
1610 | - m_work_steptime - game.get_gametime()); |
1611 | - m_builder_idle = false; |
1612 | + work_steptime_ - game.get_gametime()); |
1613 | + builder_idle_ = false; |
1614 | return true; |
1615 | } else { |
1616 | //TODO(fweber): cause "construction sounds" to be played - |
1617 | //perhaps dependent on kind of construction? |
1618 | |
1619 | - ++m_work_completed; |
1620 | - if (m_work_completed >= m_work_steps) |
1621 | + ++work_completed_; |
1622 | + if (work_completed_ >= work_steps_) |
1623 | schedule_destroy(game); |
1624 | |
1625 | - m_working = false; |
1626 | + working_ = false; |
1627 | } |
1628 | } |
1629 | |
1630 | // Fetch wares from flag |
1631 | - if (m_fetchfromflag) { |
1632 | - --m_fetchfromflag; |
1633 | - m_builder_idle = false; |
1634 | + if (fetchfromflag_) { |
1635 | + --fetchfromflag_; |
1636 | + builder_idle_ = false; |
1637 | worker.start_task_fetchfromflag(game); |
1638 | return true; |
1639 | } |
1640 | |
1641 | // Drop all the wares that are too much out to the flag. |
1642 | - for (WaresQueue * iqueue: m_wares) { |
1643 | + for (WaresQueue * iqueue: wares_) { |
1644 | WaresQueue * queue = iqueue; |
1645 | if (queue->get_filled() > queue->get_max_fill()) { |
1646 | queue->set_filled(queue->get_filled() - 1); |
1647 | @@ -265,10 +265,10 @@ |
1648 | } |
1649 | |
1650 | // Check if we've got wares to consume |
1651 | - if (m_work_completed < m_work_steps) |
1652 | + if (work_completed_ < work_steps_) |
1653 | { |
1654 | - for (uint32_t i = 0; i < m_wares.size(); ++i) { |
1655 | - WaresQueue & wq = *m_wares[i]; |
1656 | + for (uint32_t i = 0; i < wares_.size(); ++i) { |
1657 | + WaresQueue & wq = *wares_[i]; |
1658 | |
1659 | if (!wq.get_filled()) |
1660 | continue; |
1661 | @@ -279,19 +279,19 @@ |
1662 | //update consumption statistic |
1663 | owner().ware_consumed(wq.get_ware(), 1); |
1664 | |
1665 | - m_working = true; |
1666 | - m_work_steptime = game.get_gametime() + CONSTRUCTIONSITE_STEP_TIME; |
1667 | + working_ = true; |
1668 | + work_steptime_ = game.get_gametime() + CONSTRUCTIONSITE_STEP_TIME; |
1669 | |
1670 | worker.start_task_idle |
1671 | (game, worker.descr().get_animation("work"), CONSTRUCTIONSITE_STEP_TIME); |
1672 | - m_builder_idle = false; |
1673 | + builder_idle_ = false; |
1674 | return true; |
1675 | } |
1676 | } |
1677 | // The only work we have got for you, is to run around to look cute ;) |
1678 | - if (!m_builder_idle) { |
1679 | + if (!builder_idle_) { |
1680 | worker.set_animation(game, worker.descr().get_animation("idle")); |
1681 | - m_builder_idle = true; |
1682 | + builder_idle_ = true; |
1683 | } |
1684 | worker.schedule_act(game, 2000); |
1685 | return true; |
1686 | @@ -308,8 +308,8 @@ |
1687 | { |
1688 | ConstructionSite & cs = *static_cast<ConstructionSite *>(data); |
1689 | |
1690 | - if (!cs.m_working) |
1691 | - if (Worker * const builder = cs.m_builder.get(game)) |
1692 | + if (!cs.working_) |
1693 | + if (Worker * const builder = cs.builder_.get(game)) |
1694 | builder->update_task_buildingwork(game); |
1695 | } |
1696 | |
1697 | @@ -323,27 +323,27 @@ |
1698 | (const EditorGameBase & game, RenderTarget & dst, const FCoords& coords, const Point& pos) |
1699 | { |
1700 | const uint32_t gametime = game.get_gametime(); |
1701 | - uint32_t tanim = gametime - m_animstart; |
1702 | + uint32_t tanim = gametime - animstart_; |
1703 | |
1704 | - if (coords != m_position) |
1705 | + if (coords != position_) |
1706 | return; // draw big buildings only once |
1707 | |
1708 | // Draw the construction site marker |
1709 | const RGBColor& player_color = get_owner()->get_playercolor(); |
1710 | - dst.blit_animation(pos, m_anim, tanim, player_color); |
1711 | + dst.blit_animation(pos, anim_, tanim, player_color); |
1712 | |
1713 | // Draw the partially finished building |
1714 | |
1715 | static_assert(0 <= CONSTRUCTIONSITE_STEP_TIME, "assert(0 <= CONSTRUCTIONSITE_STEP_TIME) failed."); |
1716 | - m_info.totaltime = CONSTRUCTIONSITE_STEP_TIME * m_work_steps; |
1717 | - m_info.completedtime = CONSTRUCTIONSITE_STEP_TIME * m_work_completed; |
1718 | + info_.totaltime = CONSTRUCTIONSITE_STEP_TIME * work_steps_; |
1719 | + info_.completedtime = CONSTRUCTIONSITE_STEP_TIME * work_completed_; |
1720 | |
1721 | - if (m_working) { |
1722 | + if (working_) { |
1723 | assert |
1724 | - (m_work_steptime |
1725 | + (work_steptime_ |
1726 | <= |
1727 | - m_info.completedtime + CONSTRUCTIONSITE_STEP_TIME + gametime); |
1728 | - m_info.completedtime += CONSTRUCTIONSITE_STEP_TIME + gametime - m_work_steptime; |
1729 | + info_.completedtime + CONSTRUCTIONSITE_STEP_TIME + gametime); |
1730 | + info_.completedtime += CONSTRUCTIONSITE_STEP_TIME + gametime - work_steptime_; |
1731 | } |
1732 | |
1733 | uint32_t anim_idx; |
1734 | @@ -359,16 +359,16 @@ |
1735 | } |
1736 | const Animation& anim = g_gr->animations().get_animation(anim_idx); |
1737 | const size_t nr_frames = anim.nr_frames(); |
1738 | - cur_frame = m_info.totaltime ? m_info.completedtime * nr_frames / m_info.totaltime : 0; |
1739 | + cur_frame = info_.totaltime ? info_.completedtime * nr_frames / info_.totaltime : 0; |
1740 | // Redefine tanim |
1741 | tanim = cur_frame * FRAME_LENGTH; |
1742 | |
1743 | const uint16_t w = anim.width(); |
1744 | const uint16_t h = anim.height(); |
1745 | |
1746 | - uint32_t lines = h * m_info.completedtime * nr_frames; |
1747 | - if (m_info.totaltime) |
1748 | - lines /= m_info.totaltime; |
1749 | + uint32_t lines = h * info_.completedtime * nr_frames; |
1750 | + if (info_.totaltime) |
1751 | + lines /= info_.totaltime; |
1752 | assert(h * cur_frame <= lines); |
1753 | lines -= h * cur_frame; // This won't work if pictures have various sizes. |
1754 | |
1755 | @@ -376,8 +376,8 @@ |
1756 | // draw the prev pic from top to where next image will be drawing |
1757 | dst.blit_animation(pos, anim_idx, tanim - FRAME_LENGTH, player_color, |
1758 | Rect(Point(0, 0), w, h - lines)); |
1759 | - } else if (!m_old_buildings.empty()) { |
1760 | - DescriptionIndex prev_idx = m_old_buildings.back(); |
1761 | + } else if (!old_buildings_.empty()) { |
1762 | + DescriptionIndex prev_idx = old_buildings_.back(); |
1763 | const BuildingDescr* prev_building = owner().tribe().get_building_descr(prev_idx); |
1764 | // Is the first picture but there was another building here before, |
1765 | // get its most fitting picture and draw it instead. |
1766 | |
1767 | === modified file 'src/logic/map_objects/tribes/constructionsite.h' |
1768 | --- src/logic/map_objects/tribes/constructionsite.h 2016-01-31 15:31:00 +0000 |
1769 | +++ src/logic/map_objects/tribes/constructionsite.h 2016-02-08 18:17:36 +0000 |
1770 | @@ -80,12 +80,12 @@ |
1771 | public: |
1772 | ConstructionSite(const ConstructionSiteDescr & descr); |
1773 | |
1774 | - const ConstructionsiteInformation & get_info() {return m_info;} |
1775 | + const ConstructionsiteInformation & get_info() {return info_;} |
1776 | |
1777 | WaresQueue & waresqueue(DescriptionIndex) override; |
1778 | |
1779 | void set_building(const BuildingDescr &) override; |
1780 | - const BuildingDescr & building() const {return *m_building;} |
1781 | + const BuildingDescr & building() const {return *building_;} |
1782 | |
1783 | void init (EditorGameBase &) override; |
1784 | void cleanup(EditorGameBase &) override; |
1785 | @@ -107,10 +107,10 @@ |
1786 | void draw(const EditorGameBase &, RenderTarget &, const FCoords&, const Point&) override; |
1787 | |
1788 | private: |
1789 | - int32_t m_fetchfromflag; // # of wares to fetch from flag |
1790 | + int32_t fetchfromflag_; // # of wares to fetch from flag |
1791 | |
1792 | - bool m_builder_idle; // used to determine whether the builder is idle |
1793 | - ConstructionsiteInformation m_info; // asked for by player point of view for the gameview |
1794 | + bool builder_idle_; // used to determine whether the builder is idle |
1795 | + ConstructionsiteInformation info_; // asked for by player point of view for the gameview |
1796 | }; |
1797 | |
1798 | } |
1799 | |
1800 | === modified file 'src/logic/map_objects/tribes/dismantlesite.cc' |
1801 | --- src/logic/map_objects/tribes/dismantlesite.cc 2016-01-17 19:54:32 +0000 |
1802 | +++ src/logic/map_objects/tribes/dismantlesite.cc 2016-02-08 18:17:36 +0000 |
1803 | @@ -68,14 +68,14 @@ |
1804 | : |
1805 | PartiallyFinishedBuilding(gdescr) |
1806 | { |
1807 | - m_position = c; |
1808 | + position_ = c; |
1809 | set_owner(&plr); |
1810 | |
1811 | assert(!former_buildings.empty()); |
1812 | for (DescriptionIndex former_idx : former_buildings) { |
1813 | - m_old_buildings.push_back(former_idx); |
1814 | + old_buildings_.push_back(former_idx); |
1815 | } |
1816 | - const BuildingDescr* cur_descr = owner().tribe().get_building_descr(m_old_buildings.back()); |
1817 | + const BuildingDescr* cur_descr = owner().tribe().get_building_descr(old_buildings_.back()); |
1818 | set_building(*cur_descr); |
1819 | |
1820 | if (loading) { |
1821 | @@ -109,14 +109,14 @@ |
1822 | count_returned_wares(this, wares); |
1823 | |
1824 | std::map<DescriptionIndex, uint8_t>::const_iterator it = wares.begin(); |
1825 | - m_wares.resize(wares.size()); |
1826 | + wares_.resize(wares.size()); |
1827 | |
1828 | for (size_t i = 0; i < wares.size(); ++i, ++it) { |
1829 | WaresQueue & wq = |
1830 | - *(m_wares[i] = new WaresQueue(*this, it->first, it->second)); |
1831 | + *(wares_[i] = new WaresQueue(*this, it->first, it->second)); |
1832 | |
1833 | wq.set_filled(it->second); |
1834 | - m_work_steps += it->second; |
1835 | + work_steps_ += it->second; |
1836 | } |
1837 | } |
1838 | |
1839 | @@ -154,7 +154,7 @@ |
1840 | */ |
1841 | bool DismantleSite::burn_on_destroy() |
1842 | { |
1843 | - if (m_work_completed >= m_work_steps) |
1844 | + if (work_completed_ >= work_steps_) |
1845 | return false; // completed, so don't burn |
1846 | |
1847 | return true; |
1848 | @@ -166,7 +166,7 @@ |
1849 | =============== |
1850 | */ |
1851 | bool DismantleSite::get_building_work(Game & game, Worker & worker, bool) { |
1852 | - if (&worker != m_builder.get(game)) { |
1853 | + if (&worker != builder_.get(game)) { |
1854 | // Not our construction worker; e.g. a miner leaving a mine |
1855 | // that is supposed to be enhanced. Make him return to a warehouse |
1856 | worker.pop_task(game); |
1857 | @@ -174,15 +174,15 @@ |
1858 | return true; |
1859 | } |
1860 | |
1861 | - if (!m_work_steps) // Happens for building without buildcost. |
1862 | + if (!work_steps_) // Happens for building without buildcost. |
1863 | schedule_destroy(game); // Complete the building immediately. |
1864 | |
1865 | // Check if one step has completed |
1866 | - if (static_cast<int32_t>(game.get_gametime() - m_work_steptime) >= 0 && m_working) { |
1867 | - ++m_work_completed; |
1868 | + if (static_cast<int32_t>(game.get_gametime() - work_steptime_) >= 0 && working_) { |
1869 | + ++work_completed_; |
1870 | |
1871 | - for (uint32_t i = 0; i < m_wares.size(); ++i) { |
1872 | - WaresQueue & wq = *m_wares[i]; |
1873 | + for (uint32_t i = 0; i < wares_.size(); ++i) { |
1874 | + WaresQueue & wq = *wares_[i]; |
1875 | |
1876 | if (!wq.get_filled()) |
1877 | continue; |
1878 | @@ -198,12 +198,12 @@ |
1879 | ware.init(game); |
1880 | worker.start_task_dropoff(game, ware); |
1881 | |
1882 | - m_working = false; |
1883 | + working_ = false; |
1884 | return true; |
1885 | } |
1886 | } |
1887 | |
1888 | - if (m_work_completed >= m_work_steps) { |
1889 | + if (work_completed_ >= work_steps_) { |
1890 | schedule_destroy(game); |
1891 | |
1892 | worker.pop_task(game); |
1893 | @@ -214,12 +214,12 @@ |
1894 | worker.descr().get_right_walk_anims(false), |
1895 | true); |
1896 | worker.set_location(nullptr); |
1897 | - } else if (!m_working) { |
1898 | - m_work_steptime = game.get_gametime() + DISMANTLESITE_STEP_TIME; |
1899 | + } else if (!working_) { |
1900 | + work_steptime_ = game.get_gametime() + DISMANTLESITE_STEP_TIME; |
1901 | worker.start_task_idle |
1902 | (game, worker.descr().get_animation("work"), DISMANTLESITE_STEP_TIME); |
1903 | |
1904 | - m_working = true; |
1905 | + working_ = true; |
1906 | } |
1907 | return true; |
1908 | } |
1909 | @@ -233,29 +233,29 @@ |
1910 | (const EditorGameBase& game, RenderTarget& dst, const FCoords& coords, const Point& pos) |
1911 | { |
1912 | const uint32_t gametime = game.get_gametime(); |
1913 | - uint32_t tanim = gametime - m_animstart; |
1914 | + uint32_t tanim = gametime - animstart_; |
1915 | |
1916 | - if (coords != m_position) |
1917 | + if (coords != position_) |
1918 | return; // draw big buildings only once |
1919 | |
1920 | const RGBColor& player_color = get_owner()->get_playercolor(); |
1921 | |
1922 | // Draw the construction site marker |
1923 | - dst.blit_animation(pos, m_anim, tanim, player_color); |
1924 | + dst.blit_animation(pos, anim_, tanim, player_color); |
1925 | |
1926 | // Draw the partially dismantled building |
1927 | static_assert(0 <= DISMANTLESITE_STEP_TIME, "assert(0 <= DISMANTLESITE_STEP_TIME) failed."); |
1928 | - uint32_t total_time = DISMANTLESITE_STEP_TIME * m_work_steps; |
1929 | - uint32_t completed_time = DISMANTLESITE_STEP_TIME * m_work_completed; |
1930 | + uint32_t total_time = DISMANTLESITE_STEP_TIME * work_steps_; |
1931 | + uint32_t completed_time = DISMANTLESITE_STEP_TIME * work_completed_; |
1932 | |
1933 | - if (m_working) |
1934 | - completed_time += DISMANTLESITE_STEP_TIME + gametime - m_work_steptime; |
1935 | + if (working_) |
1936 | + completed_time += DISMANTLESITE_STEP_TIME + gametime - work_steptime_; |
1937 | |
1938 | uint32_t anim_idx; |
1939 | try { |
1940 | - anim_idx = m_building->get_animation("unoccupied"); |
1941 | + anim_idx = building_->get_animation("unoccupied"); |
1942 | } catch (MapObjectDescr::AnimationNonexistent &) { |
1943 | - anim_idx = m_building->get_animation("idle"); |
1944 | + anim_idx = building_->get_animation("idle"); |
1945 | } |
1946 | const Animation& anim = g_gr->animations().get_animation(anim_idx); |
1947 | const uint16_t w = anim.width(); |
1948 | |
1949 | === modified file 'src/logic/map_objects/tribes/militarysite.cc' |
1950 | --- src/logic/map_objects/tribes/militarysite.cc 2016-01-31 15:31:00 +0000 |
1951 | +++ src/logic/map_objects/tribes/militarysite.cc 2016-02-08 18:17:36 +0000 |
1952 | @@ -48,26 +48,26 @@ |
1953 | : |
1954 | BuildingDescr |
1955 | (init_descname, MapObjectType::MILITARYSITE, table, egbase), |
1956 | - m_conquer_radius (0), |
1957 | - m_num_soldiers (0), |
1958 | - m_heal_per_second (0) |
1959 | + conquer_radius_ (0), |
1960 | + num_soldiers_ (0), |
1961 | + heal_per_second_ (0) |
1962 | { |
1963 | i18n::Textdomain td("tribes"); |
1964 | |
1965 | - m_conquer_radius = table.get_int("conquers"); |
1966 | - m_num_soldiers = table.get_int("max_soldiers"); |
1967 | - m_heal_per_second = table.get_int("heal_per_second"); |
1968 | + conquer_radius_ = table.get_int("conquers"); |
1969 | + num_soldiers_ = table.get_int("max_soldiers"); |
1970 | + heal_per_second_ = table.get_int("heal_per_second"); |
1971 | |
1972 | - if (m_conquer_radius > 0) |
1973 | - m_workarea_info[m_conquer_radius].insert(descname() + " conquer"); |
1974 | - m_prefers_heroes_at_start = table.get_bool("prefer_heroes"); |
1975 | + if (conquer_radius_ > 0) |
1976 | + workarea_info_[conquer_radius_].insert(descname() + " conquer"); |
1977 | + prefers_heroes_at_start_ = table.get_bool("prefer_heroes"); |
1978 | |
1979 | std::unique_ptr<LuaTable> items_table = table.get_table("messages"); |
1980 | - m_occupied_str = _(items_table->get_string("occupied")); |
1981 | - m_aggressor_str = _(items_table->get_string("aggressor")); |
1982 | - m_attack_str = _(items_table->get_string("attack")); |
1983 | - m_defeated_enemy_str = _(items_table->get_string("defeated_enemy")); |
1984 | - m_defeated_you_str = _(items_table->get_string("defeated_you")); |
1985 | + occupied_str_ = _(items_table->get_string("occupied")); |
1986 | + aggressor_str_ = _(items_table->get_string("aggressor")); |
1987 | + attack_str_ = _(items_table->get_string("attack")); |
1988 | + defeated_enemy_str_ = _(items_table->get_string("defeated_enemy")); |
1989 | + defeated_you_str_ = _(items_table->get_string("defeated_you")); |
1990 | } |
1991 | |
1992 | /** |
1993 | @@ -90,21 +90,21 @@ |
1994 | |
1995 | MilitarySite::MilitarySite(const MilitarySiteDescr & ms_descr) : |
1996 | Building(ms_descr), |
1997 | -m_didconquer (false), |
1998 | -m_capacity (ms_descr.get_max_number_of_soldiers()), |
1999 | -m_nexthealtime(0), |
2000 | -m_soldier_preference(ms_descr.m_prefers_heroes_at_start ? kPrefersHeroes : kPrefersRookies), |
2001 | -m_soldier_upgrade_try(false), |
2002 | -m_doing_upgrade_request(false) |
2003 | +didconquer_ (false), |
2004 | +capacity_ (ms_descr.get_max_number_of_soldiers()), |
2005 | +nexthealtime_(0), |
2006 | +soldier_preference_(ms_descr.prefers_heroes_at_start_ ? kPrefersHeroes : kPrefersRookies), |
2007 | +soldier_upgrade_try_(false), |
2008 | +doing_upgrade_request_(false) |
2009 | { |
2010 | - m_next_swap_soldiers_time = 0; |
2011 | + next_swap_soldiers_time_ = 0; |
2012 | } |
2013 | |
2014 | |
2015 | MilitarySite::~MilitarySite() |
2016 | { |
2017 | - assert(!m_normal_soldier_request); |
2018 | - assert(!m_upgrade_soldier_request); |
2019 | + assert(!normal_soldier_request_); |
2020 | + assert(!upgrade_soldier_request_); |
2021 | } |
2022 | |
2023 | |
2024 | @@ -120,25 +120,25 @@ |
2025 | uint32_t stationed = stationed_soldiers().size(); |
2026 | |
2027 | if (present == stationed) { |
2028 | - if (m_capacity > stationed) { |
2029 | + if (capacity_ > stationed) { |
2030 | /** TRANSLATORS: %1% is the number of soldiers the plural refers to */ |
2031 | /** TRANSLATORS: %2% is the maximum number of soldier slots in the building */ |
2032 | *s += (boost::format(ngettext("%1% soldier (+%2%)", |
2033 | "%1% soldiers (+%2%)", |
2034 | stationed)) |
2035 | - % stationed % (m_capacity - stationed)).str(); |
2036 | + % stationed % (capacity_ - stationed)).str(); |
2037 | } else { |
2038 | *s += (boost::format(ngettext("%u soldier", "%u soldiers", stationed)) |
2039 | % stationed).str(); |
2040 | } |
2041 | } else { |
2042 | - if (m_capacity > stationed) { |
2043 | + if (capacity_ > stationed) { |
2044 | /** TRANSLATORS: %1% is the number of soldiers the plural refers to */ |
2045 | /** TRANSLATORS: %2% are currently open soldier slots in the building */ |
2046 | /** TRANSLATORS: %3% is the maximum number of soldier slots in the building */ |
2047 | *s = |
2048 | (boost::format(ngettext("%1%(+%2%) soldier (+%3%)", "%1%(+%2%) soldiers (+%3%)", stationed)) |
2049 | - % present % (stationed - present) % (m_capacity - stationed)).str(); |
2050 | + % present % (stationed - present) % (capacity_ - stationed)).str(); |
2051 | } else { |
2052 | /** TRANSLATORS: %1% is the number of soldiers the plural refers to */ |
2053 | /** TRANSLATORS: %2% are currently open soldier slots in the building */ |
2054 | @@ -166,7 +166,7 @@ |
2055 | update_soldier_request(); |
2056 | |
2057 | // schedule the first healing |
2058 | - m_nexthealtime = egbase.get_gametime() + 1000; |
2059 | + nexthealtime_ = egbase.get_gametime() + 1000; |
2060 | if (game) |
2061 | schedule_act(*game, 1000); |
2062 | } |
2063 | @@ -182,10 +182,10 @@ |
2064 | { |
2065 | Building::set_economy(e); |
2066 | |
2067 | - if (m_normal_soldier_request && e) |
2068 | - m_normal_soldier_request->set_economy(e); |
2069 | - if (m_upgrade_soldier_request && e) |
2070 | - m_upgrade_soldier_request->set_economy(e); |
2071 | + if (normal_soldier_request_ && e) |
2072 | + normal_soldier_request_->set_economy(e); |
2073 | + if (upgrade_soldier_request_ && e) |
2074 | + upgrade_soldier_request_->set_economy(e); |
2075 | } |
2076 | |
2077 | /** |
2078 | @@ -196,25 +196,25 @@ |
2079 | void MilitarySite::cleanup(EditorGameBase & egbase) |
2080 | { |
2081 | // unconquer land |
2082 | - if (m_didconquer) |
2083 | + if (didconquer_) |
2084 | egbase.unconquer_area |
2085 | (PlayerArea<Area<FCoords> > |
2086 | (owner().player_number(), |
2087 | Area<FCoords> |
2088 | (egbase.map().get_fcoords(get_position()), descr().get_conquers())), |
2089 | - m_defeating_player); |
2090 | + defeating_player_); |
2091 | |
2092 | Building::cleanup(egbase); |
2093 | |
2094 | // Evict soldiers to get rid of requests |
2095 | - while (m_capacity > 0) { |
2096 | + while (capacity_ > 0) { |
2097 | update_soldier_request(); |
2098 | - --m_capacity; |
2099 | + --capacity_; |
2100 | } |
2101 | update_soldier_request(); |
2102 | |
2103 | - m_normal_soldier_request.reset(); |
2104 | - m_upgrade_soldier_request.reset(); |
2105 | + normal_soldier_request_.reset(); |
2106 | + upgrade_soldier_request_.reset(); |
2107 | } |
2108 | |
2109 | |
2110 | @@ -246,7 +246,7 @@ |
2111 | return incorporate_upgraded_soldier(egbase, s) ? 0 : -1; |
2112 | } |
2113 | |
2114 | - if (!m_didconquer) { |
2115 | + if (!didconquer_) { |
2116 | conquer_area(egbase); |
2117 | // Building is now occupied - idle animation should be played |
2118 | start_animation(egbase, descr().get_animation("idle")); |
2119 | @@ -258,7 +258,7 @@ |
2120 | descr().descname(), |
2121 | descr().icon_filename(), |
2122 | descr().descname(), |
2123 | - descr().m_occupied_str, |
2124 | + descr().occupied_str_, |
2125 | true); |
2126 | } |
2127 | } |
2128 | @@ -285,7 +285,7 @@ |
2129 | MilitarySite::find_least_suited_soldier() |
2130 | { |
2131 | const std::vector<Soldier *> present = present_soldiers(); |
2132 | - const int32_t multiplier = kPrefersHeroes == m_soldier_preference ? -1 : 1; |
2133 | + const int32_t multiplier = kPrefersHeroes == soldier_preference_ ? -1 : 1; |
2134 | int worst_soldier_level = INT_MIN; |
2135 | Soldier * worst_soldier = nullptr; |
2136 | for (Soldier* sld : present) { |
2137 | @@ -329,12 +329,12 @@ |
2138 | { |
2139 | int32_t old_level = kickoutCandidate->get_level(atrTotal); |
2140 | int32_t new_level = newguy->get_level(atrTotal); |
2141 | - if (kPrefersHeroes == m_soldier_preference && old_level >= new_level) |
2142 | + if (kPrefersHeroes == soldier_preference_ && old_level >= new_level) |
2143 | { |
2144 | return false; |
2145 | } |
2146 | else |
2147 | - if (kPrefersRookies == m_soldier_preference && old_level <= new_level) |
2148 | + if (kPrefersRookies == soldier_preference_ && old_level <= new_level) |
2149 | { |
2150 | return false; |
2151 | } |
2152 | @@ -361,7 +361,7 @@ |
2153 | MilitarySite::incorporate_upgraded_soldier(EditorGameBase & egbase, Soldier & s) |
2154 | { |
2155 | // Call to drop_least routine has side effects: it tries to drop a soldier. Order is important! |
2156 | - if (stationed_soldiers().size() < m_capacity || drop_least_suited_soldier(true, &s)) |
2157 | + if (stationed_soldiers().size() < capacity_ || drop_least_suited_soldier(true, &s)) |
2158 | { |
2159 | Game & game = dynamic_cast<Game&>(egbase); |
2160 | s.set_location(this); |
2161 | @@ -400,25 +400,25 @@ |
2162 | std::vector<Soldier *> present = present_soldiers(); |
2163 | uint32_t const stationed = stationed_soldiers().size(); |
2164 | |
2165 | - if (stationed < m_capacity) { |
2166 | - if (!m_normal_soldier_request) { |
2167 | - m_normal_soldier_request.reset |
2168 | + if (stationed < capacity_) { |
2169 | + if (!normal_soldier_request_) { |
2170 | + normal_soldier_request_.reset |
2171 | (new Request |
2172 | (*this, |
2173 | owner().tribe().soldier(), |
2174 | MilitarySite::request_soldier_callback, |
2175 | wwWORKER)); |
2176 | - m_normal_soldier_request->set_requirements (m_soldier_requirements); |
2177 | + normal_soldier_request_->set_requirements (soldier_requirements_); |
2178 | } |
2179 | |
2180 | - m_normal_soldier_request->set_count(m_capacity - stationed); |
2181 | + normal_soldier_request_->set_count(capacity_ - stationed); |
2182 | } else { |
2183 | - m_normal_soldier_request.reset(); |
2184 | + normal_soldier_request_.reset(); |
2185 | } |
2186 | |
2187 | - if (m_capacity < present.size()) { |
2188 | + if (capacity_ < present.size()) { |
2189 | Game & game = dynamic_cast<Game&>(owner().egbase()); |
2190 | - for (uint32_t i = 0; i < present.size() - m_capacity; ++i) { |
2191 | + for (uint32_t i = 0; i < present.size() - capacity_; ++i) { |
2192 | Soldier & soldier = *present[i]; |
2193 | soldier.reset_tasks(game); |
2194 | soldier.start_task_leavebuilding(game, true); |
2195 | @@ -440,17 +440,17 @@ |
2196 | void MilitarySite::update_upgrade_soldier_request() |
2197 | { |
2198 | bool reqch = update_upgrade_requirements(); |
2199 | - if (!m_soldier_upgrade_try) |
2200 | + if (!soldier_upgrade_try_) |
2201 | return; |
2202 | |
2203 | bool do_rebuild_request = reqch; |
2204 | |
2205 | - if (m_upgrade_soldier_request) |
2206 | + if (upgrade_soldier_request_) |
2207 | { |
2208 | - if (!m_upgrade_soldier_request->is_open()) |
2209 | + if (!upgrade_soldier_request_->is_open()) |
2210 | // If a replacement is already walking this way, let's not change our minds. |
2211 | do_rebuild_request = false; |
2212 | - if (0 == m_upgrade_soldier_request->get_count()) |
2213 | + if (0 == upgrade_soldier_request_->get_count()) |
2214 | do_rebuild_request = true; |
2215 | } |
2216 | else |
2217 | @@ -458,15 +458,15 @@ |
2218 | |
2219 | if (do_rebuild_request) |
2220 | { |
2221 | - m_upgrade_soldier_request.reset |
2222 | + upgrade_soldier_request_.reset |
2223 | (new Request |
2224 | (*this, |
2225 | owner().tribe().soldier(), |
2226 | MilitarySite::request_soldier_callback, |
2227 | wwWORKER)); |
2228 | |
2229 | - m_upgrade_soldier_request->set_requirements(m_soldier_upgrade_requirements); |
2230 | - m_upgrade_soldier_request->set_count(1); |
2231 | + upgrade_soldier_request_->set_requirements(soldier_upgrade_requirements_); |
2232 | + upgrade_soldier_request_->set_count(1); |
2233 | } |
2234 | } |
2235 | |
2236 | @@ -489,27 +489,27 @@ |
2237 | const uint32_t capacity = soldier_capacity(); |
2238 | const uint32_t stationed = stationed_soldiers().size(); |
2239 | |
2240 | - if (m_doing_upgrade_request) |
2241 | + if (doing_upgrade_request_) |
2242 | { |
2243 | - if (incd && m_upgrade_soldier_request) // update requests always ask for one soldier at time! |
2244 | + if (incd && upgrade_soldier_request_) // update requests always ask for one soldier at time! |
2245 | { |
2246 | - m_upgrade_soldier_request.reset(); |
2247 | + upgrade_soldier_request_.reset(); |
2248 | } |
2249 | if (capacity > stationed) |
2250 | { |
2251 | // Somebody is killing my soldiers in the middle of upgrade |
2252 | // or I have kicked out his predecessor already. |
2253 | - if (m_upgrade_soldier_request && (m_upgrade_soldier_request->is_open() || |
2254 | - 0 == m_upgrade_soldier_request->get_count())) { |
2255 | + if (upgrade_soldier_request_ && (upgrade_soldier_request_->is_open() || |
2256 | + 0 == upgrade_soldier_request_->get_count())) { |
2257 | |
2258 | // Economy was not able to find the soldiers I need. |
2259 | // I can safely drop the upgrade request and go to fill mode. |
2260 | - m_upgrade_soldier_request.reset(); |
2261 | + upgrade_soldier_request_.reset(); |
2262 | } |
2263 | - if (! m_upgrade_soldier_request) |
2264 | + if (! upgrade_soldier_request_) |
2265 | { |
2266 | //phoo -- I can safely request new soldiers. |
2267 | - m_doing_upgrade_request = false; |
2268 | + doing_upgrade_request_ = false; |
2269 | update_normal_soldier_request(); |
2270 | } |
2271 | // else -- ohno please help me! Player is in trouble -- evil grin |
2272 | @@ -522,9 +522,9 @@ |
2273 | else // capacity == stationed size |
2274 | { |
2275 | if |
2276 | - (m_upgrade_soldier_request |
2277 | - && (!(m_upgrade_soldier_request->is_open())) |
2278 | - && 1 == m_upgrade_soldier_request->get_count() |
2279 | + (upgrade_soldier_request_ |
2280 | + && (!(upgrade_soldier_request_->is_open())) |
2281 | + && 1 == upgrade_soldier_request_->get_count() |
2282 | && (!incd)) |
2283 | { |
2284 | drop_least_suited_soldier(false, nullptr); |
2285 | @@ -537,14 +537,14 @@ |
2286 | } |
2287 | else // not doing upgrade request |
2288 | { |
2289 | - if ((capacity != stationed) || (m_normal_soldier_request)) |
2290 | + if ((capacity != stationed) || (normal_soldier_request_)) |
2291 | update_normal_soldier_request(); |
2292 | |
2293 | - if ((capacity == stationed) && (! m_normal_soldier_request)) |
2294 | + if ((capacity == stationed) && (! normal_soldier_request_)) |
2295 | { |
2296 | if (present_soldiers().size() == capacity) |
2297 | { |
2298 | - m_doing_upgrade_request = true; |
2299 | + doing_upgrade_request_ = true; |
2300 | update_upgrade_soldier_request(); |
2301 | } |
2302 | // Note -- if there are non-present stationed soldiers, nothing gets |
2303 | @@ -570,7 +570,7 @@ |
2304 | Building::act(game, data); |
2305 | |
2306 | const int32_t timeofgame = game.get_gametime(); |
2307 | - if (m_normal_soldier_request && m_upgrade_soldier_request) |
2308 | + if (normal_soldier_request_ && upgrade_soldier_request_) |
2309 | { |
2310 | throw wexception("MilitarySite::act: Two soldier requests are ongoing -- should never happen!\n"); |
2311 | } |
2312 | @@ -580,13 +580,13 @@ |
2313 | // to keep the game lightweight. |
2314 | |
2315 | //TODO(unknown): I would need two new callbacks, to get rid ot this polling. |
2316 | - if (timeofgame > m_next_swap_soldiers_time) |
2317 | + if (timeofgame > next_swap_soldiers_time_) |
2318 | { |
2319 | - m_next_swap_soldiers_time = timeofgame + (m_soldier_upgrade_try ? 20000 : 100000); |
2320 | + next_swap_soldiers_time_ = timeofgame + (soldier_upgrade_try_ ? 20000 : 100000); |
2321 | update_soldier_request(); |
2322 | } |
2323 | |
2324 | - if (m_nexthealtime <= timeofgame) { |
2325 | + if (nexthealtime_ <= timeofgame) { |
2326 | uint32_t total_heal = descr().get_heal_per_second(); |
2327 | std::vector<Soldier *> soldiers = present_soldiers(); |
2328 | uint32_t max_total_level = 0; |
2329 | @@ -614,7 +614,7 @@ |
2330 | soldier_to_heal->heal(total_heal); |
2331 | } |
2332 | |
2333 | - m_nexthealtime = timeofgame + 1000; |
2334 | + nexthealtime_ = timeofgame + 1000; |
2335 | schedule_act(game, 1000); |
2336 | } |
2337 | } |
2338 | @@ -644,7 +644,7 @@ |
2339 | { |
2340 | if (upcast(Soldier, soldier, &worker)) { |
2341 | // Evict soldiers that have returned home if the capacity is too low |
2342 | - if (m_capacity < present_soldiers().size()) { |
2343 | + if (capacity_ < present_soldiers().size()) { |
2344 | worker.reset_tasks(game); |
2345 | worker.start_task_leavebuilding(game, true); |
2346 | return true; |
2347 | @@ -724,14 +724,14 @@ |
2348 | } |
2349 | uint32_t MilitarySite::soldier_capacity() const |
2350 | { |
2351 | - return m_capacity; |
2352 | + return capacity_; |
2353 | } |
2354 | |
2355 | void MilitarySite::set_soldier_capacity(uint32_t const capacity) { |
2356 | assert(min_soldier_capacity() <= capacity); |
2357 | assert (capacity <= max_soldier_capacity()); |
2358 | - assert(m_capacity != capacity); |
2359 | - m_capacity = capacity; |
2360 | + assert(capacity_ != capacity); |
2361 | + capacity_ = capacity; |
2362 | update_soldier_request(); |
2363 | } |
2364 | |
2365 | @@ -758,19 +758,19 @@ |
2366 | |
2367 | |
2368 | void MilitarySite::conquer_area(EditorGameBase & egbase) { |
2369 | - assert(!m_didconquer); |
2370 | + assert(!didconquer_); |
2371 | egbase.conquer_area |
2372 | (PlayerArea<Area<FCoords> > |
2373 | (owner().player_number(), |
2374 | Area<FCoords> |
2375 | (egbase.map().get_fcoords(get_position()), descr().get_conquers()))); |
2376 | - m_didconquer = true; |
2377 | + didconquer_ = true; |
2378 | } |
2379 | |
2380 | |
2381 | bool MilitarySite::can_attack() |
2382 | { |
2383 | - return m_didconquer; |
2384 | + return didconquer_; |
2385 | } |
2386 | |
2387 | void MilitarySite::aggressor(Soldier & enemy) |
2388 | @@ -804,7 +804,7 @@ |
2389 | sj.soldier = temp_soldier; |
2390 | sj.enemy = &enemy; |
2391 | sj.stayhome = false; |
2392 | - m_soldierjobs.push_back(sj); |
2393 | + soldierjobs_.push_back(sj); |
2394 | temp_soldier->update_task_buildingwork(game); |
2395 | return; |
2396 | } |
2397 | @@ -851,7 +851,7 @@ |
2398 | sj.soldier = defender; |
2399 | sj.enemy = &enemy; |
2400 | sj.stayhome = true; |
2401 | - m_soldierjobs.push_back(sj); |
2402 | + soldierjobs_.push_back(sj); |
2403 | |
2404 | defender->update_task_buildingwork(game); |
2405 | |
2406 | @@ -871,7 +871,7 @@ |
2407 | pgettext("building", "Lost!"), |
2408 | descr().icon_filename(), |
2409 | _("Militarysite lost!"), |
2410 | - descr().m_defeated_enemy_str, |
2411 | + descr().defeated_enemy_str_, |
2412 | false); |
2413 | } |
2414 | |
2415 | @@ -891,7 +891,7 @@ |
2416 | // In fact we do not conquer it, but place a new building of same type at |
2417 | // the old location. |
2418 | |
2419 | - Building::FormerBuildings former_buildings = m_old_buildings; |
2420 | + Building::FormerBuildings former_buildings = old_buildings_; |
2421 | |
2422 | // The enemy conquers the building |
2423 | // In fact we do not conquer it, but place a new building of same type at |
2424 | @@ -916,7 +916,7 @@ |
2425 | _("Enemy Defeated!"), |
2426 | newsite->descr().icon_filename(), |
2427 | _("Enemy at site defeated!"), |
2428 | - newsite->descr().m_defeated_you_str, |
2429 | + newsite->descr().defeated_you_str_, |
2430 | true); |
2431 | |
2432 | return false; |
2433 | @@ -952,7 +952,7 @@ |
2434 | (this != militarysite && |
2435 | &owner () == &militarysite->owner() && |
2436 | get_size() <= militarysite->get_size() && |
2437 | - militarysite->m_didconquer) |
2438 | + militarysite->didconquer_) |
2439 | return true; |
2440 | return false; |
2441 | } |
2442 | @@ -969,7 +969,7 @@ |
2443 | pgettext("building", "Attack!"), |
2444 | descr().icon_filename(), |
2445 | _("You are under attack"), |
2446 | - discovered ? descr().m_aggressor_str : descr().m_attack_str, |
2447 | + discovered ? descr().aggressor_str_ : descr().attack_str_, |
2448 | false, |
2449 | 60 * 1000, 5); |
2450 | } |
2451 | @@ -982,7 +982,7 @@ |
2452 | */ |
2453 | void MilitarySite::set_requirements (const Requirements & r) |
2454 | { |
2455 | - m_soldier_requirements = r; |
2456 | + soldier_requirements_ = r; |
2457 | } |
2458 | |
2459 | /* |
2460 | @@ -992,7 +992,7 @@ |
2461 | */ |
2462 | void MilitarySite::clear_requirements () |
2463 | { |
2464 | - m_soldier_requirements = Requirements(); |
2465 | + soldier_requirements_ = Requirements(); |
2466 | } |
2467 | |
2468 | void MilitarySite::send_attacker |
2469 | @@ -1007,7 +1007,7 @@ |
2470 | sj.soldier = &soldier; |
2471 | sj.enemy = ⌖ |
2472 | sj.stayhome = false; |
2473 | - m_soldierjobs.push_back(sj); |
2474 | + soldierjobs_.push_back(sj); |
2475 | |
2476 | soldier.update_task_buildingwork |
2477 | (dynamic_cast<Game&>(owner().egbase())); |
2478 | @@ -1016,7 +1016,7 @@ |
2479 | |
2480 | bool MilitarySite::has_soldier_job(Soldier & soldier) |
2481 | { |
2482 | - for (const SoldierJob& temp_job : m_soldierjobs) { |
2483 | + for (const SoldierJob& temp_job : soldierjobs_) { |
2484 | if (temp_job.soldier == &soldier) { |
2485 | return true; |
2486 | } |
2487 | @@ -1032,14 +1032,14 @@ |
2488 | MapObject * MilitarySite::pop_soldier_job |
2489 | (Soldier * const soldier, bool * const stayhome) |
2490 | { |
2491 | - for (std::vector<SoldierJob>::iterator job_iter = m_soldierjobs.begin(); |
2492 | - job_iter != m_soldierjobs.end(); ++job_iter) |
2493 | + for (std::vector<SoldierJob>::iterator job_iter = soldierjobs_.begin(); |
2494 | + job_iter != soldierjobs_.end(); ++job_iter) |
2495 | { |
2496 | if (job_iter->soldier == soldier) { |
2497 | MapObject * const enemy = job_iter->enemy.get(owner().egbase()); |
2498 | if (stayhome) |
2499 | *stayhome = job_iter->stayhome; |
2500 | - m_soldierjobs.erase(job_iter); |
2501 | + soldierjobs_.erase(job_iter); |
2502 | return enemy; |
2503 | } |
2504 | } |
2505 | @@ -1058,13 +1058,13 @@ |
2506 | bool |
2507 | MilitarySite::update_upgrade_requirements() |
2508 | { |
2509 | - int32_t soldier_upgrade_required_min = m_soldier_upgrade_requirements.get_min(); |
2510 | - int32_t soldier_upgrade_required_max = m_soldier_upgrade_requirements.get_max(); |
2511 | + int32_t soldier_upgrade_required_min = soldier_upgrade_requirements_.get_min(); |
2512 | + int32_t soldier_upgrade_required_max = soldier_upgrade_requirements_.get_max(); |
2513 | |
2514 | - if (kPrefersHeroes != m_soldier_preference && kPrefersRookies != m_soldier_preference) |
2515 | + if (kPrefersHeroes != soldier_preference_ && kPrefersRookies != soldier_preference_) |
2516 | { |
2517 | - log("MilitarySite::swapSoldiers: error: Unknown player preference %d.\n", m_soldier_preference); |
2518 | - m_soldier_upgrade_try = false; |
2519 | + log("MilitarySite::swapSoldiers: error: Unknown player preference %d.\n", soldier_preference_); |
2520 | + soldier_upgrade_try_ = false; |
2521 | return false; |
2522 | } |
2523 | |
2524 | @@ -1078,29 +1078,29 @@ |
2525 | |
2526 | // Micro-optimization: I assume that the majority of military sites have only level-zero |
2527 | // soldiers and prefer rookies. Handle them separately. |
2528 | - m_soldier_upgrade_try = true; |
2529 | - if (kPrefersRookies == m_soldier_preference) { |
2530 | + soldier_upgrade_try_ = true; |
2531 | + if (kPrefersRookies == soldier_preference_) { |
2532 | if (0 == wg_level) |
2533 | { |
2534 | - m_soldier_upgrade_try = false; |
2535 | + soldier_upgrade_try_ = false; |
2536 | return false; |
2537 | } |
2538 | } |
2539 | |
2540 | // Now I actually build the new requirements. |
2541 | - int32_t reqmin = kPrefersHeroes == m_soldier_preference ? 1 + wg_level : 0; |
2542 | - int32_t reqmax = kPrefersHeroes == m_soldier_preference ? SHRT_MAX : wg_level - 1; |
2543 | + int32_t reqmin = kPrefersHeroes == soldier_preference_ ? 1 + wg_level : 0; |
2544 | + int32_t reqmax = kPrefersHeroes == soldier_preference_ ? SHRT_MAX : wg_level - 1; |
2545 | |
2546 | bool maxchanged = reqmax != soldier_upgrade_required_max; |
2547 | bool minchanged = reqmin != soldier_upgrade_required_min; |
2548 | |
2549 | if (maxchanged || minchanged) |
2550 | { |
2551 | - if (m_upgrade_soldier_request && (m_upgrade_soldier_request->is_open())) |
2552 | + if (upgrade_soldier_request_ && (upgrade_soldier_request_->is_open())) |
2553 | { |
2554 | - m_upgrade_soldier_request.reset(); |
2555 | + upgrade_soldier_request_.reset(); |
2556 | } |
2557 | - m_soldier_upgrade_requirements = RequireAttribute(atrTotal, reqmin, reqmax); |
2558 | + soldier_upgrade_requirements_ = RequireAttribute(atrTotal, reqmin, reqmax); |
2559 | |
2560 | return true; |
2561 | } |
2562 | @@ -1114,8 +1114,8 @@ |
2563 | MilitarySite::set_soldier_preference(MilitarySite::SoldierPreference p) |
2564 | { |
2565 | assert(kPrefersHeroes == p || kPrefersRookies == p); |
2566 | - m_soldier_preference = p; |
2567 | - m_next_swap_soldiers_time = 0; |
2568 | + soldier_preference_ = p; |
2569 | + next_swap_soldiers_time_ = 0; |
2570 | } |
2571 | |
2572 | } |
2573 | |
2574 | === modified file 'src/logic/map_objects/tribes/militarysite.h' |
2575 | --- src/logic/map_objects/tribes/militarysite.h 2016-01-31 15:31:00 +0000 |
2576 | +++ src/logic/map_objects/tribes/militarysite.h 2016-02-08 18:17:36 +0000 |
2577 | @@ -42,26 +42,26 @@ |
2578 | |
2579 | Building & create_object() const override; |
2580 | |
2581 | - uint32_t get_conquers() const override {return m_conquer_radius;} |
2582 | + uint32_t get_conquers() const override {return conquer_radius_;} |
2583 | uint32_t get_max_number_of_soldiers () const { |
2584 | - return m_num_soldiers; |
2585 | + return num_soldiers_; |
2586 | } |
2587 | uint32_t get_heal_per_second () const { |
2588 | - return m_heal_per_second; |
2589 | + return heal_per_second_; |
2590 | } |
2591 | |
2592 | - bool m_prefers_heroes_at_start; |
2593 | - std::string m_occupied_str; |
2594 | - std::string m_aggressor_str; |
2595 | - std::string m_attack_str; |
2596 | - std::string m_defeated_enemy_str; |
2597 | - std::string m_defeated_you_str; |
2598 | + bool prefers_heroes_at_start_; |
2599 | + std::string occupied_str_; |
2600 | + std::string aggressor_str_; |
2601 | + std::string attack_str_; |
2602 | + std::string defeated_enemy_str_; |
2603 | + std::string defeated_you_str_; |
2604 | |
2605 | |
2606 | private: |
2607 | - uint32_t m_conquer_radius; |
2608 | - uint32_t m_num_soldiers; |
2609 | - uint32_t m_heal_per_second; |
2610 | + uint32_t conquer_radius_; |
2611 | + uint32_t num_soldiers_; |
2612 | + uint32_t heal_per_second_; |
2613 | DISALLOW_COPY_AND_ASSIGN(MilitarySiteDescr); |
2614 | }; |
2615 | |
2616 | @@ -115,7 +115,7 @@ |
2617 | void set_requirements (const Requirements &); |
2618 | void clear_requirements(); |
2619 | const Requirements & get_requirements () const { |
2620 | - return m_soldier_requirements; |
2621 | + return soldier_requirements_; |
2622 | } |
2623 | |
2624 | void reinit_after_conqueration(Game &); |
2625 | @@ -124,7 +124,7 @@ |
2626 | |
2627 | void set_soldier_preference(SoldierPreference); |
2628 | SoldierPreference get_soldier_preference() const { |
2629 | - return m_soldier_preference; |
2630 | + return soldier_preference_; |
2631 | } |
2632 | |
2633 | protected: |
2634 | @@ -153,28 +153,28 @@ |
2635 | |
2636 | |
2637 | private: |
2638 | - Requirements m_soldier_requirements; // This is used to grab a bunch of soldiers: Anything goes |
2639 | - RequireAttribute m_soldier_upgrade_requirements; // This is used when exchanging soldiers. |
2640 | - std::unique_ptr<Request> m_normal_soldier_request; // filling the site |
2641 | - std::unique_ptr<Request> m_upgrade_soldier_request; // seeking for better soldiers |
2642 | - bool m_didconquer; |
2643 | - uint32_t m_capacity; |
2644 | + Requirements soldier_requirements_; // This is used to grab a bunch of soldiers: Anything goes |
2645 | + RequireAttribute soldier_upgrade_requirements_; // This is used when exchanging soldiers. |
2646 | + std::unique_ptr<Request> normal_soldier_request_; // filling the site |
2647 | + std::unique_ptr<Request> upgrade_soldier_request_; // seeking for better soldiers |
2648 | + bool didconquer_; |
2649 | + uint32_t capacity_; |
2650 | |
2651 | /** |
2652 | * Next gametime where we should heal something. |
2653 | */ |
2654 | - int32_t m_nexthealtime; |
2655 | + int32_t nexthealtime_; |
2656 | |
2657 | struct SoldierJob { |
2658 | Soldier * soldier; |
2659 | ObjectPointer enemy; |
2660 | bool stayhome; |
2661 | }; |
2662 | - std::vector<SoldierJob> m_soldierjobs; |
2663 | - SoldierPreference m_soldier_preference; |
2664 | - int32_t m_next_swap_soldiers_time; |
2665 | - bool m_soldier_upgrade_try; // optimization -- if everybody is zero-level, do not downgrade |
2666 | - bool m_doing_upgrade_request; |
2667 | + std::vector<SoldierJob> soldierjobs_; |
2668 | + SoldierPreference soldier_preference_; |
2669 | + int32_t next_swap_soldiers_time_; |
2670 | + bool soldier_upgrade_try_; // optimization -- if everybody is zero-level, do not downgrade |
2671 | + bool doing_upgrade_request_; |
2672 | }; |
2673 | |
2674 | } |
2675 | |
2676 | === modified file 'src/logic/map_objects/tribes/partially_finished_building.cc' |
2677 | --- src/logic/map_objects/tribes/partially_finished_building.cc 2016-01-28 05:24:34 +0000 |
2678 | +++ src/logic/map_objects/tribes/partially_finished_building.cc 2016-02-08 18:17:36 +0000 |
2679 | @@ -33,12 +33,12 @@ |
2680 | PartiallyFinishedBuilding::PartiallyFinishedBuilding |
2681 | (const BuildingDescr & gdescr) : |
2682 | Building (gdescr), |
2683 | -m_building (nullptr), |
2684 | -m_builder_request(nullptr), |
2685 | -m_working (false), |
2686 | -m_work_steptime (0), |
2687 | -m_work_completed (0), |
2688 | -m_work_steps (0) |
2689 | +building_ (nullptr), |
2690 | +builder_request_(nullptr), |
2691 | +working_ (false), |
2692 | +work_steptime_ (0), |
2693 | +work_completed_ (0), |
2694 | +work_steps_ (0) |
2695 | {} |
2696 | |
2697 | /* |
2698 | @@ -47,22 +47,22 @@ |
2699 | =============== |
2700 | */ |
2701 | void PartiallyFinishedBuilding::set_building(const BuildingDescr & building_descr) { |
2702 | - assert(!m_building); |
2703 | + assert(!building_); |
2704 | |
2705 | - m_building = &building_descr; |
2706 | + building_ = &building_descr; |
2707 | } |
2708 | |
2709 | void PartiallyFinishedBuilding::cleanup(EditorGameBase & egbase) { |
2710 | - if (m_builder_request) { |
2711 | - delete m_builder_request; |
2712 | - m_builder_request = nullptr; |
2713 | + if (builder_request_) { |
2714 | + delete builder_request_; |
2715 | + builder_request_ = nullptr; |
2716 | } |
2717 | |
2718 | - for (WaresQueue * temp_ware : m_wares) { |
2719 | + for (WaresQueue * temp_ware : wares_) { |
2720 | temp_ware->cleanup(); |
2721 | delete temp_ware; |
2722 | } |
2723 | - m_wares.clear(); |
2724 | + wares_.clear(); |
2725 | |
2726 | Building::cleanup(egbase); |
2727 | } |
2728 | @@ -73,7 +73,7 @@ |
2729 | if (upcast(Game, game, &egbase)) |
2730 | request_builder(*game); |
2731 | |
2732 | - g_sound_handler.play_fx("create_construction_site", m_position, 255); |
2733 | + g_sound_handler.play_fx("create_construction_site", position_, 255); |
2734 | } |
2735 | |
2736 | /* |
2737 | @@ -85,16 +85,16 @@ |
2738 | void PartiallyFinishedBuilding::set_economy(Economy * const e) |
2739 | { |
2740 | if (Economy * const old = get_economy()) { |
2741 | - for (WaresQueue * temp_ware : m_wares) { |
2742 | + for (WaresQueue * temp_ware : wares_) { |
2743 | temp_ware->remove_from_economy(*old); |
2744 | } |
2745 | } |
2746 | Building::set_economy(e); |
2747 | - if (m_builder_request) |
2748 | - m_builder_request->set_economy(e); |
2749 | + if (builder_request_) |
2750 | + builder_request_->set_economy(e); |
2751 | |
2752 | if (e) |
2753 | - for (WaresQueue * temp_ware : m_wares) { |
2754 | + for (WaresQueue * temp_ware : wares_) { |
2755 | temp_ware->add_to_economy(*e); |
2756 | } |
2757 | } |
2758 | @@ -107,9 +107,9 @@ |
2759 | =============== |
2760 | */ |
2761 | void PartiallyFinishedBuilding::request_builder(Game &) { |
2762 | - assert(!m_builder.is_set() && !m_builder_request); |
2763 | + assert(!builder_.is_set() && !builder_request_); |
2764 | |
2765 | - m_builder_request = |
2766 | + builder_request_ = |
2767 | new Request |
2768 | (*this, |
2769 | owner().tribe().builder(), |
2770 | @@ -123,7 +123,7 @@ |
2771 | =============== |
2772 | */ |
2773 | int32_t PartiallyFinishedBuilding::get_size() const { |
2774 | - return m_building->get_size(); |
2775 | + return building_->get_size(); |
2776 | } |
2777 | |
2778 | /* |
2779 | @@ -149,7 +149,7 @@ |
2780 | */ |
2781 | const Image* PartiallyFinishedBuilding::representative_image() const |
2782 | { |
2783 | - return m_building->representative_image(&owner().get_playercolor()); |
2784 | + return building_->representative_image(&owner().get_playercolor()); |
2785 | } |
2786 | |
2787 | |
2788 | @@ -166,8 +166,8 @@ |
2789 | uint32_t thisstep = 0; |
2790 | |
2791 | uint32_t ts = build_step_time(); |
2792 | - if (m_working) { |
2793 | - thisstep = ts - (m_work_steptime - time); |
2794 | + if (working_) { |
2795 | + thisstep = ts - (work_steptime_ - time); |
2796 | // The check below is necessary because we drive construction via |
2797 | // the construction worker in get_building_work(), and there can be |
2798 | // a small delay between the worker completing his job and requesting |
2799 | @@ -176,9 +176,9 @@ |
2800 | thisstep = ts; |
2801 | } |
2802 | thisstep = (thisstep << 16) / ts; |
2803 | - uint32_t total = (thisstep + (m_work_completed << 16)); |
2804 | - if (m_work_steps) |
2805 | - total /= m_work_steps; |
2806 | + uint32_t total = (thisstep + (work_completed_ << 16)); |
2807 | + if (work_steps_) |
2808 | + total /= work_steps_; |
2809 | |
2810 | assert(total <= (1 << 16)); |
2811 | |
2812 | @@ -203,10 +203,10 @@ |
2813 | |
2814 | PartiallyFinishedBuilding & b = dynamic_cast<PartiallyFinishedBuilding&>(target); |
2815 | |
2816 | - b.m_builder = w; |
2817 | + b.builder_ = w; |
2818 | |
2819 | delete &rq; |
2820 | - b.m_builder_request = nullptr; |
2821 | + b.builder_request_ = nullptr; |
2822 | |
2823 | w->start_task_buildingwork(game); |
2824 | b.set_seeing(true); |
2825 | |
2826 | === modified file 'src/logic/map_objects/tribes/partially_finished_building.h' |
2827 | --- src/logic/map_objects/tribes/partially_finished_building.h 2015-11-28 22:29:26 +0000 |
2828 | +++ src/logic/map_objects/tribes/partially_finished_building.h 2016-02-08 18:17:36 +0000 |
2829 | @@ -50,11 +50,11 @@ |
2830 | void init (EditorGameBase &) override; |
2831 | void set_economy(Economy *) override; |
2832 | |
2833 | - uint32_t get_nrwaresqueues() {return m_wares.size();} |
2834 | - WaresQueue * get_waresqueue(uint32_t const idx) {return m_wares[idx];} |
2835 | + uint32_t get_nrwaresqueues() {return wares_.size();} |
2836 | + WaresQueue * get_waresqueue(uint32_t const idx) {return wares_[idx];} |
2837 | |
2838 | uint32_t get_built_per64k() const; |
2839 | - Request * get_builder_request() {return m_builder_request;} |
2840 | + Request * get_builder_request() {return builder_request_;} |
2841 | static void request_builder_callback(Game &, Request &, DescriptionIndex, Worker *, PlayerImmovable &); |
2842 | |
2843 | private: |
2844 | @@ -64,19 +64,19 @@ |
2845 | virtual uint32_t build_step_time() const = 0; |
2846 | |
2847 | protected: |
2848 | - const BuildingDescr * m_building; // type of building that was or will become |
2849 | + const BuildingDescr * building_; // type of building that was or will become |
2850 | |
2851 | - Request * m_builder_request; |
2852 | - OPtr<Worker> m_builder; |
2853 | + Request * builder_request_; |
2854 | + OPtr<Worker> builder_; |
2855 | |
2856 | using Wares = std::vector<WaresQueue *>; |
2857 | - Wares m_wares; |
2858 | + Wares wares_; |
2859 | |
2860 | - bool m_working; // true if the builder is currently working |
2861 | - uint32_t m_work_steptime; // time when next step is completed |
2862 | - uint32_t m_work_completed; // how many steps have we done so far? |
2863 | - uint32_t m_work_steps; // how many steps (= wares) until we're done? |
2864 | - //Player::ConstructionsiteInformation * m_info; // asked for by player point of view for the gameview |
2865 | + bool working_; // true if the builder is currently working |
2866 | + uint32_t work_steptime_; // time when next step is completed |
2867 | + uint32_t work_completed_; // how many steps have we done so far? |
2868 | + uint32_t work_steps_; // how many steps (= wares) until we're done? |
2869 | + //Player::ConstructionsiteInformation * info_; // asked for by player point of view for the gameview |
2870 | }; |
2871 | |
2872 | } |
2873 | |
2874 | === modified file 'src/logic/map_objects/tribes/production_program.cc' |
2875 | --- src/logic/map_objects/tribes/production_program.cc 2016-02-01 16:18:17 +0000 |
2876 | +++ src/logic/map_objects/tribes/production_program.cc 2016-02-08 18:17:36 +0000 |
2877 | @@ -722,7 +722,7 @@ |
2878 | |
2879 | for (const std::pair<uint32_t, std::set<std::string> >& area_info : worker_workarea_info) { |
2880 | std::set<std::string> & building_radius_infos = |
2881 | - descr->m_workarea_info[area_info.first]; |
2882 | + descr->workarea_info_[area_info.first]; |
2883 | |
2884 | for (const std::string& worker_descname : area_info.second) { |
2885 | std::string description = descr->descname(); |
2886 | @@ -1228,7 +1228,7 @@ |
2887 | % world.get_resource(m_resource)->descname()) |
2888 | .str(); |
2889 | |
2890 | - descr->m_workarea_info[m_distance].insert(description); |
2891 | + descr->workarea_info_[m_distance].insert(description); |
2892 | } catch (const WException & e) { |
2893 | throw GameDataError("mine: %s", e.what()); |
2894 | } |
2895 | @@ -1546,7 +1546,7 @@ |
2896 | void ProductionProgram::ActPlayFX::execute |
2897 | (Game & game, ProductionSite & ps) const |
2898 | { |
2899 | - g_sound_handler.play_fx(name, ps.m_position, priority); |
2900 | + g_sound_handler.play_fx(name, ps.position_, priority); |
2901 | return ps.program_step(game); |
2902 | } |
2903 | |
2904 | @@ -1562,7 +1562,7 @@ |
2905 | workerprogram = params[1]; |
2906 | radius = boost::lexical_cast<uint32_t>(params[2]); |
2907 | |
2908 | - std::set<std::string> & building_radius_infos = descr->m_workarea_info[radius]; |
2909 | + std::set<std::string> & building_radius_infos = descr->workarea_info_[radius]; |
2910 | std::string description = descr->name() + ' ' + production_program_name; |
2911 | description += " construct "; |
2912 | description += objectname; |
2913 | |
2914 | === modified file 'src/logic/map_objects/tribes/productionsite.cc' |
2915 | --- src/logic/map_objects/tribes/productionsite.cc 2016-01-23 16:35:30 +0000 |
2916 | +++ src/logic/map_objects/tribes/productionsite.cc 2016-02-08 18:17:36 +0000 |
2917 | @@ -688,7 +688,7 @@ |
2918 | if (state.program->size() <= state.ip) |
2919 | return program_end(game, Completed); |
2920 | |
2921 | - if (m_anim != descr().get_animation(m_default_anim)) { |
2922 | + if (anim_ != descr().get_animation(m_default_anim)) { |
2923 | // Restart idle animation, which is the default |
2924 | start_animation(game, descr().get_animation(m_default_anim)); |
2925 | } |
2926 | |
2927 | === modified file 'src/logic/map_objects/tribes/warehouse.cc' |
2928 | --- src/logic/map_objects/tribes/warehouse.cc 2016-02-07 06:10:47 +0000 |
2929 | +++ src/logic/map_objects/tribes/warehouse.cc 2016-02-08 18:17:36 +0000 |
2930 | @@ -261,7 +261,7 @@ |
2931 | m_heal_per_second = table.get_int("heal_per_second"); |
2932 | if (table.has_key("conquers")) { |
2933 | m_conquers = table.get_int("conquers"); |
2934 | - m_workarea_info[m_conquers].insert(descname() + " conquer"); |
2935 | + workarea_info_[m_conquers].insert(descname() + " conquer"); |
2936 | } |
2937 | } |
2938 | |
2939 | @@ -629,7 +629,7 @@ |
2940 | (PlayerArea<Area<FCoords> > |
2941 | (owner().player_number(), |
2942 | Area<FCoords>(map.get_fcoords(get_position()), conquer_radius)), |
2943 | - m_defeating_player); |
2944 | + defeating_player_); |
2945 | |
2946 | // Unsee the area that we started seeing in init() |
2947 | Player & player = owner(); |
2948 | @@ -903,7 +903,7 @@ |
2949 | // NOTE: This code lies about the TrainingAttributes of the new worker |
2950 | m_supply->remove_workers(worker_id, 1); |
2951 | const WorkerDescr & workerdescr = *game.tribes().get_worker_descr(worker_id); |
2952 | - return workerdescr.create(game, owner(), this, m_position); |
2953 | + return workerdescr.create(game, owner(), this, position_); |
2954 | } |
2955 | } |
2956 | |
2957 | @@ -1105,7 +1105,7 @@ |
2958 | remove_workers(owner().tribe().safe_worker_index(input), buildcost.second); |
2959 | } |
2960 | |
2961 | - incorporate_worker(game, &w_desc.create(game, owner(), this, m_position)); |
2962 | + incorporate_worker(game, &w_desc.create(game, owner(), this, position_)); |
2963 | |
2964 | // Update PlannedWorkers::amount here if appropriate, because this function |
2965 | // may have been called directly by the Economy. |
2966 | |
2967 | === modified file 'src/logic/player.cc' |
2968 | --- src/logic/player.cc 2016-01-28 05:24:34 +0000 |
2969 | +++ src/logic/player.cc 2016-02-08 18:17:36 +0000 |
2970 | @@ -1253,9 +1253,9 @@ |
2971 | |
2972 | Player::BuildingStatsVector* Player::get_mutable_building_statistics(const DescriptionIndex& i) { |
2973 | DescriptionIndex const nr_buildings = egbase().tribes().nrbuildings(); |
2974 | - if (m_building_stats.size() < nr_buildings) |
2975 | - m_building_stats.resize(nr_buildings); |
2976 | - return &m_building_stats[i]; |
2977 | + if (building_stats_.size() < nr_buildings) |
2978 | + building_stats_.resize(nr_buildings); |
2979 | + return &building_stats_[i]; |
2980 | } |
2981 | |
2982 | /** |
2983 | @@ -1273,8 +1273,8 @@ |
2984 | const size_t nr_buildings = egbase().tribes().nrbuildings(); |
2985 | |
2986 | // Get the valid vector for this |
2987 | - if (m_building_stats.size() < nr_buildings) |
2988 | - m_building_stats.resize(nr_buildings); |
2989 | + if (building_stats_.size() < nr_buildings) |
2990 | + building_stats_.resize(nr_buildings); |
2991 | |
2992 | std::vector<BuildingStats>& stat = |
2993 | *get_mutable_building_statistics(egbase().tribes().building_index(building_name.c_str())); |
2994 | |
2995 | === modified file 'src/logic/player.h' |
2996 | --- src/logic/player.h 2016-01-31 15:31:00 +0000 |
2997 | +++ src/logic/player.h 2016-02-08 18:17:36 +0000 |
2998 | @@ -613,7 +613,7 @@ |
2999 | */ |
3000 | std::vector< std::vector<uint32_t> > m_ware_stocks; |
3001 | |
3002 | - PlayerBuildingStats m_building_stats; |
3003 | + PlayerBuildingStats building_stats_; |
3004 | |
3005 | DISALLOW_COPY_AND_ASSIGN(Player); |
3006 | }; |
3007 | |
3008 | === modified file 'src/map_io/map_building_packet.cc' |
3009 | --- src/map_io/map_building_packet.cc 2016-02-06 11:11:24 +0000 |
3010 | +++ src/map_io/map_building_packet.cc 2016-02-08 18:17:36 +0000 |
3011 | @@ -142,12 +142,12 @@ |
3012 | |
3013 | if (building->descr().type() == MapObjectType::CONSTRUCTIONSITE) { |
3014 | upcast(PartiallyFinishedBuilding const, pfb, building); |
3015 | - fw.c_string((*pfb->m_building).name().c_str()); |
3016 | + fw.c_string((*pfb->building_).name().c_str()); |
3017 | fw.unsigned_8(kTypeConstructionSite); |
3018 | |
3019 | } else if (building->descr().type() == MapObjectType::DISMANTLESITE) { |
3020 | upcast(PartiallyFinishedBuilding const, pfb, building); |
3021 | - fw.c_string((*pfb->m_building).name().c_str()); |
3022 | + fw.c_string((*pfb->building_).name().c_str()); |
3023 | fw.unsigned_8(kTypeDismantleSite); |
3024 | |
3025 | } else { |
3026 | |
3027 | === modified file 'src/map_io/map_buildingdata_packet.cc' |
3028 | --- src/map_io/map_buildingdata_packet.cc 2016-02-07 06:10:47 +0000 |
3029 | +++ src/map_io/map_buildingdata_packet.cc 2016-02-08 18:17:36 +0000 |
3030 | @@ -87,7 +87,7 @@ |
3031 | if (fr.unsigned_8()) { |
3032 | char const * const animation_name = fr.c_string(); |
3033 | try { |
3034 | - building.m_anim = |
3035 | + building.anim_ = |
3036 | building.descr().get_animation(animation_name); |
3037 | } catch (const MapObjectDescr::AnimationNonexistent &) { |
3038 | log |
3039 | @@ -96,15 +96,15 @@ |
3040 | building.owner().tribe().name().c_str(), |
3041 | building.descr().descname().c_str(), |
3042 | animation_name); |
3043 | - building.m_anim = building.descr().get_animation("idle"); |
3044 | + building.anim_ = building.descr().get_animation("idle"); |
3045 | } |
3046 | } else { |
3047 | - building.m_anim = 0; |
3048 | + building.anim_ = 0; |
3049 | } |
3050 | - building.m_animstart = fr.unsigned_32(); |
3051 | + building.animstart_ = fr.unsigned_32(); |
3052 | |
3053 | { |
3054 | - Building::LeaveQueue & leave_queue = building.m_leave_queue; |
3055 | + Building::LeaveQueue & leave_queue = building.leave_queue_; |
3056 | leave_queue.resize(fr.unsigned_16()); |
3057 | |
3058 | for (Building::LeaveQueue::iterator queue_iter = leave_queue.begin(); |
3059 | @@ -131,26 +131,26 @@ |
3060 | } |
3061 | } |
3062 | |
3063 | - building.m_leave_time = fr.unsigned_32(); |
3064 | + building.leave_time_ = fr.unsigned_32(); |
3065 | |
3066 | if (uint32_t const leaver_serial = fr.unsigned_32()) |
3067 | try { |
3068 | - building.m_leave_allow = |
3069 | + building.leave_allow_ = |
3070 | &mol.get<MapObject>(leaver_serial); |
3071 | } catch (const WException & e) { |
3072 | throw GameDataError |
3073 | ("leave allow item (%u): %s", leaver_serial, e.what()); |
3074 | } |
3075 | else { |
3076 | - building.m_leave_allow = nullptr; |
3077 | + building.leave_allow_ = nullptr; |
3078 | } |
3079 | |
3080 | while (fr.unsigned_8()) { |
3081 | DescriptionIndex oldidx = building.owner().tribe().safe_building_index(fr.c_string()); |
3082 | - building.m_old_buildings.push_back(oldidx); |
3083 | + building.old_buildings_.push_back(oldidx); |
3084 | } |
3085 | // Only construction sites may have an empty list |
3086 | - if (building.m_old_buildings.empty() && !is_a(ConstructionSite, &building)) { |
3087 | + if (building.old_buildings_.empty() && !is_a(ConstructionSite, &building)) { |
3088 | throw GameDataError |
3089 | ("Failed to read %s %u: No former buildings informations.\n" |
3090 | "Your savegame is corrupted", building.descr().descname().c_str(), building.serial()); |
3091 | @@ -180,7 +180,7 @@ |
3092 | } |
3093 | |
3094 | // Set economy now, some stuff below will count on this. |
3095 | - building.set_economy(building.m_flag->get_economy()); |
3096 | + building.set_economy(building.flag_->get_economy()); |
3097 | |
3098 | Game& game = dynamic_cast<Game&>(egbase); |
3099 | |
3100 | @@ -226,49 +226,49 @@ |
3101 | uint16_t const packet_version = fr.unsigned_16(); |
3102 | if (packet_version == kCurrentPacketPFBuilding) { |
3103 | const TribeDescr & tribe = pfb.owner().tribe(); |
3104 | - pfb.m_building = |
3105 | + pfb.building_ = |
3106 | tribe.get_building_descr(tribe.safe_building_index(fr.c_string())); |
3107 | |
3108 | - delete pfb.m_builder_request; |
3109 | + delete pfb.builder_request_; |
3110 | if (fr.unsigned_8()) { |
3111 | - pfb.m_builder_request = |
3112 | + pfb.builder_request_ = |
3113 | new Request |
3114 | (pfb, |
3115 | 0, |
3116 | PartiallyFinishedBuilding::request_builder_callback, |
3117 | wwWORKER); |
3118 | - pfb.m_builder_request->read(fr, game, mol); |
3119 | + pfb.builder_request_->read(fr, game, mol); |
3120 | } else |
3121 | - pfb.m_builder_request = nullptr; |
3122 | + pfb.builder_request_ = nullptr; |
3123 | |
3124 | if (uint32_t const builder_serial = fr.unsigned_32()) { |
3125 | try { |
3126 | - pfb.m_builder = &mol.get<Worker>(builder_serial); |
3127 | + pfb.builder_ = &mol.get<Worker>(builder_serial); |
3128 | } catch (const WException & e) { |
3129 | throw GameDataError |
3130 | ("builder (%u): %s", builder_serial, e.what()); |
3131 | } |
3132 | } else |
3133 | - pfb.m_builder = nullptr; |
3134 | + pfb.builder_ = nullptr; |
3135 | |
3136 | try { |
3137 | uint16_t const size = fr.unsigned_16(); |
3138 | - pfb.m_wares.resize(size); |
3139 | - for (uint16_t i = 0; i < pfb.m_wares.size(); ++i) |
3140 | + pfb.wares_.resize(size); |
3141 | + for (uint16_t i = 0; i < pfb.wares_.size(); ++i) |
3142 | { |
3143 | - pfb.m_wares[i] = |
3144 | + pfb.wares_[i] = |
3145 | new WaresQueue |
3146 | (pfb, INVALID_INDEX, 0); |
3147 | - pfb.m_wares[i]->read(fr, game, mol); |
3148 | + pfb.wares_[i]->read(fr, game, mol); |
3149 | } |
3150 | } catch (const WException & e) { |
3151 | throw GameDataError("wares: %s", e.what()); |
3152 | } |
3153 | |
3154 | - pfb.m_working = fr.unsigned_8 (); |
3155 | - pfb.m_work_steptime = fr.unsigned_32(); |
3156 | - pfb.m_work_completed = fr.unsigned_32(); |
3157 | - pfb.m_work_steps = fr.unsigned_32(); |
3158 | + pfb.working_ = fr.unsigned_8 (); |
3159 | + pfb.work_steptime_ = fr.unsigned_32(); |
3160 | + pfb.work_completed_ = fr.unsigned_32(); |
3161 | + pfb.work_steps_ = fr.unsigned_32(); |
3162 | } else { |
3163 | throw UnhandledVersionError("MapBuildingdataPacket - Partially Finished Building", |
3164 | packet_version, kCurrentPacketPFBuilding); |
3165 | @@ -289,15 +289,15 @@ |
3166 | if (packet_version >= kCurrentPacketVersionConstructionsite) { |
3167 | read_partially_finished_building(constructionsite, fr, game, mol); |
3168 | |
3169 | - for (ConstructionSite::Wares::iterator wares_iter = constructionsite.m_wares.begin(); |
3170 | - wares_iter != constructionsite.m_wares.end(); |
3171 | + for (ConstructionSite::Wares::iterator wares_iter = constructionsite.wares_.begin(); |
3172 | + wares_iter != constructionsite.wares_.end(); |
3173 | ++wares_iter) { |
3174 | |
3175 | (*wares_iter)->set_callback |
3176 | (ConstructionSite::wares_queue_callback, &constructionsite); |
3177 | } |
3178 | |
3179 | - constructionsite.m_fetchfromflag = fr. signed_32(); |
3180 | + constructionsite.fetchfromflag_ = fr. signed_32(); |
3181 | } else { |
3182 | throw UnhandledVersionError("MapBuildingdataPacket - Constructionsite", |
3183 | packet_version, kCurrentPacketVersionConstructionsite); |
3184 | @@ -510,36 +510,36 @@ |
3185 | try { |
3186 | uint16_t const packet_version = fr.unsigned_16(); |
3187 | if (packet_version == kCurrentPacketVersionMilitarysite) { |
3188 | - militarysite.m_normal_soldier_request.reset(); |
3189 | + militarysite.normal_soldier_request_.reset(); |
3190 | |
3191 | if (fr.unsigned_8()) { |
3192 | - militarysite.m_normal_soldier_request.reset |
3193 | + militarysite.normal_soldier_request_.reset |
3194 | (new Request |
3195 | (militarysite, |
3196 | 0, |
3197 | MilitarySite::request_soldier_callback, |
3198 | wwWORKER)); |
3199 | - militarysite.m_normal_soldier_request->read(fr, game, mol); |
3200 | + militarysite.normal_soldier_request_->read(fr, game, mol); |
3201 | } |
3202 | else |
3203 | - militarysite.m_normal_soldier_request.reset(); |
3204 | + militarysite.normal_soldier_request_.reset(); |
3205 | |
3206 | if (fr.unsigned_8()) |
3207 | { |
3208 | - militarysite.m_upgrade_soldier_request.reset |
3209 | + militarysite.upgrade_soldier_request_.reset |
3210 | (new Request |
3211 | (militarysite, |
3212 | - (!militarysite.m_normal_soldier_request) ? 0 |
3213 | + (!militarysite.normal_soldier_request_) ? 0 |
3214 | : militarysite.owner().tribe().soldier(), |
3215 | MilitarySite::request_soldier_callback, |
3216 | wwWORKER)); |
3217 | - militarysite.m_upgrade_soldier_request->read(fr, game, mol); |
3218 | + militarysite.upgrade_soldier_request_->read(fr, game, mol); |
3219 | } |
3220 | else |
3221 | - militarysite.m_upgrade_soldier_request.reset(); |
3222 | - |
3223 | - |
3224 | - if ((militarysite.m_didconquer = fr.unsigned_8())) { |
3225 | + militarysite.upgrade_soldier_request_.reset(); |
3226 | + |
3227 | + |
3228 | + if ((militarysite.didconquer_ = fr.unsigned_8())) { |
3229 | // Add to map of military influence. |
3230 | const Map & map = game.map(); |
3231 | Area<FCoords> a |
3232 | @@ -557,16 +557,16 @@ |
3233 | } |
3234 | |
3235 | // capacity (modified by user) |
3236 | - militarysite.m_capacity = fr.unsigned_8(); |
3237 | - militarysite.m_nexthealtime = fr.signed_32(); |
3238 | + militarysite.capacity_ = fr.unsigned_8(); |
3239 | + militarysite.nexthealtime_ = fr.signed_32(); |
3240 | |
3241 | uint16_t reqmin = fr.unsigned_16(); |
3242 | uint16_t reqmax = fr.unsigned_16(); |
3243 | - militarysite.m_soldier_upgrade_requirements = RequireAttribute(atrTotal, reqmin, reqmax); |
3244 | - militarysite.m_soldier_preference = static_cast<MilitarySite::SoldierPreference>(fr.unsigned_8()); |
3245 | - militarysite.m_next_swap_soldiers_time = fr.signed_32(); |
3246 | - militarysite.m_soldier_upgrade_try = 0 != fr.unsigned_8() ? true : false; |
3247 | - militarysite.m_doing_upgrade_request = 0 != fr.unsigned_8() ? true : false; |
3248 | + militarysite.soldier_upgrade_requirements_ = RequireAttribute(atrTotal, reqmin, reqmax); |
3249 | + militarysite.soldier_preference_ = static_cast<MilitarySite::SoldierPreference>(fr.unsigned_8()); |
3250 | + militarysite.next_swap_soldiers_time_ = fr.signed_32(); |
3251 | + militarysite.soldier_upgrade_try_ = 0 != fr.unsigned_8() ? true : false; |
3252 | + militarysite.doing_upgrade_request_ = 0 != fr.unsigned_8() ? true : false; |
3253 | |
3254 | } else { |
3255 | throw UnhandledVersionError("MapBuildingdataPacket - Militarysite", |
3256 | @@ -582,22 +582,22 @@ |
3257 | // Cmd_ChangeSoldierCapacity to the beginning of the game's command |
3258 | // queue. But that would not work because the command queue is not read |
3259 | // yet and will be cleared before it is read. |
3260 | - if (militarysite.m_capacity < militarysite.min_soldier_capacity()) { |
3261 | + if (militarysite.capacity_ < militarysite.min_soldier_capacity()) { |
3262 | log |
3263 | ("WARNING: militarysite %u of player %u at (%i, %i) has capacity " |
3264 | "set to %u but it must be at least %u. Changing to that value.\n", |
3265 | militarysite.serial(), militarysite.owner().player_number(), |
3266 | militarysite.get_position().x, militarysite.get_position().y, |
3267 | - militarysite.m_capacity, militarysite.min_soldier_capacity()); |
3268 | - militarysite.m_capacity = militarysite.min_soldier_capacity(); |
3269 | - } else if (militarysite.max_soldier_capacity() < militarysite.m_capacity) { |
3270 | + militarysite.capacity_, militarysite.min_soldier_capacity()); |
3271 | + militarysite.capacity_ = militarysite.min_soldier_capacity(); |
3272 | + } else if (militarysite.max_soldier_capacity() < militarysite.capacity_) { |
3273 | log |
3274 | ("WARNING: militarysite %u of player %u at (%i, %i) has capacity " |
3275 | "set to %u but it can be at most %u. Changing to that value.\n", |
3276 | militarysite.serial(), militarysite.owner().player_number(), |
3277 | militarysite.get_position().x, militarysite.get_position().y, |
3278 | - militarysite.m_capacity, militarysite.max_soldier_capacity()); |
3279 | - militarysite.m_capacity = militarysite.max_soldier_capacity(); |
3280 | + militarysite.capacity_, militarysite.max_soldier_capacity()); |
3281 | + militarysite.capacity_ = militarysite.max_soldier_capacity(); |
3282 | } |
3283 | } catch (const WException & e) { |
3284 | throw GameDataError("militarysite: %s", e.what()); |
3285 | @@ -898,16 +898,16 @@ |
3286 | // player immovable owner is already in existence packet |
3287 | |
3288 | // write the general stuff |
3289 | - if (building->m_anim) { |
3290 | + if (building->anim_) { |
3291 | fw.unsigned_8(1); |
3292 | - fw.string(building->descr().get_animation_name(building->m_anim)); |
3293 | + fw.string(building->descr().get_animation_name(building->anim_)); |
3294 | } else |
3295 | fw.unsigned_8(0); |
3296 | |
3297 | - fw.unsigned_32(building->m_animstart); |
3298 | + fw.unsigned_32(building->animstart_); |
3299 | |
3300 | { |
3301 | - const Building::LeaveQueue & leave_queue = building->m_leave_queue; |
3302 | + const Building::LeaveQueue & leave_queue = building->leave_queue_; |
3303 | fw.unsigned_16(leave_queue.size()); |
3304 | for (const OPtr<Worker >& temp_queue: leave_queue) { |
3305 | assert(mos.is_object_known(*temp_queue.get(egbase))); |
3306 | @@ -915,8 +915,8 @@ |
3307 | (mos.get_object_file_index(*temp_queue.get(egbase))); |
3308 | } |
3309 | } |
3310 | - fw.unsigned_32(building->m_leave_time); |
3311 | - if (MapObject const * const o = building->m_leave_allow.get(egbase)) |
3312 | + fw.unsigned_32(building->leave_time_); |
3313 | + if (MapObject const * const o = building->leave_allow_.get(egbase)) |
3314 | { |
3315 | assert(mos.is_object_known(*o)); |
3316 | fw.unsigned_32(mos.get_object_file_index(*o)); |
3317 | @@ -925,7 +925,7 @@ |
3318 | } |
3319 | { |
3320 | const TribeDescr& td = building->owner().tribe(); |
3321 | - for (DescriptionIndex b_idx : building->m_old_buildings) { |
3322 | + for (DescriptionIndex b_idx : building->old_buildings_) { |
3323 | const BuildingDescr* b_descr = td.get_building_descr(b_idx); |
3324 | fw.unsigned_8(1); |
3325 | fw.string(b_descr->name()); |
3326 | @@ -976,31 +976,31 @@ |
3327 | fw.unsigned_16(kCurrentPacketPFBuilding); |
3328 | |
3329 | // descriptions |
3330 | - fw.string(pfb.m_building->name()); |
3331 | + fw.string(pfb.building_->name()); |
3332 | |
3333 | // builder request |
3334 | - if (pfb.m_builder_request) { |
3335 | + if (pfb.builder_request_) { |
3336 | fw.unsigned_8(1); |
3337 | - pfb.m_builder_request->write(fw, game, mos); |
3338 | + pfb.builder_request_->write(fw, game, mos); |
3339 | } else |
3340 | fw.unsigned_8(0); |
3341 | |
3342 | // builder |
3343 | - if (Worker const * builder = pfb.m_builder.get(game)) { |
3344 | + if (Worker const * builder = pfb.builder_.get(game)) { |
3345 | assert(mos.is_object_known(*builder)); |
3346 | fw.unsigned_32(mos.get_object_file_index(*builder)); |
3347 | } else |
3348 | fw.unsigned_32(0); |
3349 | |
3350 | - const uint16_t wares_size = pfb.m_wares.size(); |
3351 | + const uint16_t wares_size = pfb.wares_.size(); |
3352 | fw.unsigned_16(wares_size); |
3353 | for (uint16_t i = 0; i < wares_size; ++i) |
3354 | - pfb.m_wares[i]->write(fw, game, mos); |
3355 | + pfb.wares_[i]->write(fw, game, mos); |
3356 | |
3357 | - fw.unsigned_8 (pfb.m_working); |
3358 | - fw.unsigned_32(pfb.m_work_steptime); |
3359 | - fw.unsigned_32(pfb.m_work_completed); |
3360 | - fw.unsigned_32(pfb.m_work_steps); |
3361 | + fw.unsigned_8 (pfb.working_); |
3362 | + fw.unsigned_32(pfb.work_steptime_); |
3363 | + fw.unsigned_32(pfb.work_completed_); |
3364 | + fw.unsigned_32(pfb.work_steps_); |
3365 | } |
3366 | |
3367 | void MapBuildingdataPacket::write_constructionsite |
3368 | @@ -1014,7 +1014,7 @@ |
3369 | |
3370 | write_partially_finished_building(constructionsite, fw, game, mos); |
3371 | |
3372 | - fw.signed_32(constructionsite.m_fetchfromflag); |
3373 | + fw.signed_32(constructionsite.fetchfromflag_); |
3374 | } |
3375 | |
3376 | void MapBuildingdataPacket::write_dismantlesite |
3377 | @@ -1134,40 +1134,40 @@ |
3378 | { |
3379 | fw.unsigned_16(kCurrentPacketVersionMilitarysite); |
3380 | |
3381 | - if (militarysite.m_normal_soldier_request) { |
3382 | + if (militarysite.normal_soldier_request_) { |
3383 | fw.unsigned_8(1); |
3384 | - militarysite.m_normal_soldier_request->write(fw, game, mos); |
3385 | + militarysite.normal_soldier_request_->write(fw, game, mos); |
3386 | } else { |
3387 | fw.unsigned_8(0); |
3388 | } |
3389 | |
3390 | - if (militarysite.m_upgrade_soldier_request) |
3391 | + if (militarysite.upgrade_soldier_request_) |
3392 | { |
3393 | fw.unsigned_8(1); |
3394 | - militarysite.m_upgrade_soldier_request->write(fw, game, mos); |
3395 | + militarysite.upgrade_soldier_request_->write(fw, game, mos); |
3396 | } |
3397 | else |
3398 | fw.unsigned_8(0); |
3399 | |
3400 | |
3401 | - fw.unsigned_8(militarysite.m_didconquer); |
3402 | - fw.unsigned_8(militarysite.m_capacity); |
3403 | - fw.signed_32(militarysite.m_nexthealtime); |
3404 | + fw.unsigned_8(militarysite.didconquer_); |
3405 | + fw.unsigned_8(militarysite.capacity_); |
3406 | + fw.signed_32(militarysite.nexthealtime_); |
3407 | |
3408 | - if (militarysite.m_normal_soldier_request) |
3409 | + if (militarysite.normal_soldier_request_) |
3410 | { |
3411 | - if (militarysite.m_upgrade_soldier_request) |
3412 | + if (militarysite.upgrade_soldier_request_) |
3413 | { |
3414 | throw GameDataError |
3415 | ("Internal error in a MilitarySite -- cannot continue. Use previous autosave."); |
3416 | } |
3417 | } |
3418 | - fw.unsigned_16(militarysite.m_soldier_upgrade_requirements.get_min()); |
3419 | - fw.unsigned_16(militarysite.m_soldier_upgrade_requirements.get_max()); |
3420 | - fw.unsigned_8(militarysite.m_soldier_preference); |
3421 | - fw.signed_32(militarysite.m_next_swap_soldiers_time); |
3422 | - fw.unsigned_8(militarysite.m_soldier_upgrade_try ? 1 : 0); |
3423 | - fw.unsigned_8(militarysite.m_doing_upgrade_request ? 1 : 0); |
3424 | + fw.unsigned_16(militarysite.soldier_upgrade_requirements_.get_min()); |
3425 | + fw.unsigned_16(militarysite.soldier_upgrade_requirements_.get_max()); |
3426 | + fw.unsigned_8(militarysite.soldier_preference_); |
3427 | + fw.signed_32(militarysite.next_swap_soldiers_time_); |
3428 | + fw.unsigned_8(militarysite.soldier_upgrade_try_ ? 1 : 0); |
3429 | + fw.unsigned_8(militarysite.doing_upgrade_request_ ? 1 : 0); |
3430 | |
3431 | } |
3432 | |
3433 | |
3434 | === modified file 'src/scripting/lua_map.cc' |
3435 | --- src/scripting/lua_map.cc 2016-01-31 15:31:00 +0000 |
3436 | +++ src/scripting/lua_map.cc 2016-02-08 18:17:36 +0000 |
3437 | @@ -1638,7 +1638,7 @@ |
3438 | (RO) the workarea_radius of the building as an int. |
3439 | */ |
3440 | int LuaBuildingDescription::get_workarea_radius(lua_State * L) { |
3441 | - lua_pushinteger(L, get()->m_workarea_info.begin()->first); |
3442 | + lua_pushinteger(L, get()->workarea_info_.begin()->first); |
3443 | return 1; |
3444 | } |
3445 | |
3446 | |
3447 | === modified file 'src/wui/building_ui.cc' |
3448 | --- src/wui/building_ui.cc 2015-11-28 22:29:26 +0000 |
3449 | +++ src/wui/building_ui.cc 2016-02-08 18:17:36 +0000 |
3450 | @@ -33,21 +33,21 @@ |
3451 | */ |
3452 | void Building::show_options(InteractiveGameBase & igbase, bool avoid_fastclick, Point pos) |
3453 | { |
3454 | - if (m_optionswindow) { |
3455 | - if (m_optionswindow->is_minimal()) |
3456 | - m_optionswindow->restore(); |
3457 | - m_optionswindow->move_to_top(); |
3458 | + if (optionswindow_) { |
3459 | + if (optionswindow_->is_minimal()) |
3460 | + optionswindow_->restore(); |
3461 | + optionswindow_->move_to_top(); |
3462 | } else { |
3463 | - create_options_window(igbase, m_optionswindow); |
3464 | - if (upcast(BuildingWindow, bw, m_optionswindow)) { |
3465 | + create_options_window(igbase, optionswindow_); |
3466 | + if (upcast(BuildingWindow, bw, optionswindow_)) { |
3467 | bw->set_avoid_fastclick(avoid_fastclick); |
3468 | } |
3469 | // Run a first think here so that certain things like caps buttons |
3470 | // get properly initialized |
3471 | - m_optionswindow->think(); |
3472 | + optionswindow_->think(); |
3473 | } |
3474 | if (pos.x >= 0 && pos.y >= 0) { |
3475 | - m_optionswindow->set_pos(pos); |
3476 | + optionswindow_->set_pos(pos); |
3477 | } |
3478 | } |
3479 | |
3480 | @@ -58,8 +58,8 @@ |
3481 | { |
3482 | for (boost::signals2::connection& c : options_window_connections) |
3483 | c.disconnect(); |
3484 | - delete m_optionswindow; |
3485 | - m_optionswindow = nullptr; |
3486 | + delete optionswindow_; |
3487 | + optionswindow_ = nullptr; |
3488 | } |
3489 | |
3490 | /** |
3491 | @@ -67,10 +67,10 @@ |
3492 | */ |
3493 | void Building::refresh_options(InteractiveGameBase & igb) { |
3494 | // Only do something if there is actually a window |
3495 | - if (m_optionswindow) { |
3496 | - Point window_position = m_optionswindow->get_pos(); |
3497 | + if (optionswindow_) { |
3498 | + Point window_position = optionswindow_->get_pos(); |
3499 | hide_options(); |
3500 | show_options(igb, true); |
3501 | - m_optionswindow->set_pos(window_position); |
3502 | + optionswindow_->set_pos(window_position); |
3503 | } |
3504 | } |
3505 | |
3506 | === modified file 'src/wui/buildingwindow.cc' |
3507 | --- src/wui/buildingwindow.cc 2016-01-29 08:37:22 +0000 |
3508 | +++ src/wui/buildingwindow.cc 2016-02-08 18:17:36 +0000 |
3509 | @@ -304,9 +304,9 @@ |
3510 | if (can_see) { |
3511 | WorkareaInfo wa_info; |
3512 | if (upcast(Widelands::ConstructionSite, csite, &building_)) { |
3513 | - wa_info = csite->building().m_workarea_info; |
3514 | + wa_info = csite->building().workarea_info_; |
3515 | } else { |
3516 | - wa_info = building_.descr().m_workarea_info; |
3517 | + wa_info = building_.descr().workarea_info_; |
3518 | } |
3519 | if (!wa_info.empty()) { |
3520 | toggle_workarea_ = new UI::Button |
3521 | @@ -471,9 +471,9 @@ |
3522 | } |
3523 | WorkareaInfo workarea_info; |
3524 | if (upcast(Widelands::ConstructionSite, csite, &building_)) { |
3525 | - workarea_info = csite->building().m_workarea_info; |
3526 | + workarea_info = csite->building().workarea_info_; |
3527 | } else { |
3528 | - workarea_info = building_.descr().m_workarea_info; |
3529 | + workarea_info = building_.descr().workarea_info_; |
3530 | } |
3531 | if (workarea_info.empty()) { |
3532 | return; |
3533 | |
3534 | === modified file 'src/wui/fieldaction.cc' |
3535 | --- src/wui/fieldaction.cc 2016-01-29 08:37:22 +0000 |
3536 | +++ src/wui/fieldaction.cc 2016-02-08 18:17:36 +0000 |
3537 | @@ -821,7 +821,7 @@ |
3538 | { |
3539 | if (ibase().show_workarea_preview_ && !m_workarea_preview_overlay_id) { |
3540 | const WorkareaInfo& workarea_info = |
3541 | - m_plr->tribe().get_building_descr(Widelands::DescriptionIndex(idx))->m_workarea_info; |
3542 | + m_plr->tribe().get_building_descr(Widelands::DescriptionIndex(idx))->workarea_info_; |
3543 | m_workarea_preview_overlay_id = ibase().show_work_area(workarea_info, m_node); |
3544 | } |
3545 | } |
3546 | |
3547 | === modified file 'src/wui/soldiercapacitycontrol.cc' |
3548 | --- src/wui/soldiercapacitycontrol.cc 2016-01-29 08:37:22 +0000 |
3549 | +++ src/wui/soldiercapacitycontrol.cc 2016-02-08 18:17:36 +0000 |
3550 | @@ -46,7 +46,7 @@ |
3551 | void click_increase(); |
3552 | |
3553 | InteractiveGameBase & m_igb; |
3554 | - Widelands::Building & m_building; |
3555 | + Widelands::Building & building_; |
3556 | |
3557 | UI::Button m_decrease; |
3558 | UI::Button m_increase; |
3559 | @@ -59,7 +59,7 @@ |
3560 | : |
3561 | Box(parent, 0, 0, Horizontal), |
3562 | m_igb(igb), |
3563 | -m_building(building), |
3564 | +building_(building), |
3565 | m_decrease |
3566 | (this, "decrease", 0, 0, 32, 32, |
3567 | g_gr->images().get("images/ui_basic/but4.png"), |
3568 | @@ -86,21 +86,21 @@ |
3569 | |
3570 | void SoldierCapacityControl::think() |
3571 | { |
3572 | - SoldierControl * soldiers = dynamic_cast<SoldierControl *>(&m_building); |
3573 | + SoldierControl * soldiers = dynamic_cast<SoldierControl *>(&building_); |
3574 | uint32_t const capacity = soldiers->soldier_capacity(); |
3575 | char buffer[sizeof("4294967295")]; |
3576 | |
3577 | sprintf(buffer, "%2u", capacity); |
3578 | m_value.set_text(buffer); |
3579 | |
3580 | - bool const can_act = m_igb.can_act(m_building.owner().player_number()); |
3581 | + bool const can_act = m_igb.can_act(building_.owner().player_number()); |
3582 | m_decrease.set_enabled(can_act && soldiers->min_soldier_capacity() < capacity); |
3583 | m_increase.set_enabled(can_act && soldiers->max_soldier_capacity() > capacity); |
3584 | } |
3585 | |
3586 | void SoldierCapacityControl::change_soldier_capacity(int delta) |
3587 | { |
3588 | - m_igb.game().send_player_change_soldier_capacity(m_building, delta); |
3589 | + m_igb.game().send_player_change_soldier_capacity(building_, delta); |
3590 | } |
3591 | |
3592 | void SoldierCapacityControl::click_decrease() |
3593 | |
3594 | === modified file 'src/wui/soldierlist.cc' |
3595 | --- src/wui/soldierlist.cc 2016-01-31 21:03:15 +0000 |
3596 | +++ src/wui/soldierlist.cc 2016-02-08 18:17:36 +0000 |
3597 | @@ -371,7 +371,7 @@ |
3598 | void think() override; |
3599 | |
3600 | InteractiveGameBase & m_igb; |
3601 | - Widelands::Building & m_building; |
3602 | + Widelands::Building & building_; |
3603 | SoldierPanel m_soldierpanel; |
3604 | UI::Radiogroup m_soldier_preference; |
3605 | UI::Textarea m_infotext; |
3606 | @@ -385,7 +385,7 @@ |
3607 | UI::Box(&parent, 0, 0, UI::Box::Vertical), |
3608 | |
3609 | m_igb(igb), |
3610 | -m_building(building), |
3611 | +building_(building), |
3612 | m_soldierpanel(*this, igb.egbase(), building), |
3613 | m_infotext(this, _("Click soldier to send away")) |
3614 | { |
3615 | @@ -413,7 +413,7 @@ |
3616 | |
3617 | UI::Box * buttons = new UI::Box(this, 0, 0, UI::Box::Horizontal); |
3618 | |
3619 | - bool can_act = m_igb.can_act(m_building.owner().player_number()); |
3620 | + bool can_act = m_igb.can_act(building_.owner().player_number()); |
3621 | if (upcast(Widelands::MilitarySite, ms, &building)) { |
3622 | m_soldier_preference.add_button |
3623 | (buttons, Point(0, 0), |
3624 | @@ -450,16 +450,16 @@ |
3625 | |
3626 | SoldierControl & SoldierList::soldiers() const |
3627 | { |
3628 | - return *dynamic_cast<SoldierControl *>(&m_building); |
3629 | + return *dynamic_cast<SoldierControl *>(&building_); |
3630 | } |
3631 | |
3632 | void SoldierList::think() |
3633 | { |
3634 | // Only update the soldiers pref radio if player is spectator |
3635 | - if (m_igb.can_act(m_building.owner().player_number())) { |
3636 | + if (m_igb.can_act(building_.owner().player_number())) { |
3637 | return; |
3638 | } |
3639 | - if (upcast(Widelands::MilitarySite, ms, &m_building)) { |
3640 | + if (upcast(Widelands::MilitarySite, ms, &building_)) { |
3641 | switch (ms->get_soldier_preference()) { |
3642 | case Widelands::MilitarySite::kPrefersRookies: |
3643 | m_soldier_preference.set_state(0); |
3644 | @@ -495,20 +495,20 @@ |
3645 | void SoldierList::eject(const Soldier * soldier) |
3646 | { |
3647 | uint32_t const capacity_min = soldiers().min_soldier_capacity(); |
3648 | - bool can_act = m_igb.can_act(m_building.owner().player_number()); |
3649 | + bool can_act = m_igb.can_act(building_.owner().player_number()); |
3650 | bool over_min = capacity_min < soldiers().present_soldiers().size(); |
3651 | |
3652 | if (can_act && over_min) |
3653 | - m_igb.game().send_player_drop_soldier(m_building, soldier->serial()); |
3654 | + m_igb.game().send_player_drop_soldier(building_, soldier->serial()); |
3655 | } |
3656 | |
3657 | void SoldierList::set_soldier_preference(int32_t changed_to) { |
3658 | #ifndef NDEBUG |
3659 | - upcast(Widelands::MilitarySite, ms, &m_building); |
3660 | + upcast(Widelands::MilitarySite, ms, &building_); |
3661 | assert(ms); |
3662 | #endif |
3663 | m_igb.game().send_player_militarysite_set_soldier_preference |
3664 | - (m_building, changed_to == 0 ? |
3665 | + (building_, changed_to == 0 ? |
3666 | Widelands::MilitarySite::kPrefersRookies: |
3667 | Widelands::MilitarySite::kPrefersHeroes); |
3668 | } |
Continuous integration builds have changed state:
Travis build 638. State: passed. Details: https:/ /travis- ci.org/ widelands/ widelands/ builds/ 107834812. /ci.appveyor. com/project/ widelands- dev/widelands/ build/_ widelands_ dev_widelands_ bug_1395278_ tribes_ a_p-494.
Appveyor build 494. State: failed. Details: https:/