Merge lp:~widelands-dev/widelands/bug-1395278-world into lp:widelands

Proposed by GunChleoc
Status: Merged
Merged at revision: 7810
Proposed branch: lp:~widelands-dev/widelands/bug-1395278-world
Merge into: lp:widelands
Diff against target: 106 lines (+16/-16)
3 files modified
src/logic/map_objects/world/critter.cc (+6/-6)
src/logic/map_objects/world/critter.h (+3/-3)
src/logic/map_objects/world/critter_program.h (+7/-7)
To merge this branch: bzr merge lp:~widelands-dev/widelands/bug-1395278-world
Reviewer Review Type Date Requested Status
SirVer Approve
Review via email: mp+285386@code.launchpad.net

Commit message

Refactored member variable names in src/logic/map_objects/world.

Description of the change

Refactored member variable names in src/logic/map_objects/world.

To post a comment you must log in.
Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 637. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/107827192.
Appveyor build 493. State: failed. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1395278_world-493.

Revision history for this message
SirVer (sirver) wrote :

@bunnybot merge

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/logic/map_objects/world/critter.cc'
2--- src/logic/map_objects/world/critter.cc 2016-02-02 12:38:05 +0000
3+++ src/logic/map_objects/world/critter.cc 2016-02-08 17:36:44 +0000
4@@ -59,7 +59,7 @@
5 throw wexception("unknown command type \"%s\"", cmd[0].c_str());
6 }
7
8- m_actions.push_back(act);
9+ actions_.push_back(act);
10 }
11 catch (const std::exception& e) {
12 throw wexception("Line '%s': %s", line.c_str(), e.what());
13@@ -105,7 +105,7 @@
14 CritterDescr::CritterDescr(const std::string& init_descname, const LuaTable& table)
15 : BobDescr(init_descname, MapObjectType::CRITTER, MapObjectDescr::OwnerType::kWorld, table)
16 {
17- add_directional_animation(&m_walk_anims, "walk");
18+ add_directional_animation(&walk_anims_, "walk");
19
20 add_attributes(
21 table.get_table("attributes")->array_entries<std::string>(), std::set<uint32_t>());
22@@ -115,7 +115,7 @@
23 try {
24 std::unique_ptr<CritterProgram> prog(new CritterProgram(program_name));
25 prog->parse(programs->get_table(program_name)->array_entries<std::string>());
26- m_programs[program_name] = prog.release();
27+ programs_[program_name] = prog.release();
28 } catch (const std::exception& e) {
29 throw wexception("Parse error in program %s: %s", program_name.c_str(), e.what());
30 }
31@@ -123,7 +123,7 @@
32 }
33
34 CritterDescr::~CritterDescr() {
35- for (std::pair<std::string, CritterProgram *> program : m_programs) {
36+ for (std::pair<std::string, CritterProgram *> program : programs_) {
37 delete program.second;
38 }
39 }
40@@ -142,8 +142,8 @@
41 CritterProgram const * CritterDescr::get_program
42 (const std::string & programname) const
43 {
44- Programs::const_iterator const it = m_programs.find(programname);
45- if (it == m_programs.end())
46+ Programs::const_iterator const it = programs_.find(programname);
47+ if (it == programs_.end())
48 throw wexception
49 ("%s has no program '%s'", name().c_str(), programname.c_str());
50 return it->second;
51
52=== modified file 'src/logic/map_objects/world/critter.h'
53--- src/logic/map_objects/world/critter.h 2015-11-28 22:29:26 +0000
54+++ src/logic/map_objects/world/critter.h 2016-02-08 17:36:44 +0000
55@@ -43,15 +43,15 @@
56
57 bool is_swimming() const;
58 uint32_t movecaps() const override;
59- const DirAnimations & get_walk_anims() const {return m_walk_anims;}
60+ const DirAnimations& get_walk_anims() const {return walk_anims_;}
61
62 CritterProgram const * get_program(const std::string &) const;
63
64
65 private:
66- DirAnimations m_walk_anims;
67+ DirAnimations walk_anims_;
68 using Programs = std::map<std::string, CritterProgram *>;
69- Programs m_programs;
70+ Programs programs_;
71 DISALLOW_COPY_AND_ASSIGN(CritterDescr);
72 };
73
74
75=== modified file 'src/logic/map_objects/world/critter_program.h'
76--- src/logic/map_objects/world/critter_program.h 2015-11-28 22:29:26 +0000
77+++ src/logic/map_objects/world/critter_program.h 2016-02-08 17:36:44 +0000
78@@ -43,21 +43,21 @@
79 };
80
81 struct CritterProgram : public BobProgramBase {
82- CritterProgram(const std::string & name) : m_name(name) {}
83+ CritterProgram(const std::string & name) : name_(name) {}
84 virtual ~CritterProgram() {}
85
86- std::string get_name() const override {return m_name;}
87- int32_t get_size() const {return m_actions.size();}
88+ std::string get_name() const override {return name_;}
89+ int32_t get_size() const {return actions_.size();}
90 const CritterAction & operator[] (size_t const idx) const {
91- assert(idx < m_actions.size());
92- return m_actions[idx];
93+ assert(idx < actions_.size());
94+ return actions_[idx];
95 }
96
97 void parse(const std::vector<std::string>& lines);
98
99 private:
100- std::string m_name;
101- std::vector<CritterAction> m_actions;
102+ std::string name_;
103+ std::vector<CritterAction> actions_;
104 };
105
106 }

Subscribers

People subscribed via source and target branches

to status/vote changes: