Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

/home/groups/n/no/noxwizard/cvs/src/coord.h

Go to the documentation of this file.
00001 // This code is used with friendly permission from Varan Dar from 
00002 //      Wolfpack Emu (WP)
00003 //      UO Server Emulation Program
00004 //
00005 //      Copyright 1997, 98 by Marcus Rating (Cironian)
00006 //  Copyright 2001-2003 by holders identified in authors.txt
00007 //      This program is free software; you can redistribute it and/or modify
00008 //      it under the terms of the GNU General Public License as published by
00009 //      the Free Software Foundation; either version 2 of the License, or
00010 //      (at your option) any later version.
00011 //
00012 //      This program is distributed in the hope that it will be useful,
00013 //      but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 //      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00015 //      GNU General Public License for more details.
00016 //
00017 //      You should have received a copy of the GNU General Public License
00018 //      along with this program; if not, write to the Free Software
00019 //      Foundation, Inc., 59 Temple Palace - Suite 330, Boston, MA 02111-1307, USA.
00020 //
00021 //      * In addition to that license, if you are running this program or modified
00022 //      * versions of it on a public system you HAVE TO make the complete source of
00023 //      * the version used by you available or provide people with a location to
00024 //      * download it.
00025 //
00026 //
00027 //
00028 //      Wolfpack Homepage: http://wpdev.sf.net/
00029 //==================================================================================
00030 
00031 #if !defined(__COORD_H__)
00032 #define __COORD_H__
00033 
00034 
00035 //Forward class declaration
00036 class cCoord;
00037 
00038 // typedefs
00039 
00040 
00041 //Class definitions
00042 
00043 class cCoord
00044 {
00045 public:
00046         cCoord(void);
00047         cCoord(const cCoord& clCoord);
00048         cCoord(UI16, UI16, SI08 = 0, UI08 uiMap = 0, UI08 uiPlane = 0);
00049         // Operators
00050         cCoord& operator= (const cCoord& clCoord);
00051         bool operator==(const cCoord&) const;
00052         bool operator!=(const cCoord&) const;
00053         cCoord operator+(const cCoord& src) const;
00054         cCoord operator-(const cCoord& src) const;
00055         bool cCoord::operator< (const cCoord& src) const;
00056         unsigned int distance( const cCoord &src) const;
00057         unsigned char direction( const cCoord &dest ) const;
00058         bool lineOfSight( const cCoord &target, bool touch = false );
00059         bool lineOfSight( const cCoord &target, UI16 targethight, bool touch = false );
00060         static UI32 distance ( const cCoord &a, const cCoord &b );
00061 
00065         void effect( UI16 id, UI08 speed = 10, UI08 duration = 5, UI16 hue = 0, UI16 renderMode = 0 );
00066         
00067         static cCoord null;
00068 
00069 private:
00070         double specialFloor( const double value ) const;
00071 
00072 public:
00073         UI16    x;
00074         UI16    y;
00075         SI08    z;
00076         UI08    map;
00077 };
00078 
00079 #endif // __COORD_H__
SourceForge.net Logo