[an error occurred while processing this directive]
[<a href="index.shtml">Package Index</a></code> | <a href="index_std.shtml">Mudlib Index</a></code> | <a href="index_eff.shtml">Effect Index</a></code>]<br><h2>File /obj/handlers/direction_handler.c</h2>
Direction Handler<p>Written by Elera<p>Started 11 July 2006

This is a basic handler you can use to determine the location of one 
object relative to the location of another object.<h2>Method index</h2>
<ul>
<li><a href="#basic_direction">basic_direction</a>(int *, int *)<br/>
A basic function to show the approximate direction from the start
position to the target position.
<li><a href="#calc_degrees">calc_degrees</a>(int *, int *)<br/>
A basic function to show the precise direction from the start
position to the target position.
<li><a href="#cardinal_direction">cardinal_direction</a>(int *, int *)<br/>
A basic function to show the approximate direction from the start
position to the target position.
<li><a href="#compass_direction">compass_direction</a>(int *, int *)<br/>
A basic function to show a fairly precise direction from the start
position to the target position.
<li><a href="#vertical_direction">vertical_direction</a>(int *, int *)<br/>
A basic function to show if the target is up or down from the start
position.
</ul>
<h2>Public Functions</h2>
These are functions that everyone can access.<p>
<dl>
<dt class="autodocfuncname"><a name="basic_direction">
basic_direction</a><pre class="autodocfuncdef">
string basic_direction(int * start,
                       int * target)
</pre><dd><br />
A basic function to show the approximate direction from the start
position to the target position.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
start - The coords of the first object<br />
target - The coords of the second object<br />
<br />
<dd><b>Returns:</b>
<br />string "north", "southeast", or similar
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="calc_degrees">
calc_degrees</a><pre class="autodocfuncdef">
string calc_degrees(int * start,
                    int * target)
</pre><dd><br />
A basic function to show the precise direction from the start
position to the target position.  It will give the degrees
east, west, north, or south from the start location's x or y axis to which 
the target is nearest.  If due west or southeast, etc, it will
return "due west" or "due southeast", etc.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
start - The coords of the first object<br />
target - The coords of the second object<br />
<br />
<dd><b>Returns:</b>
<br />string "17 degrees east of due north"
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="cardinal_direction">
cardinal_direction</a><pre class="autodocfuncdef">
string cardinal_direction(int * start,
                          int * target)
</pre><dd><br />
A basic function to show the approximate direction from the start
position to the target position.  It will not give combined 
directions like "northeast".<br />
<br /><dl>
<dd><b>Parameters:</b><br />
start - The coords  of the first object<br />
target - The coords of the second object<br />
<br />
<dd><b>Returns:</b>
<br />string "north", "south", "east" or "west"
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="compass_direction">
compass_direction</a><pre class="autodocfuncdef">
string compass_direction(int * start,
                         int * target)
</pre><dd><br />
A basic function to show a fairly precise direction from the start
position to the target position.  It will estimate the closest
compass direction frm the start position to the target position.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
start - The coords of the first object<br />
target - The coords of the second object<br />
<br />
<dd><b>Returns:</b>
<br />string "west", "southeast", "north-northwest"
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="vertical_direction">
vertical_direction</a><pre class="autodocfuncdef">
string vertical_direction(int * start,
                          int * target)
</pre><dd><br />
A basic function to show if the target is up or down from the start
position.  If the target is not higher or lower than the start
position, it will return an empty string.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
start - The coords  of the first object<br />
target - The coords of the second object<br />
<br />
<dd><b>Returns:</b>
<br />string "up" or "down"
<br /><br />
<br /></dl>

</dl>
[an error occurred while processing this directive]

