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/range.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 
00010 #ifndef __RANGE_H__
00011 #define __RANGE_H__
00012 
00013 #include "globals.h"
00014 #include "basics.h"
00015 
00016 #define VERY_VERY_FAR 50000;
00017 
00018 inline R64 dist( Location a, Location b, LOGICAL countZ = (bool) ((int) server_data.disable_z_checking == (int) 0) )
00019 {
00020         SI32 xDiff = a.x - b.x;
00021     SI32 yDiff = a.y - b.y;
00022         R64 distance = hypot( abs( xDiff ), abs( yDiff ) );
00023         if ( !countZ || a.z == b.z )
00024                 return distance;
00025 
00026         R64 distZ = abs( a.z - b.z );
00027         return hypot( distance, distZ );
00028 }
00029 
00030 inline R64 dist( UI32 xa, UI32 ya, SI08 za, UI32 xb, UI32 yb, SI08 zb, LOGICAL countZ = (bool) ((int) server_data.disable_z_checking == (int) 0) )
00031 {
00032         return dist( Loc( xa, ya, za ), Loc( xb, yb, zb ), countZ );
00033 }
00034 
00035 LOGICAL inRange(Location a, Location b, UI32 range);
00036 LOGICAL inVisRange(Location a, Location b);
00037 LOGICAL char_inVisRange(P_CHAR a, P_CHAR b);
00038 LOGICAL item_inVisRange(P_CHAR a, P_ITEM b );
00039 LOGICAL inBuildRange(Location a, Location b);
00040 LOGICAL char_inBuildRange(P_CHAR a, P_CHAR b);
00041 LOGICAL item_inBuildRange(P_CHAR a, P_ITEM b );
00042 LOGICAL char_inRange(P_CHAR a, P_CHAR b, UI32 range);
00043 LOGICAL item_inRange(P_CHAR a, P_ITEM b, UI32 range);
00044 UI32 item_dist(P_CHAR a, P_ITEM b);
00045 LOGICAL inbankrange(int i);
00046 
00047 #endif
SourceForge.net Logo