src/ai/api/ai_tilelist_valuator.hpp
branchnoai
changeset 9655 e8e43f333832
parent 9617 df9cedf12aab
child 9657 f2c6e332d8bc
equal deleted inserted replaced
9654:b836eb5c521f 9655:e8e43f333832
    96 	CargoID cargo_type;
    96 	CargoID cargo_type;
    97 
    97 
    98 	int32 Valuate(int32 tile) const;
    98 	int32 Valuate(int32 tile) const;
    99 };
    99 };
   100 
   100 
       
   101 /**
       
   102  * Get the manhattan distance to a tile for entries in an AITileList instance.
       
   103  * @note resulting items are of the type distance
       
   104  * @note the input items are of the type TileIndex
       
   105  */
       
   106 class AITileListDistanceManhattanToTile : public AIAbstractList::Valuator {
       
   107 public:
       
   108 	/**
       
   109 	 * The name of the class, needed by several sub-processes.
       
   110 	 */
       
   111 	static const char *GetClassName() { return "AITileListDistanceManhattanToTile"; }
       
   112 
       
   113 	/**
       
   114 	 * Custom constructor, we want a tile as parameter.
       
   115 	 */
       
   116 	AITileListDistanceManhattanToTile(TileIndex tile) { this->tile = tile; }
       
   117 
       
   118 private:
       
   119 	TileIndex tile;
       
   120 
       
   121 	int32 Valuate(int32 station) const;
       
   122 };
       
   123 
       
   124 /**
       
   125  * Get the sqsuare distance to a tile for entries in an AITileList instance.
       
   126  * @note resulting items are of the type distance
       
   127  * @note the input items are of the type TileIndex
       
   128  */
       
   129 class AITileListDistanceSquareToTile : public AIAbstractList::Valuator {
       
   130 public:
       
   131 	/**
       
   132 	 * The name of the class, needed by several sub-processes.
       
   133 	 */
       
   134 	static const char *GetClassName() { return "AITileListDistanceSquareToTile"; }
       
   135 
       
   136 	/**
       
   137 	 * Custom constructor, we want a tile as parameter.
       
   138 	 */
       
   139 	AITileListDistanceSquareToTile(TileIndex tile) { this->tile = tile; }
       
   140 
       
   141 private:
       
   142 	TileIndex tile;
       
   143 
       
   144 	int32 Valuate(int32 station) const;
       
   145 };
       
   146 
       
   147 
   101 #endif /* AI_TILELIST_VALUATOR_HPP */
   148 #endif /* AI_TILELIST_VALUATOR_HPP */