pathutils.hpp

Go to the documentation of this file.
00001 /* $Id: pathutils.hpp 25349 2008-03-30 21:13:49Z boucman $ */
00002 /*
00003 Copyright (C) 2003 - 2008 by David White <dave@whitevine.net>
00004 Part of the Battle for Wesnoth Project http://www.wesnoth.org/
00005 
00006 This program is free software; you can redistribute it and/or modify
00007 it under the terms of the GNU General Public License version 2
00008 or at your option any later version.
00009 This program is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY.
00011 
00012 See the COPYING file for more details.
00013 */
00014 
00015 //! @file pathutils.hpp
00016 //!
00017 
00018 #ifndef PATHUTILS_H_INCLUDED
00019 #define PATHUTILS_H_INCLUDED
00020 
00021 #include "map.hpp"
00022 
00023 //! Function which tells if two locations are adjacent.
00024 bool tiles_adjacent(const gamemap::location& a, const gamemap::location& b);
00025 
00026 //! Function which, given a location, will place all adjacent locations in res.
00027 //! res must point to an array of 6 location objects.
00028 void get_adjacent_tiles(const gamemap::location& a, gamemap::location* res);
00029 
00030 
00031 //! Function which, given a location, will place all locations in a ring of
00032 //! distance r in res. res must be a std::vector of location
00033 void get_tile_ring(const gamemap::location& a, const int r, std::vector<gamemap::location>& res);
00034 
00035 //! Function which, given a location, will place all locations in the radius of r in res
00036 //! res must be a std::vector of location
00037 void get_tiles_in_radius(const gamemap::location& a, const int r, std::vector<gamemap::location>& res);
00038 
00039 //! Function which gives the number of hexes between two tiles
00040 //! (i.e. the minimum number of hexes that have to be traversed
00041 //! to get from one hex to the other).
00042 size_t distance_between(const gamemap::location& a, const gamemap::location& b);
00043 
00044 #endif
00045 

Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs