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/map.h

Go to the documentation of this file.
00001   /*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
00002     || NoX-Wizard UO Server Emulator (NXW) [http://noxwizard.sourceforge.net]  ||
00003     ||                                                                         ||
00004     || This software is free software released under GPL2 license.             ||
00005     || You can find detailed license information in nox-wizard.cpp file.       ||
00006     ||                                                                         ||
00007     || For any question post to NoX-Wizard forums.                             ||
00008     -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
00009 
00016 #ifndef __MAP_H__
00017 #define __MAP_H__
00018 
00019 #include "basics.h"
00020 
00025 enum {
00026         WALKFLAG_NONE = 0x0, WALKFLAG_MAP = 0x1, WALKFLAG_STATIC = 0x2, WALKFLAG_DYNAMIC = 0x4, WALKFLAG_CHARS = 0x8, WALKFLAG_ALL = 0xF
00027 };
00028 
00029 class cLine {
00030 public:
00031         cLine( Location A, Location B );
00032         Location getPosAtX( UI32 x );
00033         Location getPosAtY( UI32 y );
00034         SI08 calcZAtX( UI32 x );
00035 private:
00036         UI32 x1, y1;
00037         SI08 z1;
00038         SI32 m_xDist, m_yDist, m_zDist;
00039 };
00040 
00041 SI08 isWalkable( Location pos, UI08 flags = WALKFLAG_ALL, P_CHAR pc = NULL );
00042 LOGICAL lineOfSight( Location pos1, Location pos2,SI32 checkfor=WALKFLAG_DYNAMIC+WALKFLAG_MAP+WALKFLAG_STATIC );
00043 LOGICAL canNpcWalkHere( Location pos );
00044 SI08 staticTop( Location pos );
00045 SI08 tileHeight( UI16 id );
00046 SI08 mapElevation( UI32 x, UI32 y );
00047 SI08 dynamicElevation( Location pos );
00048 SI08 getHeight( Location pos );
00049 void getMultiCorners( P_ITEM pi, SI32 &x1, SI32 &y1, SI32 &x2, SI32 &y2 );
00050 
00051 inline SI32 line_of_sight( Location a, Location b  ,SI32 checkfor=WALKFLAG_DYNAMIC+WALKFLAG_MAP+WALKFLAG_STATIC )
00052 { return lineOfSight( a, b, checkfor ); }
00053 
00054 inline SI32 line_of_sight( SI32 x1, SI32 y1, SI32 z1, SI32 x2, SI32 y2, SI32 z2, SI32 checkfor=WALKFLAG_DYNAMIC+WALKFLAG_MAP+WALKFLAG_STATIC )
00055 { return lineOfSight( Loc( x1, y1, z1 ), Loc( x2, y2, z2 ), checkfor); }
00056 
00057 
00058 #endif //__MAP_H__
SourceForge.net Logo