Files
OpenRCT2-Web/src/openrct2/ride/TrainManager.cpp
T

37 lines
1.0 KiB
C++
Raw Normal View History

/*****************************************************************************
* 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"
#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())
{
Entity = nullptr;
}
}
return *this;
}
View::View()
{
2021-03-16 11:18:06 +00:00
vec = &GetEntityList(EntityType::Vehicle);
}
} // namespace TrainManager