C# Class FFACETools.FFACE.NavigatorTools

Class container to impliment Pyrolol's navigation system
Mostra file Open project: golfandsurf/Campah

Private Properties

Property Type Description
MathMod double
MathMod float
MathMod int
SetNPCDegrees bool
SetNPCPosH bool
SetPlayerDegrees bool
SetPlayerPosH bool
StartRunning void
StopRunning void

Public Methods

Method Description
DegreesToPosH ( double Degrees ) : float

Converts degrees to FFXI PosH Radians heading.

DistanceTo ( Position position ) : double

Calculates the distance to the passed destination

DistanceTo ( double X, double Z ) : double

Calculates the distance to the passed destination

DistanceTo ( double X, double Y, double Z ) : double

Calculates the distance to the passed destination taking height into account.

DistanceTo ( int ID ) : double

Calculates the distance to the passed NPC

FaceHeading ( Position position ) : bool

Faces to destination as given by position

FaceHeading ( double X, double Z ) : bool

Faces to destination as given by X,Z

FaceHeading ( double X, double Y, double Z ) : bool

Faces to destination as given by X,Y,Z

FaceHeading ( float PosH, HeadingType headingType ) : bool

Faces the given heading in the passed HeadingType

FaceHeading ( int ID ) : bool

Faces NPC/PC with matching ID

GetPlayerPosHInDegrees ( ) : double

Will get the players heading (as radians) in degrees, and north as 0

Goto ( Position position, bool KeepRunning ) : void

Will move the player to the passed STATIC ONLY destination. (will not stop trying)

Goto ( Position position, bool KeepRunning, int timeOut ) : void

Will move the player to the passed STATIC ONLY destination or stop within a specified time.

Goto ( dPoint x, dPoint z, bool KeepRunning ) : void

Will move the player to the passed destination (will not stop trying)

Goto ( dPoint x, dPoint z, bool KeepRunning, int timeOut ) : void

Will move the player to the passed destination or stop within a specified time.

Goto ( dPoint x, dPoint y, dPoint z, bool KeepRunning ) : void

Will move the player to the passed destination (will not stop trying)

Goto ( dPoint x, dPoint y, dPoint z, bool KeepRunning, int timeOut ) : void

Will move the player to the passed destination or stop within a specified time.

Goto ( float X, float Z, bool KeepRunning ) : void

Will move the player to the passed STATIC ONLY destination (Will not stop trying)

Goto ( float X, float Z, bool KeepRunning, int timeOut ) : void

Will move the player to the passed STATIC ONLY destination or stop within a specified time.

Goto ( float X, float Y, float Z, bool KeepRunning ) : void

Will move the player to the passed STATIC ONLY destination. (Will not stop trying)

Goto ( float X, float Y, float Z, bool KeepRunning, int timeOut ) : void

Will move the player to the passed STATIC ONLY destination or stop within a specified time.

GotoNPC ( int ID ) : void

Will go to the passed NPC's location (will not stop trying)

GotoNPC ( int ID, int timeOut ) : void

Will go to the passed NPC's location or stop within a specified time.

GotoTarget ( ) : void

Will go to the current target's location (will not stop trying)

GotoTarget ( int timeOut ) : void

Will go to the current target's location or stop within a specified time.

HeadingError ( double Origin, double Target ) : double

Calculate Heading Error between Origin and Target relative to Origin (how many degrees to adjust, negative is left, positive is right)

HeadingTo ( Position position, HeadingType headingType ) : float

Gets heading from player to Position as selected HeadingType

HeadingTo ( double X, double Z, HeadingType headingType ) : float

Gets heading from player to Position as selected HeadingType

HeadingTo ( double X, double Y, double Z, HeadingType headingType ) : float

Gets heading from player to Position as selected HeadingType

HeadingTo ( int ID, HeadingType headingType ) : float

Gets heading from player to NPC/PC as selected HeadingType

IsRunning ( ) : bool

Whether we're currently moving or not

NavigatorTools ( FFACE fface ) : System

Contructor to start navigation system

PosHToDegrees ( float PosH ) : double

