2021-03-15 08:13:00 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
|
* Copyright (c) 2014-2021 OpenRCT2 developers
|
|
|
|
|
*
|
|
|
|
|
* For a complete list of all authors, please refer to contributors.md
|
|
|
|
|
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
|
|
|
|
*
|
|
|
|
|
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "TrainManager.h"
|
|
|
|
|
|
2021-11-24 17:19:52 +02:00
|
|
|
#include "../entity/EntityList.h"
|
2021-11-26 16:49:52 +02:00
|
|
|
#include "../entity/EntityRegistry.h"
|
2021-03-15 08:13:00 +00:00
|
|
|
#include "Vehicle.h"
|
|
|
|
|
|
|
|
|
|
namespace TrainManager
|
|
|
|
|
{
|
|
|
|
|
View::Iterator& View::Iterator::operator++()
|
|
|
|
|
{
|
|
|
|
|
Entity = nullptr;
|
|
|
|
|
|
|
|
|
|
while (iter != end && Entity == nullptr)
|
|
|
|
|
{
|
|
|
|
|
Entity = GetEntity<Vehicle>(*iter++);
|
2021-09-24 20:05:50 +02:00
|
|
|
if (Entity != nullptr && !Entity->IsHead())
|
2021-03-15 08:13:00 +00:00
|
|
|
{
|
|
|
|
|
Entity = nullptr;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
View::View()
|
|
|
|
|
{
|
2021-03-16 11:18:06 +00:00
|
|
|
vec = &GetEntityList(EntityType::Vehicle);
|
2021-03-15 08:13:00 +00:00
|
|
|
}
|
|
|
|
|
} // namespace TrainManager
|