diff options
author | rubidium <rubidium@openttd.org> | 2009-12-02 09:57:17 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-12-02 09:57:17 +0000 |
commit | 9165c195b9609bb9db77cc23ff424802eb4ab128 (patch) | |
tree | 1a8b2370e076ace6dd5b6087e94d37bf3a5e2f78 /src/pathfinder/pathfinder_type.h | |
parent | ef8cc49175ae8f97c6659c3acd13fdb4434cd535 (diff) | |
download | openttd-9165c195b9609bb9db77cc23ff424802eb4ab128.tar.xz |
(svn r18371) -Codechange: unify calling of the train pathfinders
Diffstat (limited to 'src/pathfinder/pathfinder_type.h')
-rw-r--r-- | src/pathfinder/pathfinder_type.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/pathfinder/pathfinder_type.h b/src/pathfinder/pathfinder_type.h new file mode 100644 index 000000000..95daf533e --- /dev/null +++ b/src/pathfinder/pathfinder_type.h @@ -0,0 +1,35 @@ +/* $Id$ */ + +/* + * This file is part of OpenTTD. + * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. + * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>. + */ + +/** @file pathfinder_type.h General types related to pathfinders. */ + +#ifndef PATHFINDER_TYPE_H +#define PATHFINDER_TYPE_H + +/** + * Helper container to find a depot + */ +struct FindDepotData { + TileIndex tile; ///< The tile of the depot + uint best_length; ///< The distance towards the depot, or UINT_MAX if not found + bool reverse; ///< True if reversing is necessary for the train to get to this depot + + /** + * Create an instance of this structure. + * @param tile the tile of the depot + * @param best_length the distance towards the depot, or UINT_MAX if not found + * @param reverse whether we need to reverse first. + */ + FindDepotData(TileIndex tile = INVALID_TILE, uint best_length = UINT_MAX, bool reverse = false) : + tile(tile), best_length(best_length), reverse(reverse) + { + } +}; + +#endif /* PATHFINDER_TYPE_H */ |