# ai_industrylist.cpp

Go to the documentation of this file.

    00001 /* $Id: ai_industrylist.cpp 15299 2009-01-31 20:16:06Z smatz $ */
    00002
    00005 #include "ai_industrylist.hpp"
    00006 #include "../../tile_type.h"
    00007 #include "../../industry.h"
    00008
    00009 AIIndustryList::AIIndustryList()
    00010 {
    00011   Industry *i;
    00012   FOR_ALL_INDUSTRIES(i) {
    00013     this->AddItem(i->index);
    00014   }
    00015 }
    00016
    00017 AIIndustryList_CargoAccepting::AIIndustryList_CargoAccepting(CargoID cargo_id)
    00018 {
    00019   const Industry *i;
    00020
    00021   FOR_ALL_INDUSTRIES(i) {
    00022     for (byte j = 0; j < lengthof(i->accepts_cargo); j++) {
    00023       if (i->accepts_cargo[j] == cargo_id) this->AddItem(i->index);
    00024     }
    00025   }
    00026 }
    00027
    00028 AIIndustryList_CargoProducing::AIIndustryList_CargoProducing(CargoID cargo_id)
    00029 {
    00030   const Industry *i;
    00031
    00032   FOR_ALL_INDUSTRIES(i) {
    00033     for (byte j = 0; j < lengthof(i->produced_cargo); j++) {
    00034       if (i->produced_cargo[j] == cargo_id) this->AddItem(i->index);
    00035     }
    00036   }
    00037 }