comparison src/vehicle_base.h @ 11930:b17404281f58 draft

(svn r16333) -Cleanup: remove a bunch of unused wrapper functions.
author rubidium <rubidium@openttd.org>
date Sun, 17 May 2009 11:18:34 +0000
parents fccc9cea27a7
children 2286db6ac0bb
comparison
equal deleted inserted replaced
11929:12bd4fc18d95 11930:b17404281f58
640 640
641 const char *GetTypeString() const { return "invalid vehicle"; } 641 const char *GetTypeString() const { return "invalid vehicle"; }
642 void Tick() {} 642 void Tick() {}
643 }; 643 };
644 644
645 static inline VehicleID GetMaxVehicleIndex()
646 {
647 /* TODO - This isn't the real content of the function, but
648 * with the new pool-system this will be replaced with one that
649 * _really_ returns the highest index. Now it just returns
650 * the next safe value we are sure about everything is below.
651 */
652 return Vehicle::GetPoolSize() - 1;
653 }
654
655 static inline uint GetNumVehicles()
656 {
657 return Vehicle::GetPoolSize();
658 }
659
660 #define FOR_ALL_VEHICLES_FROM(v, start) for (v = Vehicle::Get(start); v != NULL; v = (v->index + 1U < Vehicle::GetPoolSize()) ? Vehicle::Get(v->index + 1) : NULL) if (v->IsValid()) 645 #define FOR_ALL_VEHICLES_FROM(v, start) for (v = Vehicle::Get(start); v != NULL; v = (v->index + 1U < Vehicle::GetPoolSize()) ? Vehicle::Get(v->index + 1) : NULL) if (v->IsValid())
661 #define FOR_ALL_VEHICLES(v) FOR_ALL_VEHICLES_FROM(v, 0) 646 #define FOR_ALL_VEHICLES(v) FOR_ALL_VEHICLES_FROM(v, 0)
662 647
663 648
664 /** Generates sequence of free UnitID numbers */ 649 /** Generates sequence of free UnitID numbers */