Remove unused Vehicle capacity methods
Remove unused methods Vehicle::GetConsistFreeCapacities and Vehicle::GetConsistTotalCapacity. (cherry picked from commit d97442878f9856c253a3bf976b6a3e114faebefe)
This commit is contained in:

committed by
Jonathan G Rennison

parent
25bd3ed6f4
commit
ca98e78c69
@@ -2663,34 +2663,6 @@ void Vehicle::HandleWaiting(bool stop_waiting)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a map of cargoes and free capacities in the consist.
|
|
||||||
* @param capacities Map to be filled with cargoes and capacities.
|
|
||||||
*/
|
|
||||||
void Vehicle::GetConsistFreeCapacities(SmallMap<CargoID, uint> &capacities) const
|
|
||||||
{
|
|
||||||
for (const Vehicle *v = this; v != NULL; v = v->Next()) {
|
|
||||||
if (v->cargo_cap == 0) continue;
|
|
||||||
SmallPair<CargoID, uint> *pair = capacities.Find(v->cargo_type);
|
|
||||||
if (pair == capacities.End()) {
|
|
||||||
pair = capacities.Append();
|
|
||||||
pair->first = v->cargo_type;
|
|
||||||
pair->second = v->cargo_cap - v->cargo.StoredCount();
|
|
||||||
} else {
|
|
||||||
pair->second += v->cargo_cap - v->cargo.StoredCount();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
uint Vehicle::GetConsistTotalCapacity() const
|
|
||||||
{
|
|
||||||
uint result = 0;
|
|
||||||
for (const Vehicle *v = this; v != NULL; v = v->Next()) {
|
|
||||||
result += v->cargo_cap;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send this vehicle to the depot using the given command(s).
|
* Send this vehicle to the depot using the given command(s).
|
||||||
* @param flags the command flags (like execute and such).
|
* @param flags the command flags (like execute and such).
|
||||||
|
@@ -318,10 +318,6 @@ public:
|
|||||||
|
|
||||||
void HandleWaiting(bool stop_waiting = false);
|
void HandleWaiting(bool stop_waiting = false);
|
||||||
|
|
||||||
void GetConsistFreeCapacities(SmallMap<CargoID, uint> &capacities) const;
|
|
||||||
|
|
||||||
uint GetConsistTotalCapacity() const;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Marks the vehicles to be redrawn and updates cached variables
|
* Marks the vehicles to be redrawn and updates cached variables
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user