PathFinder.cc

Go to the documentation of this file.
00001 /*
00002  *  Copyright (C) 2000-2001  The Exult Team
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  */
00018 
00019 #ifdef HAVE_CONFIG_H
00020 #  include <config.h>
00021 #endif
00022 
00023 #include "PathFinder.h"
00024 
00025 /*
00026  *  Given the estimated cost from start to goal, figure the max. cost
00027  *  before the pathfinder should quit.
00028  */
00029 
00030 int Pathfinder_client::get_max_cost
00031   (
00032   int cost_to_goal    // From estimate_cost(start, goal).
00033   )
00034   {
00035   int max_cost = 3*cost_to_goal;
00036           // (Raised from 64 on 9/4/2000).
00037   return (max_cost < 74 ? 74 : max_cost);
00038   }
00039 
00040 /*
00041  *  Is tile at goal?
00042  */
00043 
00044 int Pathfinder_client::at_goal
00045   (
00046   Tile_coord& tile,
00047   Tile_coord& goal
00048   )
00049   {
00050   return (tile.tx == goal.tx && tile.ty == goal.ty &&
00051     (goal.tz == -1 || tile.tz == goal.tz));
00052   }
00053 
00054 
00055 PathFinder::~PathFinder()
00056 {}

Generated on Mon Jul 9 14:42:49 2007 for ExultEngine by  doxygen 1.5.1