rubidium@9820: /* $Id$ */ rubidium@9820: truebrain@9833: /** @file ai_bridgelist.cpp Implementation of AIBridgeList and friends. */ rubidium@9820: truebrain@9792: #include "ai_bridgelist.hpp" truebrain@10670: #include "ai_bridge.hpp" truebrain@10339: #include "../../openttd.h" truebrain@9792: #include "../../bridge.h" truebrain@9792: #include "../../date_func.h" truebrain@9792: truebrain@9792: AIBridgeList::AIBridgeList() truebrain@9792: { truebrain@9792: /* Add all bridges, no matter if they are available or not */ truebrain@9792: for (byte j = 0; j < MAX_BRIDGES; j++) truebrain@9792: if (::GetBridgeSpec(j)->avail_year <= _cur_year) truebrain@9792: this->AddItem(j); truebrain@9792: } truebrain@9792: truebrain@9792: AIBridgeList_Length::AIBridgeList_Length(uint length) truebrain@9792: { truebrain@9792: for (byte j = 0; j < MAX_BRIDGES; j++) truebrain@9792: if (::GetBridgeSpec(j)->avail_year <= _cur_year) truebrain@10670: if (length >= (uint)AIBridge::GetMinLength(j) && length <= (uint)AIBridge::GetMaxLength(j)) truebrain@9792: this->AddItem(j); truebrain@9792: }