39 | }; | 39 | };
|
---|
| | 40 |
|
---|
| | 41 | /// valuateTruckStopTile
|
---|
| | 42 | ///
|
---|
| | 43 | /// @param tile - The starting tile to valuate.
|
---|
| | 44 | /// @param cargoClass - should be either AICargo.CC_MAIL, or AICargo.CC_PASSENGERS to get correct cargo acceptance.
|
---|
| | 45 | /// @return - The tile value.
|
---|
| | 46 | function Utils::valuateTruckStopTile(tile, cargoClass, stationId, cargoType) {
|
---|
| | 47 | local radiusType;
|
---|
| | 48 | if(cargoClass == AICargo.CC_MAIL) {
|
---|
| | 49 | radiusType = AIStation.STATION_TRUCK_STOP;
|
---|
| | 50 | }
|
---|
| | 51 | else {
|
---|
| | 52 | radiusType = AIStation.STATION_BUS_STOP;
|
---|
| | 53 | }
|
---|
| | 54 |
|
---|
| | 55 | if(AITile.GetCargoAcceptance(tile,
|
---|
| | 56 | cargoType,
|
---|
| | 57 | 1,
|
---|
| | 58 | 1,
|
---|
| | 59 | AIStation.GetCoverageRadius(radiusType)) < 8) {
|
---|
| | 60 | return 0;
|
---|
| | 61 | }
|
---|
| | 62 |
|
---|
| | 63 | local value = AITile.GetCargoProduction(tile,
|
---|
| | 64 | cargoType,
|
---|
| | 65 | 1,
|
---|
| | 66 | 1,
|
---|
| | 67 | AIStation.GetCoverageRadius(radiusType));
|
---|
| | 68 | return value;
|
---|
| | 69 | } |
---|