diff options
Diffstat (limited to 'src/ai/api/ai_enginelist.cpp')
-rw-r--r-- | src/ai/api/ai_enginelist.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ai/api/ai_enginelist.cpp b/src/ai/api/ai_enginelist.cpp new file mode 100644 index 000000000..bd57025f6 --- /dev/null +++ b/src/ai/api/ai_enginelist.cpp @@ -0,0 +1,16 @@ +/* $Id$ */ + +/** @file ai_enginelist.cpp Implementation of AIEngineList and friends. */ + +#include "ai_enginelist.hpp" +#include "../../company_func.h" +#include "../../engine_base.h" +#include "../../core/bitmath_func.hpp" + +AIEngineList::AIEngineList(AIVehicle::VehicleType vehicle_type) +{ + Engine *e; + FOR_ALL_ENGINES_OF_TYPE(e, (::VehicleType)vehicle_type) { + if (HasBit(e->company_avail, _current_company)) this->AddItem(e->index); + } +} |