Define the WormPlanner class which handles planning.  
 More...
| 
Public Member Functions | 
| constructor | WormPlanner (rail_manager) | 
| function | GetSubsidizedRoute (planned_route) | 
|  | Choose a subsidy if there is one available that suits us. 
 | 
| function | GetRoute (planned_route) | 
|  | Find a cargo, a source and a destination to build a new service. 
 | 
| function | PlanRailRoute () | 
|  | Plan a rail route. 
 | 
| 
Static Public Member Functions | 
| static function | GetMailCargo () | 
|  | Gets the CargoID associated with mail. 
 | 
| static function | GetLastMonthTransportedPercentage (ind, cargo) | 
|  | Get the percentage of transported cargo from a given industry. 
 | 
| 
Public Attributes | 
|  | route = null | 
|  | Details about the route we planned. 
 | 
Detailed Description
Define the WormPlanner class which handles planning. 
Member Function Documentation
  
  | 
        
          | function WormPlanner::GetLastMonthTransportedPercentage | ( | ind | , |  
          |  |  | cargo |  |  
          |  | ) |  |  |  | static | 
 
Get the percentage of transported cargo from a given industry. 
- Parameters
- 
  
    | ind | The IndustryID of the industry. |  | cargo | The cargo to be checked. |  
 
- Returns
- The percentage transported, ranging from 0 to 100. 
 
 
  
  | 
        
          | function WormPlanner::GetMailCargo | ( |  | ) |  |  | static | 
 
Gets the CargoID associated with mail. 
- Note
- Taken from SimpleAI. 
- Returns
- The CargoID of mail. 
 
 
      
        
          | function WormPlanner::GetRoute | ( | planned_route |  | ) |  | 
      
 
Find a cargo, a source and a destination to build a new service. 
Builder class variables set: crglist, crg, srclist, src, dstlist, dst, srcistown, dstistown, srcplace, dstplace 
- Returns
- True if a potential connection was found. 
- Todo:
- !! 
- Todo:
- adapt this value (40) move it to a constant or var 
- Todo:
- change to const 
 
 
      
        
          | function WormPlanner::GetSubsidizedRoute | ( | planned_route |  | ) |  | 
      
 
Choose a subsidy if there is one available that suits us. 
- Parameters
- 
  
    | planned_route | A WormRoute class that will receive details about the planned route. |  
 
- Returns
- True if a subsidy was chosen. 
- Precondition
- planned_route should be a valid WormRoute object. 
- Todo:
- Instead of GetSetting we should define a value for ourselves... 
- Todo:
- define a var/const instead of the fixed value we now use... 
 
 
      
        
          | function WormPlanner::PlanRailRoute | ( |  | ) |  | 
      
 
Plan a rail route. 
- Returns
- True if we managed to find a route. 
- Todo:
- replace number by a definied constant 
 
 
The documentation for this class was generated from the following file: