MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / getVehicleTotalLength

Method getVehicleTotalLength

src/OpenLoco/src/Vehicles/VehicleHead.cpp:780–789  ·  view source on GitHub ↗

0x004B97B7

Source from the content-addressed store, hash-verified

778
779 // 0x004B97B7
780 uint32_t VehicleHead::getVehicleTotalLength() const
781 {
782 auto totalLength = 0;
783 Vehicle train(head);
784 for (const auto& car : train.cars)
785 {
786 totalLength += car.body->getObject()->getLength();
787 }
788 return totalLength;
789 }
790
791 uint32_t VehicleHead::getCarCount() const
792 {

Callers 1

drawFunction · 0.80

Calls 2

getLengthMethod · 0.45
getObjectMethod · 0.45

Tested by

no test coverage detected