src/ai/api/ai_bridgelist.cpp
branchnoai
changeset 10670 a39c9d7c2562
parent 10339 ce6cd68d9eb8
equal deleted inserted replaced
10669:70a2d1f6f24b 10670:a39c9d7c2562
     1 /* $Id$ */
     1 /* $Id$ */
     2 
     2 
     3 /** @file ai_bridgelist.cpp Implementation of AIBridgeList and friends. */
     3 /** @file ai_bridgelist.cpp Implementation of AIBridgeList and friends. */
     4 
     4 
     5 #include "ai_bridgelist.hpp"
     5 #include "ai_bridgelist.hpp"
       
     6 #include "ai_bridge.hpp"
     6 #include "../../openttd.h"
     7 #include "../../openttd.h"
     7 #include "../../bridge.h"
     8 #include "../../bridge.h"
     8 #include "../../date_func.h"
     9 #include "../../date_func.h"
     9 
    10 
    10 AIBridgeList::AIBridgeList()
    11 AIBridgeList::AIBridgeList()
    17 
    18 
    18 AIBridgeList_Length::AIBridgeList_Length(uint length)
    19 AIBridgeList_Length::AIBridgeList_Length(uint length)
    19 {
    20 {
    20 	for (byte j = 0; j < MAX_BRIDGES; j++)
    21 	for (byte j = 0; j < MAX_BRIDGES; j++)
    21 		if (::GetBridgeSpec(j)->avail_year <= _cur_year)
    22 		if (::GetBridgeSpec(j)->avail_year <= _cur_year)
    22 			if (length >= ::GetBridgeSpec(j)->min_length && length <= ::GetBridgeSpec(j)->max_length)
    23 			if (length >= (uint)AIBridge::GetMinLength(j) && length <= (uint)AIBridge::GetMaxLength(j))
    23 				this->AddItem(j);
    24 				this->AddItem(j);
    24 }
    25 }