Converts FFXI PosH Radians headings into degrees (0-North, 270-West, 90-East, 180-South

Reset ( ) : void

Resets status of running and sends the KeyUp command to Windower

SetViewMode ( ViewMode newMode ) : void

Sets players ViewMode by pressing Numpad 5 if passed ViewMode is not already set.

Private Methods

Method Description
MathMod ( double a, double b ) : double

Returns modulo of a to b with sign matching divisor (C# Modulo returns modulo with sign matching dividend)

MathMod ( float a, float b ) : float

Returns modulo of a to b with sign matching divisor (C# Modulo returns modulo with sign matching dividend)

MathMod ( int a, int b ) : int

Returns modulo of a to b with sign matching divisor (C# Modulo returns modulo with sign matching dividend)

SetNPCDegrees ( int index, double degrees ) : bool

Set NPCs PosH as Degrees (calls FFACE SetNPCPosH directly after converting Degrees to Radians)

SetNPCPosH ( int index, float value ) : bool

Set NPCs PosH as Radians (calls FFACE SetNPCPosH directly)

SetPlayerDegrees ( double degrees ) : bool

Set the Player PosH (directly calls FFACE)

SetPlayerPosH ( float value ) : bool

Sets the Player PosH (directly calls FFACE)

StartRunning ( ) : void

Will start moving the player to the destination

StopRunning ( ) : void

Will stop moving the player

Method Details

DegreesToPosH() public method

Converts degrees to FFXI PosH Radians heading.
public DegreesToPosH ( double Degrees ) : float
Degrees double Degrees (can be any value, will be forced into 0-359.999 range)
return float

DistanceTo() public method

Calculates the distance to the passed destination
public DistanceTo ( Position position ) : double
position Position Coordinates of destination as a Position class
return double

DistanceTo() public method

Calculates the distance to the passed destination
public DistanceTo ( double X, double Z ) : double
X double X coordinate of destination
Z double Z coordinate of destination
return double

DistanceTo() public method

Calculates the distance to the passed destination taking height into account.
public DistanceTo ( double X, double Y, double Z ) : double
X double X coordinate of destination
Y double Y coordinate of destination
Z double Z coordinate of destination
return double

DistanceTo() public method

Calculates the distance to the passed NPC
public DistanceTo ( int ID ) : double
ID int ID of the NPC/PC
return double

FaceHeading() public method

Faces to destination as given by position
public FaceHeading ( Position position ) : bool
position Position Destination to face as a Position class.
return bool

FaceHeading() public method

Faces to destination as given by X,Z
public FaceHeading ( double X, double Z ) : bool
X double X coordinate of destination
Z double Z coordinate of destination
return bool

FaceHeading() public method

Faces to destination as given by X,Y,Z
public FaceHeading ( double X, double Y, double Z ) : bool
X double X coordinate of destination
Y double Y coordinate of destination (not used, here for consistency)
Z double Z coordinate of destination
return bool

FaceHeading() public method

Faces the given heading in the passed HeadingType
public FaceHeading ( float PosH, HeadingType headingType ) : bool
PosH float Heading to set on player.
headingType HeadingType HeadingType indicating the type of the value.
return bool

FaceHeading() public method

Faces NPC/PC with matching ID
public FaceHeading ( int ID ) : bool
ID int ID of NPC/PC to face
return bool

GetPlayerPosHInDegrees() public method

Will get the players heading (as radians) in degrees, and north as 0
public GetPlayerPosHInDegrees ( ) : double
return double

Goto() public method

Will move the player to the passed STATIC ONLY destination. (will not stop trying)
public Goto ( Position position, bool KeepRunning ) : void
position Position Position of destination (will not live update as it runs)
KeepRunning bool Whether to keep moving after reaching the destination
return void

Goto() public method

Will move the player to the passed STATIC ONLY destination or stop within a specified time.
public Goto ( Position position, bool KeepRunning, int timeOut ) : void
position Position Position of destination (will not live update as it runs)
KeepRunning bool Whether to keep moving after reaching the destination
timeOut int Time out in milliseconds
return void

Goto() public method

Will move the player to the passed destination (will not stop trying)
public Goto ( dPoint x, dPoint z, bool KeepRunning ) : void
x dPoint Function returning X coordinate of the destination
z dPoint Function returning Z coordinate of the destination
KeepRunning bool Whether to keep moving after reaching the destination
return void

Goto() public method

Will move the player to the passed destination or stop within a specified time.
public Goto ( dPoint x, dPoint z, bool KeepRunning, int timeOut ) : void
x dPoint Function returning X coordinate of the destination
z dPoint Function returning Z coordinate of the destination
KeepRunning bool Whether to keep moving after reaching the destination
timeOut int Time out in milliseconds
return void

Goto() public method

Will move the player to the passed destination (will not stop trying)
public Goto ( dPoint x, dPoint y, dPoint z, bool KeepRunning ) : void
x dPoint Function returning X coordinate of the destination
y dPoint Function returning Y coordinate of the destination
z dPoint Function returning Z coordinate of the destination
KeepRunning bool Whether to keep moving after reaching the destination
return void

Goto() public method

Will move the player to the passed destination or stop within a specified time.
public Goto ( dPoint x, dPoint y, dPoint z, bool KeepRunning, int timeOut ) : void
x dPoint Function returning X coordinate of the destination
y dPoint Function returning Y coordinate of the destination
z dPoint Function returning Z coordinate of the destination
KeepRunning bool Whether to keep moving after reaching the destination
timeOut int Time out in milliseconds
return void

Goto() public method

Will move the player to the passed STATIC ONLY destination (Will not stop trying)
public Goto ( float X, float Z, bool KeepRunning ) : void
X float
Z float
KeepRunning bool Whether to keep moving after reaching the destination
return void

Goto() public method

Will move the player to the passed STATIC ONLY destination or stop within a specified time.
public Goto ( float X, float Z, bool KeepRunning, int timeOut ) : void
X float
Z float
KeepRunning bool Whether to keep moving after reaching the destination
timeOut int Time out in milliseconds
return void

Goto() public method

Will move the player to the passed STATIC ONLY destination. (Will not stop trying)
public Goto ( float X, float Y, float Z, bool KeepRunning ) : void
X float
Y float
Z float
KeepRunning bool Whether to keep moving after reaching the destination
return void

Goto() public method

Will move the player to the passed STATIC ONLY destination or stop within a specified time.
public Goto ( float X, float Y, float Z, bool KeepRunning, int timeOut ) : void
X float
Y float
Z float
KeepRunning bool Whether to keep moving after reaching the destination
timeOut int Time out in milliseconds
return void

GotoNPC() public method

Will go to the passed NPC's location (will not stop trying)
public GotoNPC ( int ID ) : void
ID int ID of the NPC
return void

GotoNPC() public method

Will go to the passed NPC's location or stop within a specified time.
public GotoNPC ( int ID, int timeOut ) : void
ID int ID of the NPC
timeOut int Time out in milliseconds
return void

GotoTarget() public method

Will go to the current target's location (will not stop trying)
public GotoTarget ( ) : void
return void

GotoTarget() public method

Will go to the current target's location or stop within a specified time.
public GotoTarget ( int timeOut ) : void
timeOut int Time out in milliseconds
return void

HeadingError() public method

Calculate Heading Error between Origin and Target relative to Origin (how many degrees to adjust, negative is left, positive is right)
public HeadingError ( double Origin, double Target ) : double
Origin double Origin's (typically player's) current heading in degrees (can use negative values)
Target double Target heading we're finding we may be off from (can use negative values)
return double

HeadingTo() public method

Gets heading from player to Position as selected HeadingType
public HeadingTo ( Position position, HeadingType headingType ) : float
position Position Position containing coordinates to get heading to.
headingType HeadingType Heading type for the return value.
return float

HeadingTo() public method

Gets heading from player to Position as selected HeadingType
public HeadingTo ( double X, double Z, HeadingType headingType ) : float
X double X coordinate of Position to get heading to.
Z double Z coordinate of Position to get heading to.
headingType HeadingType Heading type for the return value.
return float

HeadingTo() public method

Gets heading from player to Position as selected HeadingType
public HeadingTo ( double X, double Y, double Z, HeadingType headingType ) : float
X double X coordinate of Position to get heading to.
Y double Y coordinate of Position to get heading to.
Z double Z coordinate of Position to get heading to.
headingType HeadingType Heading type for the return value.
return float

HeadingTo() public method

Gets heading from player to NPC/PC as selected HeadingType
public HeadingTo ( int ID, HeadingType headingType ) : float
ID int ID of NPC/PC
headingType HeadingType Heading type for the return value.
return float

IsRunning() public method

Whether we're currently moving or not
public IsRunning ( ) : bool
return bool

NavigatorTools() public method

Contructor to start navigation system
public NavigatorTools ( FFACE fface ) : System
fface FFACE
return System

PosHToDegrees() public method

Converts FFXI PosH Radians headings into degrees (0-North, 270-West, 90-East, 180-South
public PosHToDegrees ( float PosH ) : double
PosH float FFXI PosH Radians to convert to degrees
return double

Reset() public method

Resets status of running and sends the KeyUp command to Windower
public Reset ( ) : void
return void

SetViewMode() public method

Sets players ViewMode by pressing Numpad 5 if passed ViewMode is not already set.
public SetViewMode ( ViewMode newMode ) : void
newMode ViewMode ViewMode to set it to.
return void