From ef8cc49175ae8f97c6659c3acd13fdb4434cd535 Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 2 Dec 2009 09:31:38 +0000 Subject: (svn r18370) -Codechange: push some constness/type strictness into the ship pathfinders --- src/pathfinder/yapf/yapf.h | 2 +- src/pathfinder/yapf/yapf_ship.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/pathfinder/yapf') diff --git a/src/pathfinder/yapf/yapf.h b/src/pathfinder/yapf/yapf.h index 1a21b67ea..2f39cd6c5 100644 --- a/src/pathfinder/yapf/yapf.h +++ b/src/pathfinder/yapf/yapf.h @@ -23,7 +23,7 @@ * @param tracks available tracks on the new tile (to choose from) * @return the best trackdir for next turn or INVALID_TRACK if the path could not be found */ -Track YapfChooseShipTrack(const Vehicle *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks); +Track YapfChooseShipTrack(const Ship *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks); /** Finds the best path for given road vehicle. * @param v the RV that needs to find a path diff --git a/src/pathfinder/yapf/yapf_ship.cpp b/src/pathfinder/yapf/yapf_ship.cpp index f0de614ac..44ec9fe55 100644 --- a/src/pathfinder/yapf/yapf_ship.cpp +++ b/src/pathfinder/yapf/yapf_ship.cpp @@ -10,6 +10,7 @@ /** @file yapf_ship.cpp Implementation of YAPF for ships. */ #include "../../stdafx.h" +#include "../../ship.h" #include "yapf.hpp" @@ -48,7 +49,7 @@ public: return 'w'; } - static Trackdir ChooseShipTrack(const Vehicle *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks) + static Trackdir ChooseShipTrack(const Ship *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks) { /* handle special case - when next tile is destination tile */ if (tile == v->dest_tile) { @@ -167,10 +168,10 @@ struct CYapfShip2 : CYapfT > {}; /** Ship controller helper - path finder invoker */ -Track YapfChooseShipTrack(const Vehicle *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks) +Track YapfChooseShipTrack(const Ship *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks) { /* default is YAPF type 2 */ - typedef Trackdir (*PfnChooseShipTrack)(const Vehicle*, TileIndex, DiagDirection, TrackBits); + typedef Trackdir (*PfnChooseShipTrack)(const Ship*, TileIndex, DiagDirection, TrackBits); PfnChooseShipTrack pfnChooseShipTrack = CYapfShip2::ChooseShipTrack; // default: ExitDir, allow 90-deg /* check if non-default YAPF type needed */ -- cgit v1.2.3-54-g00ecf