summaryrefslogtreecommitdiff
path: root/src/cargopacket.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-02-17 14:59:27 +0000
committerrubidium <rubidium@openttd.org>2013-02-17 14:59:27 +0000
commit4367224b35d849ebe0079e7aea0b3939399f5ffd (patch)
treeb428bf54d643a37f238705390c72786ca9f91718 /src/cargopacket.h
parentcdb0a7695820ac088df6736cb59ac9989f945c8e (diff)
downloadopenttd-4367224b35d849ebe0079e7aea0b3939399f5ffd.tar.xz
(svn r25013) -Feature: show the amount of cargo that has already been reserved by full loading vehicles in the station (fonsinchen)
Diffstat (limited to 'src/cargopacket.h')
-rw-r--r--src/cargopacket.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/cargopacket.h b/src/cargopacket.h
index 130848d35..bffc845ea 100644
--- a/src/cargopacket.h
+++ b/src/cargopacket.h
@@ -445,6 +445,25 @@ public:
friend class CargoReservation;
friend class CargoReturn;
+ /**
+ * Returns sum of cargo reserved for loading onto vehicles.
+ * @return Cargo reserved for loading.
+ */
+ inline uint ReservedCount() const
+ {
+ return this->reserved_count;
+ }
+
+ /**
+ * Returns total count of cargo, including reserved cargo that's not
+ * actually in the list.
+ * @return Total cargo count.
+ */
+ inline uint TotalCount() const
+ {
+ return this->count + this->reserved_count;
+ }
+
void Append(CargoPacket *cp);
/* Methods for moving cargo around. First parameter is always maximum