Merge lp:~borim/widelands/bug1022267 into lp:widelands

Proposed by Borim on 2012-07-09
Status: Merged
Merged at revision: 6415
Proposed branch: lp:~borim/widelands/bug1022267
Merge into: lp:widelands
Diff against target: 46 lines (+12/-5)
2 files modified
src/economy/economy.h (+10/-3)
src/logic/player.cc (+2/-2)
To merge this branch: bzr merge lp:~borim/widelands/bug1022267
Reviewer Review Type Date Requested Status
Widelands Developers 2012-07-09 Pending
Review via email: mp+114014@code.launchpad.net

Description of the change

* change ware counting for the stock over time chart (only consider wares inside of warehouses)
* improve doc of the economy class

To post a comment you must log in.
SirVer (sirver) wrote :

Merged! Thanks Borim.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/economy/economy.h'
2--- src/economy/economy.h 2012-02-15 21:25:34 +0000
3+++ src/economy/economy.h 2012-07-09 17:32:34 +0000
4@@ -31,9 +31,6 @@
5 #include "logic/wareworker.h"
6
7
8-/**
9- * Economy represents a network of Flag through which wares can be transported.
10- */
11 namespace Widelands {
12 struct Player;
13 struct Game;
14@@ -45,6 +42,16 @@
15 struct Supply;
16 struct Router;
17
18+/**
19+ * Each Economy represents all building and flags, which are connected over the same
20+ * street network. In general a player can own multiple Economys, which
21+ * operate independent from each other.
22+ * During the game Economy objects can be merged or splitted due to
23+ * new roads or destroyed ones.
24+ *
25+ * Every Economy tracks the amount of wares inside of it and how high the
26+ * demand for each ware is.
27+ */
28 struct Economy {
29 friend class EconomyDataPacket;
30
31
32=== modified file 'src/logic/player.cc'
33--- src/logic/player.cc 2012-07-07 17:09:03 +0000
34+++ src/logic/player.cc 2012-07-09 17:32:34 +0000
35@@ -1075,9 +1075,9 @@
36 it != warehouses.end();
37 ++it)
38 {
39+ Widelands::WareList const & wares = (*it)->get_wares();
40 for (uint32_t id = 0; id < stocks.size(); ++id) {
41- stocks[id] += (*it)->get_economy()->stock_ware
42- (Ware_Index(static_cast<size_t>(id)));
43+ stocks[id] += wares.stock(Ware_Index(static_cast<size_t>(id)));
44 }
45 }
46 }

Subscribers

People subscribed via source and target branches

to status/vote changes: