From: Trent W. <qua...@us...> - 2006-09-27 22:32:16
|
Update of /cvsroot/freesynd/freesynd In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv29173 Added Files: path.h Log Message: added path.h --- NEW FILE: path.h --- /************************************************************************ * * * FreeSynd - a remake of the classic Bullfrog game "Syndicate". * * * * Copyright (C) 2005 Stuart Binge <sk...@gm...> * * Copyright (C) 2005 Joost Peters <jo...@us...> * * Copyright (C) 2006 Trent Waddington <qg...@bi...> * * Copyright (C) 2006 Tarjei Knapstad <tar...@gm...> * * * * This program 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; either version 2 of the * * License, or (at your option) any later version. * * * * This program 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 can view the GNU General Public License, online, at the GNU * * project's web site; see <http://www.gnu.org/licenses/gpl.html>. * * The full text of the license is also included in the file COPYING. * * * ************************************************************************/ #include "common.h" class PathNode { public: PathNode() : tile_x_(0), tile_y_(0), tile_z_(0), off_x_(0), off_y_(0) { } PathNode(int tileX, int tileY, int tileZ, int offX = 128, int offY = 128) : tile_x_(tileX), tile_y_(tileY), tile_z_(tileZ), off_x_(offX), off_y_(offY) { } int tileX() { return tile_x_; } int tileY() { return tile_y_; } int tileZ() { return tile_z_; } int offX() { return off_x_; } int offY() { return off_y_; } bool operator<(const PathNode &other) const { int a = tile_x_ | (tile_y_ << 16); int b = other.tile_x_ | (other.tile_y_ << 16); return a < b; } protected: int tile_x_, tile_y_, tile_z_, off_x_, off_y_; }; |