Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   Compound Members   Related Pages  

GS_ Galaxy Engine System Calls


Functions

int GS_Route (int from_x, int from_y, int to_x, int to_y)
int GS_RouteLen (int from_x, int from_y, int to_x, int to_y)
void GS_AddGate (int from_x, int from_y, int from_id, int to_x, int to_y, int to_id)
void GS_RemoveGate (int from_x, int from_y, int from_id)

Detailed Description

The galaxy system calls are just a few X-specific helper functions for story programming, to speed up tasks that would take too much KC CPU cycles, and which are not general enough to justify putting them into the story engine as Story Engine (SE) calls.

Function Documentation

void GS_AddGate int    from_x,
int    from_y,
int    from_id,
int    to_x,
int    to_y,
int    to_id
 

Adds a warpgate from sector (from_x, from_y) with ID from_id to the sector (to_x, to_y) with ID to_id. Another gate must be created in the destination sector, or there will be an error.

void GS_RemoveGate int    from_x,
int    from_y,
int    from_id
 

Removes a gate from the sector. The corresponding gate in the other sector has to be removed too, or an error will happen.

int GS_Route int    from_x,
int    from_y,
int    to_x,
int    to_y
 

Computes the shortest path from sector (from_x, from_y) to sector (to_x, to_y). Sector coordinates must be in the range of (0, 0) to (SECTORS_X, SECTORS_Y). The call returns the number of the next gate (direction) that must be used, this can be DIRECTION_NORTH, DIRECTION_SOUTH, DIRECTION_WEST and DIRECTION_EAST, or a negative value indicating one of the following errors:
-1: Source and destination sector are the same, this is considered an error.
-2: There is no path possible from source to destination sector.
-3: The galaxy data structure is not initialized (this should never happen!)
-4: A fatal error happened inside the routing code (this should not happen!)

int GS_RouteLen int    from_x,
int    from_y,
int    to_x,
int    to_y
 

Returns the number of warp jumps necessary to fly to the destination sector. It uses the same routing algorithm as GS_Route().


Generated on Mon Aug 26 18:26:37 2002 for X² KC by doxygen1.2.17