471 typedef void TileLoopProc(TileIndex tile); |
471 typedef void TileLoopProc(TileIndex tile); |
472 typedef void ChangeTileOwnerProc(TileIndex tile, PlayerID old_player, PlayerID new_player); |
472 typedef void ChangeTileOwnerProc(TileIndex tile, PlayerID old_player, PlayerID new_player); |
473 /** @see VehicleEnterTileStatus to see what the return values mean */ |
473 /** @see VehicleEnterTileStatus to see what the return values mean */ |
474 typedef uint32 VehicleEnterTileProc(Vehicle *v, TileIndex tile, int x, int y); |
474 typedef uint32 VehicleEnterTileProc(Vehicle *v, TileIndex tile, int x, int y); |
475 typedef Foundation GetFoundationProc(TileIndex tile, Slope tileh); |
475 typedef Foundation GetFoundationProc(TileIndex tile, Slope tileh); |
|
476 /** |
|
477 * Called when a tile is affected by a terraforming operation. |
|
478 * The function has to check if terraforming of the tile is allowed and return extra terraform-cost that depend on the tiletype. |
|
479 * With DC_EXEC in flags it has to perform tiletype-specific actions (like clearing land etc., but not the terraforming itself). |
|
480 * |
|
481 * @note The terraforming has not yet taken place. So GetTileZ() and GetTileSlope() refer to the landscape before the terraforming operation. |
|
482 * |
|
483 * @param tile The involved tile. |
|
484 * @param flags Command flags passed to the terraform command (DC_EXEC, DC_QUERY_COST, etc.). |
|
485 * @param z_new TileZ after terraforming. |
|
486 * @param tileh_new Slope after terraforming. |
|
487 * @return Error code or extra cost for terraforming (like clearing land, building foundations, etc., but not the terraforming itself.) |
|
488 */ |
|
489 typedef CommandCost TerraformTileProc(TileIndex tile, uint32 flags, uint z_new, Slope tileh_new); |
476 |
490 |
477 struct TileTypeProcs { |
491 struct TileTypeProcs { |
478 DrawTileProc *draw_tile_proc; |
492 DrawTileProc *draw_tile_proc; |
479 GetSlopeZProc *get_slope_z_proc; |
493 GetSlopeZProc *get_slope_z_proc; |
480 ClearTileProc *clear_tile_proc; |
494 ClearTileProc *clear_tile_proc; |
486 TileLoopProc *tile_loop_proc; |
500 TileLoopProc *tile_loop_proc; |
487 ChangeTileOwnerProc *change_tile_owner_proc; |
501 ChangeTileOwnerProc *change_tile_owner_proc; |
488 GetProducedCargoProc *get_produced_cargo_proc; |
502 GetProducedCargoProc *get_produced_cargo_proc; |
489 VehicleEnterTileProc *vehicle_enter_tile_proc; |
503 VehicleEnterTileProc *vehicle_enter_tile_proc; |
490 GetFoundationProc *get_foundation_proc; |
504 GetFoundationProc *get_foundation_proc; |
|
505 TerraformTileProc *terraform_tile_proc; |
491 }; |
506 }; |
492 |
507 |
493 |
508 |
494 enum WindowClass { |
509 enum WindowClass { |
495 WC_NONE, |
510 WC_NONE, |