TeamYaffa.CRaPI

CRaPI - Correct Robust and Perfect API

TeamYaffa.CRaPI Namespace

Classes

Class | Description
BasicActions | This class contains static methods for the basic actions available
BasicCommands | This class provides the command strings for the basic commands available in the server.
Clock | This class is used as an internal clock of CRaPI.
CommandQueue | Queue of Command objects.
HearEventArgs | This class is used when an event is fired because the player has received a hear message.
Player | This class is the core of the CRaPI API and the main loop of a soccer player
TimeEventArgs | This class is used by events fired and time is concered.

Delegates

Delegate | Description
MessageEventHandler | Handling event fired after a PlayerMessage has been processed
TimeEventHandler | Delegate for time events.

Enumerations

Enumeration | Description
PlayMode | A type-safe representation of the different play modes.
RefereeMessage | A type-safe representation of the different referee messages
Side | Describes what team-side the player is playing with, i.e. what side of the field the player is starting on.
ViewQuality | Describes the view quality of the player
ViewWidth | Describes the width of the "view cone" of the player

(C) 2002-2003 Team Yaffa


BasicActions Class

This class contains static methods for the basic actions available

For a list of all members of this type, see BasicActions Members.

System.Object
BasicActions

public class BasicActions

Remarks

The methods in this class simplify some of the basic actions a player can do.

The actions available here, are the ones described in the Robocup soccer server manual. You are encouraged to read the manual for more details of the actions.

Requirements

Namespace: TeamYaffa.CRaPI

Assembly: CRaPI (in CRaPI.dll)

See Also

BasicActions Members | TeamYaffa.CRaPI Namespace | BasicCommands


BasicActions Members

BasicActions overview

Public Static Methods

CatchBall | Overloaded. Generates a command to catch the ball
DashToObject | Overloaded. Generates a command to dash to an object
DashToPoint | Overloaded. Generates a command to dash to a point
DashToPointLookingAtPoint | Overloaded. Generates a command to dash to one point while looking at another.
KickToObject | Overloaded. Generates a command to kick the ball towards an object
KickToPoint | Overloaded. Generates a command to kick the ball towards a point
LookAtObject | Overloaded. Generates a command to turn the neck to look at an object
LookAtPoint | Overloaded. Generates a command to turn the neck to look at a point
TurnAndLookAtPoint | Generates a command to turn the body towards a point, and sets the HeadAngle to zero, i.e. the player is looking in the direction of the body.
TurnToObject | Overloaded. Generates a command to turn the body towards an object.
TurnToPoint | Overloaded. Generates a command to turn the body towards a point.

Public Instance Constructors

BasicActions Constructor Initializes a new instance of the BasicActions class.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicCommands


BasicActions Constructor

Initializes a new instance of the BasicActions class.

public BasicActions();

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace


BasicActions Methods

The methods of the BasicActions class are listed below. For a complete list of BasicActions class members, see the BasicActions Members topic.

Public Static Methods

CatchBall | Overloaded. Generates a command to catch the ball
DashToObject | Overloaded. Generates a command to dash to an object
DashToPoint | Overloaded. Generates a command to dash to a point
DashToPointLookingAtPoint | Overloaded. Generates a command to dash to one point while looking at another.
KickToObject | Overloaded. Generates a command to kick the ball towards an object
KickToPoint | Overloaded. Generates a command to kick the ball towards a point
LookAtObject | Overloaded. Generates a command to turn the neck to look at an object
LookAtPoint | Overloaded. Generates a command to turn the neck to look at a point
TurnAndLookAtPoint | Generates a command to turn the body towards a point, and sets the HeadAngle to zero, i.e. the player is looking in the direction of the body.
TurnToObject | Overloaded. Generates a command to turn the body towards an object.
TurnToPoint | Overloaded. Generates a command to turn the body towards a point.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicCommands


CatchBall Method

CRaPI - Correct Robust and Perfect API

BasicActions.CatchBall Method

Generates a command to catch the ball

Overload List

public static Command CatchBall(Player);

public static void CatchBall(Player,out Command);

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace


BasicActions.CatchBall Method (Player)

public static Command CatchBall(
Player pPlayer
);

Parameters

pPlayer
The player (goalie)

Return Value

The action command for the catch

Remarks

Creates a catch command, with the direction to the ball. It is not considered if the player is a goalie, if the ball is catchable, or if the game is on. Use Player.BallIsCatchable to determine if the ball is catchable or not.

This method does not send any command to the server, it is therefore up to the agent to execute the command on the server.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicActions.CatchBall Overload List


BasicActions.CatchBall Method (Player, Command)

public static void CatchBall(
Player pPlayer,
out Command pAction
);

Parameters

pPlayer
The player (goalie)
pAction
The action command for the catch.

Remarks

Creates a catch command, with the direction to the ball. It is not considered if the player is a goalie, if the ball is catchable, or if the game is on. Use Player.BallIsCatchable to determine if the ball is catchable or not.

This method does not send any command to the server, it is therefore up to the agent to execute the command on the server.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicActions.CatchBall Overload List


DashToObject Method

CRaPI - Correct Robust and Perfect API

BasicActions.DashToObject Method

Generates a command to dash to an object

Overload List

public static Command DashToObject(Player,FieldObject,int);

public static Command DashToObject(Player,FieldObject,int,uint);

public static void DashToObject(Player,FieldObject,int,uint,out Command);

public static void DashToObject(Player,FieldObject,int,out Command);

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | DashToPoint


BasicActions.DashToObject Method (Player, FieldObject, Int32)

public static Command DashToObject(
Player pPlayer,
FieldObject pObject,
int pPower
);

Parameters

pPlayer
The player
pObject
The object to dash to
pPower
The power to dash with. Should not exceed MaxPower and MinPower.

Return Value

The action command for the dash

Remarks

Dashes to the object if the angle to the object is +/- 10 degress. If the angle exceeds the 10 degree margin, a turn command is created so the angle to the object will be 0 degrees in the next cycle.

This method does not send any command to the server, it is therefore up to the agent to execute the command on the server.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicActions.DashToObject Overload List | DashToPoint


BasicActions.DashToObject Method (Player, FieldObject, Int32, UInt32)

public static Command DashToObject(
Player pPlayer,
FieldObject pObject,
int pPower,
uint pAngleMargin
);

Parameters

pPlayer
The player
pObject
The object to dash to
pPower
The power to dash with. Should not exceed MaxPower and MinPower.
pAngleMargin
The angle margin

Return Value

The action command for the dash

Remarks

Dashes to the object if the angle to the object is +/- pAngleMargin degress. If the angle exceeds the pAngleMargin, a turn command is created so the angle to the object will be 0 degrees in the next cycle.

This method does not send any command to the server, it is therefore up to the agent to execute the command on the server.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicActions.DashToObject Overload List | DashToPoint


BasicActions.DashToObject Method (Player, FieldObject, Int32, UInt32, Command)

public static void DashToObject(
Player pPlayer,
FieldObject pObject,
int pPower,
uint pAngleMargin,
out Command pAction
);

Parameters

pPlayer
The player
pObject
The object to dash to
pPower
The power to dash with. Should not exceed MaxPower and MinPower.
pAngleMargin
The angle margin
pAction
The action command for the dash

Remarks

Dashes to the object if the angle to the object is +/- pAngleMargin degress. If the angle exceeds the pAngleMargin, a turn command is created so the angle to the object will be 0 degrees in the next cycle.

This method does not send any command to the server, it is therefore up to the agent to execute the command on the server.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicActions.DashToObject Overload List | DashToPoint


BasicActions.DashToObject Method (Player, FieldObject, Int32, Command)

public static void DashToObject(
Player pPlayer,
FieldObject pObject,
int pPower,
out Command pAction
);

Parameters

pPlayer
The player
pObject
The object to dash to
pPower
The power to dash with. Should not exceed MaxPower and MinPower.
pAction
The action command for the dash

Remarks

Dashes to the object if the angle to the object is +/- 10 degress. If the angle exceeds the 10 degree margin, a turn command is created so the angle to the object will be 0 degrees in the next cycle, provided that that neither the player nor the object has changed position.

This method does not send any command to the server, it is therefore up to the agent to execute the command on the server.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicActions.DashToObject Overload List | DashToPoint


DashToPoint Method

CRaPI - Correct Robust and Perfect API

BasicActions.DashToPoint Method

Generates a command to dash to a point

Overload List

public static Command DashToPoint(Player,Point2D,int);

public static Command DashToPoint(Player,Point2D,int,uint);

public static void DashToPoint(Player,Point2D,int,uint,out Command);

public static void DashToPoint(Player,Point2D,int,out Command);

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | DashToObject


BasicActions.DashToPoint Method (Player, Point2D, Int32)

public static Command DashToPoint(
Player pPlayer,
Point2D pPoint,
int pPower
);

Parameters

pPlayer
The player
pPoint
The point to dash to
pPower
The power to dash with. Should not exceed MaxPower and MinPower.

Return Value

The action command for the dash

Remarks

Dashes to the point if the angle to the point is +/- 10 degress. If the angle exceeds the 10 degree margin, a turn command is created so the angle to the point will be 0 degrees in the next cycle.

This method does not send any command to the server, it is therefore up to the agent to execute the command on the server.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicActions.DashToPoint Overload List | DashToObject


BasicActions.DashToPoint Method (Player, Point2D, Int32, UInt32)

public static Command DashToPoint(
Player pPlayer,
Point2D pPoint,
int pPower,
uint pAngleMargin
);

Parameters

pPlayer
The player
pPoint
The point to dash to
pPower
The power to dash with. Should not exceed MaxPower and MinPower.
pAngleMargin
The angle margin

Return Value

The action command for the dash

Remarks

Dashes to the point if the angle to the point is +/- pAngleMargin degress. If the angle exceeds the pAngleMargin, a turn command is created so the angle to the point will be 0 degrees in the next cycle.

This method does not send any command to the server, it is therefore up to the agent to execute the command on the server.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicActions.DashToPoint Overload List | DashToObject


BasicActions.DashToPoint Method (Player, Point2D, Int32, UInt32, Command)

public static void DashToPoint(
Player pPlayer,
Point2D pPoint,
int pPower,
uint pAngleMargin,
out Command pAction
);

Parameters

pPlayer
The player
pPoint
The point to dash to
pPower
The power to dash with. Should not exceed MaxPower and MinPower.
pAngleMargin
The angle margin
pAction
The action command for the dash

Remarks

Dashes to the point if the angle to the point is +/- pAngleMargin degress. If the angle exceeds the pAngleMargin, a turn command is created so the angle to the point will be 0 degrees in the next cycle.

This method does not send any command to the server, it is therefore up to the agent to execute the command on the server.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicActions.DashToPoint Overload List | DashToObject


BasicActions.DashToPoint Method (Player, Point2D, Int32, Command)

public static void DashToPoint(
Player pPlayer,
Point2D pPoint,
int pPower,
out Command pAction
);

Parameters

pPlayer
The player
pPoint
The point to dash to
pPower
The power to dash with. Should not exceed MaxPower and MinPower.
pAction
The action command for the dash

Remarks

Dashes to the point if the angle to the point is +/- 10 degress. If the angle exceeds the 10 degree margin, a turn command is created so the angle to the point will be 0 degrees in the next cycle.

This method does not send any command to the server, it is therefore up to the agent to execute the command on the server.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicActions.DashToPoint Overload List | DashToObject


DashToPointLookingAtPoint Method

CRaPI - Correct Robust and Perfect API

BasicActions.DashToPointLookingAtPoint Method

Generates a command to dash to one point while looking at another.

Overload List

public static Command[] DashToPointLookingAtPoint(Player,Point2D,int,uint,Point2D);

public static Command[] DashToPointLookingAtPoint(Player,Point2D,int,Point2D);

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | DashToPoint | LookAtPoint


BasicActions.DashToPointLookingAtPoint Method (Player, Point2D, Int32, UInt32, Point2D)

public static Command[] DashToPointLookingAtPoint(
Player pPlayer,
Point2D pDashPoint,
int pPower,
uint pAngleMargin,
Point2D pLookPoint
);

Parameters

pPlayer
The agent
pDashPoint
The point to dash to
pPower
What power to use when dashing
pAngleMargin
The angle-margin for when to turn, and when to dash.
pLookPoint
The point to look at

Return Value

The action commands for the dash and the turn-neck

Remarks

If the angle between the look-point and the run-point is greater than MaxNeckAngle or lesser than MinNeckAngle, then consider to change the view-width of the agent to make sure the agent can see the look-point.

This method does not send any command to the server, it is therefore up to the agent to execute the command on the server.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicActions.DashToPointLookingAtPoint Overload List | DashToPoint | LookAtPoint


BasicActions.DashToPointLookingAtPoint Method (Player, Point2D, Int32, Point2D)

public static Command[] DashToPointLookingAtPoint(
Player pPlayer,
Point2D pDashPoint,
int pPower,
Point2D pLookPoint
);

Parameters

pPlayer
The agent
pDashPoint
The point to dash to
pPower
What power to use when dashing
pLookPoint
The point to look at

Return Value

The action commands for the dash and the turn-neck

Remarks

If the angle between the look-point and the run-point is greater than MaxNeckAngle or lesser than MinNeckAngle, then consider to change the view-width of the agent to make sure the agent can see the look-point.

The angle-margin for when to turn and when to dash is +/- 5 degrees.

This method does not send any command to the server, it is therefore up to the agent to execute the command on the server.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicActions.DashToPointLookingAtPoint Overload List | DashToPoint | LookAtPoint


KickToObject Method

CRaPI - Correct Robust and Perfect API

BasicActions.KickToObject Method

Generates a command to kick the ball towards an object

Overload List

public static Command KickToObject(Player,FieldObject,int);

public static void KickToObject(Player,FieldObject,int,out Command);

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | KickToPoint


BasicActions.KickToObject Method (Player, FieldObject, Int32)

public static Command KickToObject(
Player pPlayer,
FieldObject pObject,
int pPower
);

Parameters

pPlayer
The player
pObject
The object to kick to
pPower
The power to kick with. Should not exceed MaxPower and MinPower.

Return Value

The action command for the kick

Remarks

This method does not send any command to the server, it is therefore up to the agent to execute the command on the server.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicActions.KickToObject Overload List | KickToPoint


BasicActions.KickToObject Method (Player, FieldObject, Int32, Command)

public static void KickToObject(
Player pPlayer,
FieldObject pObject,
int pPower,
out Command pAction
);

Parameters

pPlayer
The player
pObject
The object to kick to
pPower
The power to kick with. Should not exceed MaxPower and MinPower.
pAction
The action command for the kick

Remarks

This method does not send any command to the server, it is therefore up to the agent to execute the command on the server.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicActions.KickToObject Overload List | KickToPoint


KickToPoint Method

CRaPI - Correct Robust and Perfect API

BasicActions.KickToPoint Method

Generates a command to kick the ball towards a point

Overload List

public static Command KickToPoint(Player,Point2D,int);

public static void KickToPoint(Player,Point2D,int,out Command);

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | KickToObject


BasicActions.KickToPoint Method (Player, Point2D, Int32)

public static Command KickToPoint(
Player pPlayer,
Point2D pPoint,
int pPower
);

Parameters

pPlayer
The player
pPoint
The position to kick to
pPower
The power to kick with. Should not exceed MaxPower and MinPower.

Return Value

The action command for the kick

Remarks

This method does not send any command to the server, it is therefore up to the agent to execute the command on the server.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicActions.KickToPoint Overload List | KickToObject


BasicActions.KickToPoint Method (Player, Point2D, Int32, Command)

public static void KickToPoint(
Player pPlayer,
Point2D pPoint,
int pPower,
out Command pAction
);

Parameters

pPlayer
The player
pPoint
The position to kick to
pPower
The power to kick with. Should not exceed MaxPower and MinPower.
pAction
The action command for the kick

Remarks

This method does not send any command to the server, it is therefore up to the agent to execute the command on the server.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicActions.KickToPoint Overload List | KickToObject


LookAtObject Method

CRaPI - Correct Robust and Perfect API

BasicActions.LookAtObject Method

Generates a command to turn the neck to look at an object

Overload List

public static Command LookAtObject(Player,FieldObject);

public static void LookAtObject(Player,FieldObject,out Command);

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | LookAtPoint


BasicActions.LookAtObject Method (Player, FieldObject)

public static Command LookAtObject(
Player pPlayer,
FieldObject pObject
);

Parameters

pPlayer
The player.
pObject
The object to look at.

Return Value

The action command for the turn-neck.

Remarks

It is not possible to turn the neck, if the angle to the point is more than MaxNeckAngle or less than MinNeckAngle relative the players body direction

If it is not possible to turn the neck sufficiently (looking directly at the object), the turn_neck will be as good as possible, i.e. the HeadAngle will be either MaxNeckAngle or MinNeckAngle after the command.

This method does not send any command to the server, it is therefore up to the agent to execute the command on the server.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicActions.LookAtObject Overload List | LookAtPoint


BasicActions.LookAtObject Method (Player, FieldObject, Command)

public static void LookAtObject(
Player pPlayer,
FieldObject pObject,
out Command action
);

Parameters

pPlayer
The player.
pObject
The object to look at.
action
The action command for the turn-neck.

Remarks

It is not possible to turn the neck, if the angle to the point is more than MaxNeckAngle or less than MinNeckAngle relative the players body direction

If it is not possible to turn the neck sufficiently (looking directly at the object), the turn_neck will be as good as possible, i.e. the HeadAngle will be either MaxNeckAngle or MinNeckAngle after the command.

This method does not send any command to the server, it is therefore up to the agent to execute the command on the server.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicActions.LookAtObject Overload List | LookAtPoint


LookAtPoint Method

CRaPI - Correct Robust and Perfect API

BasicActions.LookAtPoint Method

Generates a command to turn the neck to look at a point

Overload List

public static Command LookAtPoint(Player,Point2D);

public static void LookAtPoint(Player,Point2D,out Command);

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | LookAtObject


BasicActions.LookAtPoint Method (Player, Point2D)

public static Command LookAtPoint(
Player pPlayer,
Point2D pPoint
);

Parameters

pPlayer
The player.
pPoint
The point to look at.

Return Value

The action command for the turn-neck.

Remarks

It is not possible to turn the neck, if the angle to the point is more than MaxNeckAngle or less than MinNeckAngle relative the players body direction

If it is not possible to turn the neck sufficiently (looking directly at the point), the turn_neck will be as good as possible, i.e. the HeadAngle will be either MaxNeckAngle or MinNeckAngle after the command.

This method does not send any command to the server, it is therefore up to the agent to execute the command on the server.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicActions.LookAtPoint Overload List | LookAtObject


BasicActions.LookAtPoint Method (Player, Point2D, Command)

public static void LookAtPoint(
Player pPlayer,
Point2D pPoint,
out Command action
);

Parameters

pPlayer
The player.
pPoint
The point to look at.
action
The action command for the turn-neck.

Remarks

It is not possible to turn the neck, if the angle to the point is more than MaxNeckAngle or less than MinNeckAngle relative the players body direction

If it is not possible to turn the neck sufficiently (looking directly at the point), the turn_neck will be as good as possible, i.e. the HeadAngle will be either MaxNeckAngle or MinNeckAngle after the command.

This method does not send any command to the server, it is therefore up to the agent to execute the command on the server.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicActions.LookAtPoint Overload List | LookAtObject


BasicActions.TurnAndLookAtPoint Method

Generates a command to turn the body towards a point, and sets the HeadAngle to zero, i.e. the player is looking in the direction of the body.

public static Command[] TurnAndLookAtPoint(
Player pPlayer,
Point2D pPoint
);

Parameters

pPlayer
The player
pPoint
The point to turn to

Return Value

The action commands for the turn and turn-neck

Remarks

This method does not send any command to the server, it is therefore up to the agent to execute the command on the server.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | TurnToPoint | LookAtPoint


TurnToObject Method

CRaPI - Correct Robust and Perfect API

BasicActions.TurnToObject Method

Generates a command to turn the body towards an object.

Overload List

public static Command TurnToObject(Player,FieldObject);

public static void TurnToObject(Player,FieldObject,out Command);

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | TurnToPoint


BasicActions.TurnToObject Method (Player, FieldObject)

public static Command TurnToObject(
Player pPlayer,
FieldObject pObject
);

Parameters

pPlayer
The player
pObject
The object to look at

Return Value

The action command for the turn

Remarks

The player is turned so the AbsoluteBodyDirection equals the angle between the players position and the object. This means that even if the object is visible before the turn, the object could go out of view after the turn. This method just makes sure the body has the right angle towards the object.

This method does not send any command to the server, it is therefore up to the agent to execute the command on the server.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicActions.TurnToObject Overload List | TurnToPoint


BasicActions.TurnToObject Method (Player, FieldObject, Command)

public static void TurnToObject(
Player pPlayer,
FieldObject pObject,
out Command action
);

Parameters

pPlayer
The player
pObject
The object to look at
action
The action command for the turn

Remarks

The player is turned so the AbsoluteBodyDirection equals the angle between the players position and the object. This means that even if the object is visible before the turn, the object could go out of view after the turn. This method just makes sure the body has the right angle towards the object.

This method does not send any command to the server, it is therefore up to the agent to execute the command on the server.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicActions.TurnToObject Overload List | TurnToPoint


TurnToPoint Method

CRaPI - Correct Robust and Perfect API

BasicActions.TurnToPoint Method

Generates a command to turn the body towards a point.

Overload List

public static Command TurnToPoint(Player,Point2D);

public static void TurnToPoint(Player,Point2D,out Command);

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | TurnToObject


BasicActions.TurnToPoint Method (Player, Point2D)

public static Command TurnToPoint(
Player pPlayer,
Point2D pPoint
);

Parameters

pPlayer
The player
pPoint
The point to look at

Return Value

The action command for the turn

Remarks

The player is turned so the AbsoluteBodyDirection equals the angle between the players position and the point. This means that even if the point is visible before the turn, the point could go out of view after the turn. This method just makes sure the body has the right angle towards the point.

This method does not send any command to the server, it is therefore up to the agent to execute the command on the server.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicActions.TurnToPoint Overload List | TurnToObject


BasicActions.TurnToPoint Method (Player, Point2D, Command)

public static void TurnToPoint(
Player pPlayer,
Point2D pPoint,
out Command action
);

Parameters

pPlayer
The player
pPoint
The point to look at
action
The action command for the turn

Remarks

The player is turned so the AbsoluteBodyDirection equals the angle between the players position and the point. This means that even if the point is visible before the turn, the point could go out of view after the turn. This method just makes sure the body has the right angle towards the point.

This method does not send any command to the server, it is therefore up to the agent to execute the command on the server.

See Also

BasicActions Class | TeamYaffa.CRaPI Namespace | BasicActions.TurnToPoint Overload List | TurnToObject


BasicCommands Class

This class provides the command strings for the basic commands available in the server.

For a list of all members of this type, see BasicCommands Members.

System.Object
BasicCommands

public class BasicCommands

Requirements

Namespace: TeamYaffa.CRaPI

Assembly: CRaPI (in CRaPI.dll)

See Also

BasicCommands Members | TeamYaffa.CRaPI Namespace


BasicCommands Members

BasicCommands overview

Public Static Methods

Bye | Builds the server command string for the bye command
Catch | Builds the server command string for the catch command
ChangeView | Builds the server command string for the change_view command
Dash | Builds the server command string for the dash command
Kick | Builds the server command string for the kick command
Move | Overloaded. Builds the server command string for the move command
Say | Builds the server command string for the say command
Score | Builds the server command string for the score command
SenseBody | Builds the server command string for the sense_body command
Turn | Builds the server command string for the turn command
TurnNeck | Builds the server command string for the turn_neck command

Public Instance Constructors

BasicCommands Constructor Initializes a new instance of the BasicCommands class.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

BasicCommands Class | TeamYaffa.CRaPI Namespace


BasicCommands Constructor

Initializes a new instance of the BasicCommands class.

public BasicCommands();

See Also

BasicCommands Class | TeamYaffa.CRaPI Namespace


BasicCommands Methods

The methods of the BasicCommands class are listed below. For a complete list of BasicCommands class members, see the BasicCommands Members topic.

Public Static Methods

Bye | Builds the server command string for the bye command
Catch | Builds the server command string for the catch command
ChangeView | Builds the server command string for the change_view command
Dash | Builds the server command string for the dash command
Kick | Builds the server command string for the kick command
Move | Overloaded. Builds the server command string for the move command
Say | Builds the server command string for the say command
Score | Builds the server command string for the score command
SenseBody | Builds the server command string for the sense_body command
Turn | Builds the server command string for the turn command
TurnNeck | Builds the server command string for the turn_neck command

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

BasicCommands Class | TeamYaffa.CRaPI Namespace


BasicCommands.Bye Method

Builds the server command string for the bye command

public static Command Bye();

Return Value

See Also

BasicCommands Class | TeamYaffa.CRaPI Namespace


BasicCommands.Catch Method

Builds the server command string for the catch command

public static Command Catch(
int pDirection
);

Parameters

pDirection
The direction to catch in

Return Value

A Command

See Also

BasicCommands Class | TeamYaffa.CRaPI Namespace


BasicCommands.ChangeView Method

Builds the server command string for the change_view command

public static Command ChangeView(
ViewWidth pWidth,
ViewQuality pQuality
);

Parameters

pWidth
The view width
pQuality
The view quality

Return Value

A Command

See Also

BasicCommands Class | TeamYaffa.CRaPI Namespace


BasicCommands.Dash Method

Builds the server command string for the dash command

public static Command Dash(
int pPower
);

Parameters

pPower
The power to dash with

Return Value

A Command

See Also

BasicCommands Class | TeamYaffa.CRaPI Namespace


BasicCommands.Kick Method

Builds the server command string for the kick command

public static Command Kick(
int pPower,
int pDirection
);

Parameters

pPower
The power to kick with
pDirection
The direction to kick in

Return Value

A Command

See Also

BasicCommands Class | TeamYaffa.CRaPI Namespace


Move Method

CRaPI - Correct Robust and Perfect API

BasicCommands.Move Method

Builds the server command string for the move command

Overload List

Builds the server command string for the move command

public static Command Move(int,int);

Builds the server command string for the move command

public static Command Move(Point2D);

See Also

BasicCommands Class | TeamYaffa.CRaPI Namespace


BasicCommands.Move Method (Int32, Int32)

Builds the server command string for the move command

public static Command Move(
int pX,
int pY
);

Parameters

pX
The X-Coordinate to move to
pY
The Y-Coordinate to move to

Return Value

A Command

See Also

BasicCommands Class | TeamYaffa.CRaPI Namespace | BasicCommands.Move Overload List


BasicCommands.Move Method (Point2D)

Builds the server command string for the move command

public static Command Move(
Point2D pPoint
);

Parameters

pPoint
The point to move to

Return Value

A Command

See Also

BasicCommands Class | TeamYaffa.CRaPI Namespace | BasicCommands.Move Overload List


BasicCommands.Say Method

Builds the server command string for the say command

public static Command Say(
string pMessage
);

Parameters

pMessage
The message to say

Return Value

A Command

See Also

BasicCommands Class | TeamYaffa.CRaPI Namespace


BasicCommands.Score Method

Builds the server command string for the score command

public static Command Score();

Return Value

A Command

See Also

BasicCommands Class | TeamYaffa.CRaPI Namespace


BasicCommands.SenseBody Method

Builds the server command string for the sense_body command

public static Command SenseBody();

Return Value

A Command

See Also

BasicCommands Class | TeamYaffa.CRaPI Namespace


BasicCommands.Turn Method

Builds the server command string for the turn command

public static Command Turn(
int pDegrees
);

Parameters

pDegrees
The degrees to turn

Return Value

A Command

See Also

BasicCommands Class | TeamYaffa.CRaPI Namespace


BasicCommands.TurnNeck Method

Builds the server command string for the turn_neck command

public static Command TurnNeck(
int pDegrees
);

Parameters

pDegrees
The degrees to turn the neck

Return Value

A Command

See Also

BasicCommands Class | TeamYaffa.CRaPI Namespace


Clock Class

This class is used as an internal clock of CRaPI.

For a list of all members of this type, see Clock Members.

System.Object
Clock

public class Clock

Remarks

It is used to keep track of how long time it is left before next cycle, i.e. when we must send a command to the server so that it will be performed in this cycle.

Requirements

Namespace: TeamYaffa.CRaPI

Assembly: CRaPI (in CRaPI.dll)

See Also

Clock Members | TeamYaffa.CRaPI Namespace


Clock Members

Clock overview

Public Instance Constructors

Clock Constructor Constructs a new clock.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString | This method returns the state of the clock.

Public Instance Events

TickOnCycleSoonEnding | Raised due to the TicksLeftToSendEvent there should be left on the current cycle.
TickOverTimeOnCycle | How much time has passed a cycle duration
TickPlayOff | Raised every TimeInterval, if the game state is play off.
TickPlayOn | Raised every TimeInterval, if the games state is play on.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
OnTick | When the internal CRaPI clock ticks the subsribed events will be raised due to its specified raise condtions TickPlayOn

See Also

Clock Class | TeamYaffa.CRaPI Namespace


Clock Constructor

Constructs a new clock.

public Clock();

Remarks

Default value for time interval is 10 milliseconds, cycle duration is 100 milliseconds and tick to send event is 0 and that means no TickOnCycleSoonEnding will be raised.

See Also

Clock Class | TeamYaffa.CRaPI Namespace


Clock Methods

The methods of the Clock class are listed below. For a complete list of Clock class members, see the Clock Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString | This method returns the state of the clock.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
OnTick | When the internal CRaPI clock ticks the subsribed events will be raised due to its specified raise condtions TickPlayOn

See Also

Clock Class | TeamYaffa.CRaPI Namespace


Clock.OnTick Method

When the internal CRaPI clock ticks the subsribed events will be raised due to its specified raise condtions TickPlayOn

protected void OnTick(
object o,
ElapsedEventArgs e
);

Parameters

o
The subscribed object
e
The elapsed event argument

Remarks

To get these events you have to subscribe them

Events

Event Type | Reason
TickPlayOn | Raised every specified time interval if the games state is play on
TickPlayOff | Raised every specified time interval if the game state is play off
TickOnCycleSoonEnding | Raised when cycle is soon ending
TickOverTimeOnCycle | Raised when time has passed a cycle duration

Example

This sample shows how to subscribe events in your code.

            Clock mClock = new Clock();
            mClock.TickPlayOn += new TimeEventHandler(OnTick);
            mClock.TickPlayOff += new TimeEventHandler(OnTick);

            public void OnTick(object sender, TimeEventArgs e)
            {
                Do something...
            }

See Also

Clock Class | TeamYaffa.CRaPI Namespace


Clock.ToString Method

This method returns the state of the clock.

public override string ToString();

Return Value

Cycle duration, time interval, and time left on the current cycle

See Also

Clock Class | TeamYaffa.CRaPI Namespace


Clock Events

The events of the Clock class are listed below. For a complete list of Clock class members, see the Clock Members topic.

Public Instance Events

TickOnCycleSoonEnding | Raised due to the TicksLeftToSendEvent there should be left on the current cycle.
TickOverTimeOnCycle | How much time has passed a cycle duration
TickPlayOff | Raised every TimeInterval, if the game state is play off.
TickPlayOn | Raised every TimeInterval, if the games state is play on.

See Also

Clock Class | TeamYaffa.CRaPI Namespace


Clock.TickOnCycleSoonEnding Event

Raised due to the TicksLeftToSendEvent there should be left on the current cycle.

public event TimeEventHandler TickOnCycleSoonEnding;

Event Data

The event handler receives an argument of type TimeEventArgs containing data related to this event. The following TimeEventArgs property provides information specific to this event.

Property | Description
Time | The time set by the event.

Remarks

Subscibe this event if you want to be notifed about cycle is soon ending.

See Also

Clock Class | TeamYaffa.CRaPI Namespace


Clock.TickOverTimeOnCycle Event

How much time has passed a cycle duration

public event TimeEventHandler TickOverTimeOnCycle;

Event Data

The event handler receives an argument of type TimeEventArgs containing data related to this event. The following TimeEventArgs property provides information specific to this event.

Property | Description
Time | The time set by the event.

Remarks

Subscibe this event if you want to be notified about how much time has passed of a cycle duration

See Also

Clock Class | TeamYaffa.CRaPI Namespace


Clock.TickPlayOff Event

Raised every TimeInterval, if the game state is play off.

public event TimeEventHandler TickPlayOff;

Event Data

The event handler receives an argument of type TimeEventArgs containing data related to this event. The following TimeEventArgs property provides information specific to this event.

Property | Description
Time | The time set by the event.

Remarks

Subscibe this event if you want to be notifed how much time have passed since the clock had been stopped.

See Also

Clock Class | TeamYaffa.CRaPI Namespace


Clock.TickPlayOn Event

Raised every TimeInterval, if the games state is play on.

public event TimeEventHandler TickPlayOn;

Event Data

The event handler receives an argument of type TimeEventArgs containing data related to this event. The following TimeEventArgs property provides information specific to this event.

Property | Description
Time | The time set by the event.

Remarks

Subscibe this event if you want to be notifed how much time there is left on the current cycle.

See Also

Clock Class | TeamYaffa.CRaPI Namespace


CommandQueue Class

Queue of Command objects.

For a list of all members of this type, see CommandQueue Members.

System.Object
CommandQueue

public class CommandQueue

Requirements

Namespace: TeamYaffa.CRaPI

Assembly: CRaPI (in CRaPI.dll)

See Also

CommandQueue Members | TeamYaffa.CRaPI Namespace


CommandQueue Members

CommandQueue overview

Public Instance Constructors

CommandQueue Constructor Constructs a CommandQueue

Public Instance Methods

Clear | Clears all commands in the internal queue
Dequeue | Dequeues and returns the first command in the queue
Enqueue | Overloaded. Adds a Command to the queue
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetCommand | Returns the first Command object in the queue with the CommandType pType
GetCommands | Returns all commands in the internal queue
GetCommandString | Returns the concatenated command string for all Command objects in the queue
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
Peek | Returns the first command in the queue
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Fields

mQueue The internal queue

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

CommandQueue Class | TeamYaffa.CRaPI Namespace


CommandQueue Constructor

Constructs a CommandQueue

public CommandQueue();

See Also

CommandQueue Class | TeamYaffa.CRaPI Namespace


CommandQueue Fields

The fields of the CommandQueue class are listed below. For a complete list of CommandQueue class members, see the CommandQueue Members topic.

Protected Instance Fields

mQueue The internal queue

See Also

CommandQueue Class | TeamYaffa.CRaPI Namespace


CommandQueue.mQueue Field

The internal queue

protected Queue mQueue;

See Also

CommandQueue Class | TeamYaffa.CRaPI Namespace


CommandQueue Methods

The methods of the CommandQueue class are listed below. For a complete list of CommandQueue class members, see the CommandQueue Members topic.

Public Instance Methods

Clear | Clears all commands in the internal queue
Dequeue | Dequeues and returns the first command in the queue
Enqueue | Overloaded. Adds a Command to the queue
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetCommand | Returns the first Command object in the queue with the CommandType pType
GetCommands | Returns all commands in the internal queue
GetCommandString | Returns the concatenated command string for all Command objects in the queue
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
Peek | Returns the first command in the queue
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

CommandQueue Class | TeamYaffa.CRaPI Namespace


CommandQueue.Clear Method

Clears all commands in the internal queue

public void Clear();

See Also

CommandQueue Class | TeamYaffa.CRaPI Namespace


CommandQueue.Dequeue Method

Dequeues and returns the first command in the queue

public Command Dequeue();

Return Value

The first command in the queue

See Also

CommandQueue Class | TeamYaffa.CRaPI Namespace


Enqueue Method

CRaPI - Correct Robust and Perfect API

CommandQueue.Enqueue Method

Adds an ArrayList of Commands to the queue

Overload List

Adds an ArrayList of Commands to the queue

public void Enqueue(ArrayList);

Adds a Command to the queue

public void Enqueue(Command);

Adds an array of Commands to the queue

public void Enqueue(Command[]);

See Also

CommandQueue Class | TeamYaffa.CRaPI Namespace


CommandQueue.Enqueue Method (ArrayList)

Adds an ArrayList of Commands to the queue

public void Enqueue(
ArrayList pCommands
);

Parameters

pCommands
An ArrayList of Commands

See Also

CommandQueue Class | TeamYaffa.CRaPI Namespace | CommandQueue.Enqueue Overload List


CommandQueue.Enqueue Method (Command)

Adds a Command to the queue

public void Enqueue(
Command pCommand
);

Parameters

pCommand
The command to add

See Also

CommandQueue Class | TeamYaffa.CRaPI Namespace | CommandQueue.Enqueue Overload List


CommandQueue.Enqueue Method (Command[])

Adds an array of Commands to the queue

public void Enqueue(
Command[] pCommands
);

Parameters

pCommands
An array of Commands

See Also

CommandQueue Class | TeamYaffa.CRaPI Namespace | CommandQueue.Enqueue Overload List


CommandQueue.GetCommand Method

Returns the first Command object in the queue with the CommandType pType

public Command GetCommand(
CommandType pType
);

Parameters

pType
The CommandType

Return Value

A Command

See Also

CommandQueue Class | TeamYaffa.CRaPI Namespace


CommandQueue.GetCommands Method

Returns all commands in the internal queue

public Queue GetCommands();

Return Value

A Queue of commands

See Also

CommandQueue Class | TeamYaffa.CRaPI Namespace


CommandQueue.GetCommandString Method

Returns the concatenated command string for all Command objects in the queue

public string GetCommandString();

Return Value

A command string

See Also

CommandQueue Class | TeamYaffa.CRaPI Namespace


CommandQueue.Peek Method

Returns the first command in the queue

public Command Peek();

Return Value

The first command in the queue

See Also

CommandQueue Class | TeamYaffa.CRaPI Namespace


HearEventArgs Class

This class is used when an event is fired because the player has received a hear message.

For a list of all members of this type, see HearEventArgs Members.

System.Object
EventArgs
HearEventArgs

public class HearEventArgs : EventArgs

Requirements

Namespace: TeamYaffa.CRaPI

Assembly: CRaPI (in CRaPI.dll)

See Also

HearEventArgs Members | TeamYaffa.CRaPI Namespace


HearEventArgs Members

HearEventArgs overview

Public Instance Constructors

HearEventArgs Constructor Creates a new HearEventArgs with the heard message.

Public Instance Properties

Message The message

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

HearEventArgs Class | TeamYaffa.CRaPI Namespace


HearEventArgs Constructor

Creates a new HearEventArgs with the heard message.

public HearEventArgs(
HearInfo pMessage
);

Parameters

pMessage
The message

See Also

HearEventArgs Class | TeamYaffa.CRaPI Namespace


HearEventArgs Properties

The properties of the HearEventArgs class are listed below. For a complete list of HearEventArgs class members, see the HearEventArgs Members topic.

Public Instance Properties

Message The message

See Also

HearEventArgs Class | TeamYaffa.CRaPI Namespace


HearEventArgs.Message Property

The message

public Info.HearInfo Message {get;}

See Also

HearEventArgs Class | TeamYaffa.CRaPI Namespace


MessageEventHandler Delegate

Handling event fired after a PlayerMessage has been processed

public delegate void MessageEventHandler(
object sender,
HearEventArgs arg
);

Requirements

Namespace: TeamYaffa.CRaPI

Assembly: CRaPI (in CRaPI.dll)

See Also

TeamYaffa.CRaPI Namespace


Player Class

This class is the core of the CRaPI API and the main loop of a soccer player

For a list of all members of this type, see Player Members.

System.Object
Player

public class Player

Requirements

Namespace: TeamYaffa.CRaPI

Assembly: CRaPI (in CRaPI.dll)

See Also

Player Members | TeamYaffa.CRaPI Namespace


Player Members

Player overview

Public Instance Constructors

Player Overloaded. Initializes a new instance of the Player class.

Public Instance Properties

BallIsCatchable | Determines if the ball is catchable.
BallIsKickable | Determines if the ball is kickable.
Clock | The internal clock
CommandQueue | The current CommandQueue
IsGoalie | Goalie or not
LastError | The last error that has occured.
OpponentScore | The current score of the opponent team
OwnScore | The current score of my team
PlayerTypes | The player types
PlayMode | The current PlayMode
PreviousCommandQueue | The previous CommandQueue
PreviousSenseBody | The previous SenseBody
ScoreDifferance | The differance between own score and opponent score
SenseBody | The SenseBody
ServerParam | The server parameters
StartPoint | The players starting point.
TeamName | Team name
TeamSide | Side [Left|Right]
UniformNumber | Uniform number
World | The WorldModel of this Player

Public Instance Methods

Connect | Overloaded. Connects the player to a RoboCup server
Disconnect | Disconnects the Player from the server
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
PlayGame | The Thread entry point and main loop for the player.
ReConnect | Reconnects the player to the previous server
Send | Sends the commands stored in the command queue
StartUp | Connects to the server and receives player_type, player_param, server_param from the server.
ToString | Creates a string representation of the Player

Public Instance Events

AfterCoachMessage | Event indicating that a CoachMessage has been handled
AfterNewCycle | Event indicating that a new cycle has started
AfterPlayerMessage | Event indicating that a PlayerMessage has been handled
AfterRefereeMessage | Event indicating that a RefereeMessage has been handled
AfterWorldModelUpdate | Event indicating that the WorldModel is updated
BeforeCoachMessage | Event indicating that a CoachMessage is to be handled
BeforeNewCycle | Event indicating that a new cycle is coming once the clock has been syncronized
BeforePlayerMessage | Event indicating that a PlayerMessage is to handled
BeforeRefereeMessage | Event indicating that a RefereeMessage is to be handled
BeforeWorldModelUpdate | Event indicating that the WorldModel is to be updated
PlayerParamReceived | Event indicating that a PlayerParam has been handled
ServerParamReceived | Event indicating that a ServerParam has been handled, and the worldmodel is updated.

Protected Instance Methods

Finalize | The finalizer disconnects the client from the server.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
OnAfterCoachMessage | Generates an AfterCoachMessage event
OnAfterNewCycle | Generates an AfterNewCycle event
OnAfterPlayerMessage | Generates an AfterPlayerMessage event
OnAfterRefereeMessage | Generates an AfterRefereeMessage event
OnAfterWorldModelUpdate | Generates an AfterWorldModelUpdate event
OnBeforeCoachMessage | Generates a BeforeCoachMessage event
OnBeforeNewCycle | Generates a BeforeNewCycle event
OnBeforePlayerMessage | Generates a BeforePlayerMessage event
OnBeforeRefereeMessage | Generates a BeforeRefereeMessage event
OnBeforeWorldModelUpdate | Generates a BeforeWorldModelUpdate event
OnPlayerParamReceived | Generates a PlayerParamReceived event
OnServerParamReceived | Generates a ServerParamReceived event

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player Constructor

Constructs a Player

Overload List

Constructs a Player

public Player(string,bool);

Constructs a Player

public Player(string,bool,Point2D);

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player Constructor (String, Boolean)

Constructs a Player

public Player(
string pTeamName,
bool pIsGoalie
);

Parameters

pTeamName
Name of team
pIsGoalie
If player is goalie or not

Remarks

The default StartPoint is set to (-20, 0).

See Also

Player Class | TeamYaffa.CRaPI Namespace | Player Constructor Overload List


Player Constructor (String, Boolean, Point2D)

Constructs a Player

public Player(
string pTeamName,
bool pIsGoalie,
Point2D pStartPosition
);

Parameters

pTeamName
Name of team
pIsGoalie
If player is goalie or not
pStartPosition
What position the player will start on when the game beginns or after goals.

See Also

Player Class | TeamYaffa.CRaPI Namespace | Player Constructor Overload List


Player Properties

The properties of the Player class are listed below. For a complete list of Player class members, see the Player Members topic.

Public Instance Properties

BallIsCatchable | Determines if the ball is catchable.
BallIsKickable | Determines if the ball is kickable.
Clock | The internal clock
CommandQueue | The current CommandQueue
IsGoalie | Goalie or not
LastError | The last error that has occured.
OpponentScore | The current score of the opponent team
OwnScore | The current score of my team
PlayerTypes | The player types
PlayMode | The current PlayMode
PreviousCommandQueue | The previous CommandQueue
PreviousSenseBody | The previous SenseBody
ScoreDifferance | The differance between own score and opponent score
SenseBody | The SenseBody
ServerParam | The server parameters
StartPoint | The players starting point.
TeamName | Team name
TeamSide | Side [Left|Right]
UniformNumber | Uniform number
World | The WorldModel of this Player

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.BallIsCatchable Property

Determines if the ball is catchable.

public bool BallIsCatchable {get;}

Property Value

true if the player is a goalie, the ball is seen in this cycle and the ball is within catchable length according to the server param.

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.BallIsKickable Property

Determines if the ball is kickable.

public bool BallIsKickable {get;}

Property Value

true if the ball is seen in this cycle and the ball is within Kickable margin according to the server param.

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.Clock Property

The internal clock

public Clock Clock {get;}

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.CommandQueue Property

The current CommandQueue

public CommandQueue CommandQueue {get;}

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.IsGoalie Property

Goalie or not

public bool IsGoalie {get;}

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.LastError Property

The last error that has occured.

public string LastError {get;}

Property Value

A string value representing the last error that has occured in the player.

Remarks

If any error occurs in the player (e.g. connection with the server) this is where the last error-value can be retrieved.

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.OpponentScore Property

The current score of the opponent team

public int OpponentScore {get;}

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.OwnScore Property

The current score of my team

public int OwnScore {get;}

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.PlayerTypes Property

The player types

public System.Collections.ArrayList PlayerTypes {get;}

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.PlayMode Property

The current PlayMode

public PlayMode PlayMode {get;}

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.PreviousCommandQueue Property

The previous CommandQueue

public CommandQueue PreviousCommandQueue {get;}

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.PreviousSenseBody Property

The previous SenseBody

public Info.SenseBody PreviousSenseBody {get;}

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.ScoreDifferance Property

The differance between own score and opponent score

public int ScoreDifferance {get;}

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.SenseBody Property

The SenseBody

public Info.SenseBody SenseBody {get;}

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.ServerParam Property

The server parameters

public Info.ServerParam ServerParam {get;}

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.StartPoint Property

The players starting point.

public Utility.Point2D StartPoint {get; set;}

Property Value

If the point is set to be on the opponents side (X > 0), the point is set to X * (-1). The is no check of the Y-value, since the player will be placed at the long-side of the field by the server in case the value is outside the field.

Remarks

This point is used when the player does a move. E.g. at the beginning of each half-time, or after a goal.

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.TeamName Property

Team name

public string TeamName {get;}

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.TeamSide Property

Side [Left|Right]

public Side TeamSide {get; set;}

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.UniformNumber Property

Uniform number

public int UniformNumber {get; set;}

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.World Property

The WorldModel of this Player

public World.WorldModel World {get;}

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player Methods

The methods of the Player class are listed below. For a complete list of Player class members, see the Player Members topic.

Public Instance Methods

Connect | Overloaded. Connects the player to a RoboCup server
Disconnect | Disconnects the Player from the server
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
PlayGame | The Thread entry point and main loop for the player.
ReConnect | Reconnects the player to the previous server
Send | Sends the commands stored in the command queue
StartUp | Connects to the server and receives player_type, player_param, server_param from the server.
ToString | Creates a string representation of the Player

Protected Instance Methods

Finalize | The finalizer disconnects the client from the server.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
OnAfterCoachMessage | Generates an AfterCoachMessage event
OnAfterNewCycle | Generates an AfterNewCycle event
OnAfterPlayerMessage | Generates an AfterPlayerMessage event
OnAfterRefereeMessage | Generates an AfterRefereeMessage event
OnAfterWorldModelUpdate | Generates an AfterWorldModelUpdate event
OnBeforeCoachMessage | Generates a BeforeCoachMessage event
OnBeforeNewCycle | Generates a BeforeNewCycle event
OnBeforePlayerMessage | Generates a BeforePlayerMessage event
OnBeforeRefereeMessage | Generates a BeforeRefereeMessage event
OnBeforeWorldModelUpdate | Generates a BeforeWorldModelUpdate event
OnPlayerParamReceived | Generates a PlayerParamReceived event
OnServerParamReceived | Generates a ServerParamReceived event

See Also

Player Class | TeamYaffa.CRaPI Namespace


Connect Method

CRaPI - Correct Robust and Perfect API

Player.Connect Method

Connects the player to a RoboCup server

Overload List

Connects the player to a RoboCup server

public bool Connect(string,int,int);

Connects the player to a RoboCup server

public bool Connect(string,int,int,int);

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.Connect Method (String, Int32, Int32)

Connects the player to a RoboCup server

public bool Connect(
string pHost,
int pPort,
int pTimeOut
);

Parameters

pHost
The url or ip of the host
pPort
The port to connect to on the host
pTimeOut
The time before a receive command time outs

Return Value

true if connect was successful

Remarks

The default client version is set to 8.

See Also

Player Class | TeamYaffa.CRaPI Namespace | Player.Connect Overload List


Player.Connect Method (String, Int32, Int32, Int32)

Connects the player to a RoboCup server

public bool Connect(
string pHost,
int pPort,
int pTimeOut,
int pClientVersion
);

Parameters

pHost
The url or ip of the host
pPort
The port to connect to on the host
pTimeOut
The time before a receive command time outs
pClientVersion
The version of the client.

Return Value

true if connect was successful

See Also

Player Class | TeamYaffa.CRaPI Namespace | Player.Connect Overload List


Player.Disconnect Method

Disconnects the Player from the server

public void Disconnect();

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.Finalize Method

The finalizer disconnects the client from the server.

protected override void Finalize();

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.OnAfterCoachMessage Method

Generates an AfterCoachMessage event

protected void OnAfterCoachMessage(
HearInfo arg
);

Parameters

arg
The message

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.OnAfterNewCycle Method

Generates an AfterNewCycle event

protected void OnAfterNewCycle(
int args
);

Parameters

args
The current cycle

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.OnAfterPlayerMessage Method

Generates an AfterPlayerMessage event

protected void OnAfterPlayerMessage(
HearInfo arg
);

Parameters

arg
The message

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.OnAfterRefereeMessage Method

Generates an AfterRefereeMessage event

protected void OnAfterRefereeMessage(
HearInfo arg
);

Parameters

arg
The message

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.OnAfterWorldModelUpdate Method

Generates an AfterWorldModelUpdate event

protected void OnAfterWorldModelUpdate();

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.OnBeforeCoachMessage Method

Generates a BeforeCoachMessage event

protected void OnBeforeCoachMessage();

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.OnBeforeNewCycle Method

Generates a BeforeNewCycle event

protected void OnBeforeNewCycle();

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.OnBeforePlayerMessage Method

Generates a BeforePlayerMessage event

protected void OnBeforePlayerMessage();

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.OnBeforeRefereeMessage Method

Generates a BeforeRefereeMessage event

protected void OnBeforeRefereeMessage();

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.OnBeforeWorldModelUpdate Method

Generates a BeforeWorldModelUpdate event

protected void OnBeforeWorldModelUpdate();

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.OnPlayerParamReceived Method

Generates a PlayerParamReceived event

protected void OnPlayerParamReceived();

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.OnServerParamReceived Method

Generates a ServerParamReceived event

protected void OnServerParamReceived();

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.PlayGame Method

The Thread entry point and main loop for the player.

public void PlayGame();

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.ReConnect Method

Reconnects the player to the previous server

public bool ReConnect();

Return Value

true if reconnect was successful, otherwise false

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.Send Method

Sends the commands stored in the command queue

public bool Send();

Return Value

true if the command could be sent, otherwise false

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.StartUp Method

Connects to the server and receives player_type, player_param, server_param from the server.

public bool StartUp(
string pHost,
int pPort,
int pTimeOut
);

Parameters

pHost
The url or ip of the host
pPort
The port to connect to on the host
pTimeOut
The time before a receive command time outs

Return Value

true if the start-up was successful

Remarks

This should be used instead of using manually Connect because this method won't return until all messages from the server that is necessary for the player is received.

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.ToString Method

Creates a string representation of the Player

public override string ToString();

Return Value

The string representation

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player Events

The events of the Player class are listed below. For a complete list of Player class members, see the Player Members topic.

Public Instance Events

AfterCoachMessage | Event indicating that a CoachMessage has been handled
AfterNewCycle | Event indicating that a new cycle has started
AfterPlayerMessage | Event indicating that a PlayerMessage has been handled
AfterRefereeMessage | Event indicating that a RefereeMessage has been handled
AfterWorldModelUpdate | Event indicating that the WorldModel is updated
BeforeCoachMessage | Event indicating that a CoachMessage is to be handled
BeforeNewCycle | Event indicating that a new cycle is coming once the clock has been syncronized
BeforePlayerMessage | Event indicating that a PlayerMessage is to handled
BeforeRefereeMessage | Event indicating that a RefereeMessage is to be handled
BeforeWorldModelUpdate | Event indicating that the WorldModel is to be updated
PlayerParamReceived | Event indicating that a PlayerParam has been handled
ServerParamReceived | Event indicating that a ServerParam has been handled, and the worldmodel is updated.

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.AfterCoachMessage Event

Event indicating that a CoachMessage has been handled

public event MessageEventHandler AfterCoachMessage;

Event Data

The event handler receives an argument of type HearEventArgs containing data related to this event. The following HearEventArgs property provides information specific to this event.

Property | Description
Message | The message

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.AfterNewCycle Event

Event indicating that a new cycle has started

public event TimeEventHandler AfterNewCycle;

Event Data

The event handler receives an argument of type TimeEventArgs containing data related to this event. The following TimeEventArgs property provides information specific to this event.

Property | Description
Time | The time set by the event.

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.AfterPlayerMessage Event

Event indicating that a PlayerMessage has been handled

public event MessageEventHandler AfterPlayerMessage;

Event Data

The event handler receives an argument of type HearEventArgs containing data related to this event. The following HearEventArgs property provides information specific to this event.

Property | Description
Message | The message

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.AfterRefereeMessage Event

Event indicating that a RefereeMessage has been handled

public event MessageEventHandler AfterRefereeMessage;

Event Data

The event handler receives an argument of type HearEventArgs containing data related to this event. The following HearEventArgs property provides information specific to this event.

Property | Description
Message | The message

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.AfterWorldModelUpdate Event

Event indicating that the WorldModel is updated

public event EventHandler AfterWorldModelUpdate;

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.BeforeCoachMessage Event

Event indicating that a CoachMessage is to be handled

public event EventHandler BeforeCoachMessage;

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.BeforeNewCycle Event

Event indicating that a new cycle is coming once the clock has been syncronized

public event EventHandler BeforeNewCycle;

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.BeforePlayerMessage Event

Event indicating that a PlayerMessage is to handled

public event EventHandler BeforePlayerMessage;

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.BeforeRefereeMessage Event

Event indicating that a RefereeMessage is to be handled

public event EventHandler BeforeRefereeMessage;

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.BeforeWorldModelUpdate Event

Event indicating that the WorldModel is to be updated

public event EventHandler BeforeWorldModelUpdate;

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.PlayerParamReceived Event

Event indicating that a PlayerParam has been handled

public event EventHandler PlayerParamReceived;

See Also

Player Class | TeamYaffa.CRaPI Namespace


Player.ServerParamReceived Event

Event indicating that a ServerParam has been handled, and the worldmodel is updated.

public event EventHandler ServerParamReceived;

See Also

Player Class | TeamYaffa.CRaPI Namespace


PlayMode Enumeration

A type-safe representation of the different play modes.

public enum PlayMode

Remarks

By giving the different playmodes the same name as the server uses, it is possible to do a string-comparison.

Members

Member Name | Description
before_kick_off | At the beginning of a half. Subsequent play mode (0 cycles): kick_off_l | kick_off_r
corner_kick_l | Left team has a corner kick
corner_kick_r | Right team has a corner kick
drop_ball | Subsequent play mode (0 cycles): play_on
free_kick_l | Left team has a free kick
free_kick_r | Right team has a free kick
goal_kick_l | Play mode changes once the ball leaves the penalty area. Subsequent play mode: play_on
goal_kick_r | Play mode changes once the ball leaves the penalty area. Subsequent play mode: play_on
goal_l | Goal for left team. Subsequent play mode (50 cycles): kick_off_r
goal_r | Goal for right team. Subsequent play mode (50 cycles): kick_off_l
kick_in_l | Left team has a kick in
kick_in_r | Right team has a kick in
kick_off_l | Announce start of play where left team have the kick off (after pressing the Kick Off button in the monitor)
kick_off_r | Announce start of play where right team have the kick off (after pressing the Kick Off button in the monitor)
none | The playmode is unknown, not set, or could not be parsed from the last referee message.
offside_l | Subsequent play mode (30 cycles): free_kick_r
offside_r | Subsequent play mode (30 cycles): free_kick_l
play_on | During normal play
time_over | End of game

Requirements

Namespace: TeamYaffa.CRaPI

Assembly: CRaPI (in CRaPI.dll)

See Also

TeamYaffa.CRaPI Namespace


RefereeMessage Enumeration

A type-safe representation of the different referee messages

public enum RefereeMessage

Members

Member Name | Description
back_pass_l | Left team did a back-pass to the goalie (this message is undocumented in the manual).
back_pass_r | Right team did a back-pass to the goalie (this message is undocumented in the manual).
free_kick_fault_l | Left team performed an illegal free kick (this message is undocumented in the manual).
free_kick_fault_r | Right team performed an illegal free kick (this message is undocumented in the manual).
foul_l | Announce that left team has made a foul. Subsequent play mode (0 cycles): free_kick_r
foul_r | Announce that right team has made a foul. Subsequent play mode (0 cycles): free_kick_l
goalie_catch_ball_l | Subsequent play mode (0 cycles): free_kick_r (seems odd?)
goalie_catch_ball_r | Subsequent play mode (0 cycles): free_kick_l (seems odd?)
goal_l_ | Not complete! Server sends goal_l_n, which announces the n:th goal for left team. Subsequent play mode (50 cycles): kick_off_r
goal_r_ | Not complete! Server sends goal_r_n, which announces the n:th goal for right team. Subsequent play mode (50 cycles): kick_off_l
half_time | Subsequent play mode (0 cycles): before_kick_off
time_extended | Subsequent play mode (0 cycles): before_kick_off
time_up | Sent once the game is over (if the time >= second half and the scores for each team are different). Subsequent play mode (0 cycles): time_over
time_up_without_a_team | Sent if there was no opponent until the end of the second half. Subsequent play mode (0 cycles): time_over
none | Used if the Referee-message could not be recognized.

Requirements

Namespace: TeamYaffa.CRaPI

Assembly: CRaPI (in CRaPI.dll)

See Also

TeamYaffa.CRaPI Namespace


Side Enumeration

Describes what team-side the player is playing with, i.e. what side of the field the player is starting on.

public enum Side

Members

Member Name | Description
Left | The player starts at the left side of the play field. Left is implemented as the character l, which means that it can be used with comparisons whith messages from the server.
Right | The player starts at the right side of the play field. Right is implemented as the character r, which means that it can be used with comparisons whith messages from the server.

Requirements

Namespace: TeamYaffa.CRaPI

Assembly: CRaPI (in CRaPI.dll)

See Also

TeamYaffa.CRaPI Namespace


TimeEventArgs Class

This class is used by events fired and time is concered.

For a list of all members of this type, see TimeEventArgs Members.

System.Object
EventArgs
TimeEventArgs

public class TimeEventArgs : EventArgs

Remarks

Use this when fireing events where e.g. time should be sent to the receivers. Time can be time left on cycle, time of current cycle or current cycle number, depending on the event.

Requirements

Namespace: TeamYaffa.CRaPI

Assembly: CRaPI (in CRaPI.dll)

See Also

TimeEventArgs Members | TeamYaffa.CRaPI Namespace


TimeEventArgs Members

TimeEventArgs overview

Public Instance Constructors

TimeEventArgs Constructor Creates a new TimeEventArgs with the specified time.

Public Instance Properties

Time The time set by the event.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

TimeEventArgs Class | TeamYaffa.CRaPI Namespace


TimeEventArgs Constructor

Creates a new TimeEventArgs with the specified time.

public TimeEventArgs(
int pTime
);

Parameters

pTime
The time set by the event.

See Also

TimeEventArgs Class | TeamYaffa.CRaPI Namespace


TimeEventArgs Properties

The properties of the TimeEventArgs class are listed below. For a complete list of TimeEventArgs class members, see the TimeEventArgs Members topic.

Public Instance Properties

Time The time set by the event.

See Also

TimeEventArgs Class | TeamYaffa.CRaPI Namespace


TimeEventArgs.Time Property

The time set by the event.

public int Time {get;}

See Also

TimeEventArgs Class | TeamYaffa.CRaPI Namespace


TimeEventHandler Delegate

Delegate for time events.

public delegate void TimeEventHandler(
object sender,
TimeEventArgs e
);

Requirements

Namespace: TeamYaffa.CRaPI

Assembly: CRaPI (in CRaPI.dll)

See Also

TeamYaffa.CRaPI Namespace


ViewQuality Enumeration

Describes the view quality of the player

public enum ViewQuality

Remarks

The player can influence the frequency and quality of the visual information by changing ViewQuality and ViewWidth.

For a more detailed description how the view quality affects the player, you are encouraged to read Vision sensor model of the server manual.

If the view quality can not be determined, it should be set to unknown.

Members

Member Name | Description
high | High view quality.
low | Low view quality.
unknown | The quality is unknown, not set, or could not be parsed from the sense-body message.

Requirements

Namespace: TeamYaffa.CRaPI

Assembly: CRaPI (in CRaPI.dll)

See Also

TeamYaffa.CRaPI Namespace


ViewWidth Enumeration

Describes the width of the "view cone" of the player

public enum ViewWidth

Remarks

The player can influence the frequency and quality of the visual information by changing ViewWidth and ViewQuality.

For a more detailed description how the view quality affects the player, you are encouraged to read Vision sensor model of the server manual.

If the view width can not be determined, it should be set to unknown.

Members

Member Name | Description
narrow | Narrow view width.
normal | Normal view width.
wide | Wide view width.
unknown | The width is unknown, not set, or could not be parsed from the sense-body message.

Requirements

Namespace: TeamYaffa.CRaPI

Assembly: CRaPI (in CRaPI.dll)

See Also

TeamYaffa.CRaPI Namespace


TeamYaffa.CRaPI.Commands

CRaPI - Correct Robust and Perfect API

TeamYaffa.CRaPI.Commands Namespace

Classes

Class | Description
Catch | A wrapper for a catch command.
ChangeView | A wrapper for a change_view command.
Command | This class acts as a wrapper around a server command
Dash | A wrapper for a dash command.
Kick | A wrapper for a kick command.
Move | A wrapper for a move command.
Say | A wrapper for a say command.
Turn | A wrapper for a turn command.
TurnNeck | A wrapper for a turn_neck command.

Enumerations

Enumeration | Description
CommandType | Describes the possible commands to the server


Catch Class

A wrapper for a catch command.

For a list of all members of this type, see Catch Members.

System.Object
Command
Catch

public class Catch : Command

Requirements

Namespace: TeamYaffa.CRaPI.Commands

Assembly: CRaPI (in CRaPI.dll)

See Also

Catch Members | TeamYaffa.CRaPI.Commands Namespace


Catch Members

Catch overview

Public Instance Constructors

Catch Constructor Constructs a Catch command object

Public Instance Properties

CommandString (inherited from Command) | The command string
CommandType (inherited from Command) | The command type
Direction | The angle where to catch, relative the players body-direction.

Public Instance Methods

Equals (inherited from Command) | Compares if the Command-object are equal another object.
GetHashCode (inherited from Command) | Returns the hashcode of the Command object.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Fields

mCommand (inherited from Command) | The command string
mCommandType (inherited from Command) | The command type

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Catch Class | TeamYaffa.CRaPI.Commands Namespace


Catch Constructor

Constructs a Catch command object

public Catch(
int pDirection
);

Parameters

pDirection
The angle to catch relative the players body-direction.

Remarks

The command will of the form:

(catch pDirection)

See Also

Catch Class | TeamYaffa.CRaPI.Commands Namespace


Catch Properties

The properties of the Catch class are listed below. For a complete list of Catch class members, see the Catch Members topic.

Public Instance Properties

CommandString (inherited from Command) | The command string
CommandType (inherited from Command) | The command type
Direction | The angle where to catch, relative the players body-direction.

See Also

Catch Class | TeamYaffa.CRaPI.Commands Namespace


Catch.Direction Property

The angle where to catch, relative the players body-direction.

public int Direction {get; set;}

See Also

Catch Class | TeamYaffa.CRaPI.Commands Namespace


ChangeView Class

A wrapper for a change_view command.

For a list of all members of this type, see ChangeView Members.

System.Object
Command
ChangeView

public class ChangeView : Command

Requirements

Namespace: TeamYaffa.CRaPI.Commands

Assembly: CRaPI (in CRaPI.dll)

See Also

ChangeView Members | TeamYaffa.CRaPI.Commands Namespace


ChangeView Members

ChangeView overview

Public Instance Constructors

ChangeView Constructor Constructs a ChangeView command object

Public Instance Properties

CommandString (inherited from Command) | The command string
CommandType (inherited from Command) | The command type
ViewQuality | The quality of the view
ViewWidth | The width of the view

Public Instance Methods

Equals (inherited from Command) | Compares if the Command-object are equal another object.
GetHashCode (inherited from Command) | Returns the hashcode of the Command object.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Fields

mCommand (inherited from Command) | The command string
mCommandType (inherited from Command) | The command type

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

ChangeView Class | TeamYaffa.CRaPI.Commands Namespace


ChangeView Constructor

Constructs a ChangeView command object

public ChangeView(
ViewWidth pWidth,
ViewQuality pQuality
);

Parameters

pWidth
The width of the view
pQuality
The quality of the view

Remarks

The command will of the form:

(change_view pWidth pQuality)

See Also

ChangeView Class | TeamYaffa.CRaPI.Commands Namespace


ChangeView Properties

The properties of the ChangeView class are listed below. For a complete list of ChangeView class members, see the ChangeView Members topic.

Public Instance Properties

CommandString (inherited from Command) | The command string
CommandType (inherited from Command) | The command type
ViewQuality | The quality of the view
ViewWidth | The width of the view

See Also

ChangeView Class | TeamYaffa.CRaPI.Commands Namespace


ChangeView.ViewQuality Property

The quality of the view

public TeamYaffa.CRaPI.ViewQuality ViewQuality {get; set;}

See Also

ChangeView Class | TeamYaffa.CRaPI.Commands Namespace


ChangeView.ViewWidth Property

The width of the view

public TeamYaffa.CRaPI.ViewWidth ViewWidth {get; set;}

See Also

ChangeView Class | TeamYaffa.CRaPI.Commands Namespace


Command Class

This class acts as a wrapper around a server command

For a list of all members of this type, see Command Members.

System.Object
Command

public class Command

Requirements

Namespace: TeamYaffa.CRaPI.Commands

Assembly: CRaPI (in CRaPI.dll)

See Also

Command Members | TeamYaffa.CRaPI.Commands Namespace


Command Members

Command overview

Public Static Operators

Equality Operator | Compares two Command objects for equality
Inequality Operator | Compares two Command objects for inequality

Public Instance Constructors

Command Overloaded. Initializes a new instance of the Command class.

Public Instance Properties

CommandString | The command string
CommandType | The command type

Public Instance Methods

Equals | Compares if the Command-object are equal another object.
GetHashCode | Returns the hashcode of the Command object.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Fields

mCommand | The command string
mCommandType | The command type

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Command Class | TeamYaffa.CRaPI.Commands Namespace


Command Constructor

Constructs a Command object

Overload List

Default constructor

public Command();

Constructs a Command object

public Command(CommandType);

See Also

Command Class | TeamYaffa.CRaPI.Commands Namespace


Command Constructor (CommandType)

Constructs a Command object

public Command(
CommandType pCommandType
);

Parameters

pCommandType
What type of command it will be.

Remarks

The command will look like:

(pCommandType.ToString().ToLower())

See Also

Command Class | TeamYaffa.CRaPI.Commands Namespace | Command Constructor Overload List


Command Constructor ()

Default constructor

public Command();

See Also

Command Class | TeamYaffa.CRaPI.Commands Namespace | Command Constructor Overload List


Command Fields

The fields of the Command class are listed below. For a complete list of Command class members, see the Command Members topic.

Protected Instance Fields

mCommand | The command string
mCommandType | The command type

See Also

Command Class | TeamYaffa.CRaPI.Commands Namespace


Command.mCommand Field

The command string

protected string mCommand;

See Also

Command Class | TeamYaffa.CRaPI.Commands Namespace


Command.mCommandType Field

The command type

protected CommandType mCommandType;

See Also

Command Class | TeamYaffa.CRaPI.Commands Namespace


Command Properties

The properties of the Command class are listed below. For a complete list of Command class members, see the Command Members topic.

Public Instance Properties

CommandString | The command string
CommandType | The command type

See Also

Command Class | TeamYaffa.CRaPI.Commands Namespace


Command.CommandString Property

The command string

public string CommandString {get; set;}

See Also

Command Class | TeamYaffa.CRaPI.Commands Namespace


Command.CommandType Property

The command type

public CommandType CommandType {get; set;}

See Also

Command Class | TeamYaffa.CRaPI.Commands Namespace


Command Methods

The methods of the Command class are listed below. For a complete list of Command class members, see the Command Members topic.

Public Instance Methods

Equals | Compares if the Command-object are equal another object.
GetHashCode | Returns the hashcode of the Command object.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Command Class | TeamYaffa.CRaPI.Commands Namespace


Command.Equals Method

Compares if the Command-object are equal another object.

public override bool Equals(
object o
);

Parameters

o
The object to compare with.

Return Value

true if equal, false otherwise.

Remarks

The o must be of type Command and be equal according to operator ==

See Also

Command Class | TeamYaffa.CRaPI.Commands Namespace


Command.GetHashCode Method

Returns the hashcode of the Command object.

public override int GetHashCode();

Return Value

An integer that represents the hashcode for this Command object

Remarks

The hashcode of the Command object is the same as the hashcode of the CommandString.

See Also

Command Class | TeamYaffa.CRaPI.Commands Namespace


Command Operators

The operators of the Command class are listed below. For a complete list of Command class members, see the Command Members topic.

Public Static Operators

Equality Operator | Compares two Command objects for equality
Inequality Operator | Compares two Command objects for inequality

See Also

Command Class | Command Members | TeamYaffa.CRaPI.Commands Namespace


Command Equality Operator

Compares two Command objects for equality

public static bool operator ==(
Command pCommand1,
Command pCommand2
);

Parameters

pCommand1
First Command object
pCommand2
Second Command object

Return Value

true if equal, otherwise false

Remarks

Two Command objects are equal if:

  • The references are equal
  • or the commandstrings and commandtypes are equal

See Also

Command Class | TeamYaffa.CRaPI.Commands Namespace


Command Inequality Operator

Compares two Command objects for inequality

public static bool operator !=(
Command pCommand1,
Command pCommand2
);

Parameters

pCommand1
First Command object
pCommand2
Second Command object

Return Value

true if equal, otherwise false

See Also

Command Class | TeamYaffa.CRaPI.Commands Namespace | op_Equality


CommandType Enumeration

Describes the possible commands to the server

public enum CommandType

Remarks

This is used when creating Commands.

Members

Member Name | Description
Bye | A bye command. Used when disconnecting a player.
Catch | A catch command. Used when a goalie tries to catch the ball.
Change_View | A change_view command. Used with ViewWidth and ViewQuality when the player changes the view.
Dash | A dash command. Used to dash.
Kick | A kick command. Used when to kick the ball.
Move | A move command. Used when to move the player when the PlayMode is before_kick_off.
Say | A say command.
Sense_Body | A sense_body command.
Score | A score command. Used to retrieve the current score of the game.
Turn | A turn command. Used to turn.
Turn_Neck | A turn_neck command. Used to turn the neck.

Requirements

Namespace: TeamYaffa.CRaPI.Commands

Assembly: CRaPI (in CRaPI.dll)

See Also

TeamYaffa.CRaPI.Commands Namespace | TeamYaffa.CRaPI.Commands


Dash Class

A wrapper for a dash command.

For a list of all members of this type, see Dash Members.

System.Object
Command
Dash

public class Dash : Command

Requirements

Namespace: TeamYaffa.CRaPI.Commands

Assembly: CRaPI (in CRaPI.dll)

See Also

Dash Members | TeamYaffa.CRaPI.Commands Namespace


Dash Members

Dash overview

Public Instance Constructors

Dash Constructor Constructs a Dash command object

Public Instance Properties

CommandString (inherited from Command) | The command string
CommandType (inherited from Command) | The command type
Power | The power to dash with

Public Instance Methods

Equals (inherited from Command) | Compares if the Command-object are equal another object.
GetHashCode (inherited from Command) | Returns the hashcode of the Command object.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Fields

mCommand (inherited from Command) | The command string
mCommandType (inherited from Command) | The command type

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Dash Class | TeamYaffa.CRaPI.Commands Namespace


Dash Constructor

Constructs a Dash command object

public Dash(
int pPower
);

Parameters

pPower
The power to dash with

Remarks

The command will of the form:

(dash pPower)

See Also

Dash Class | TeamYaffa.CRaPI.Commands Namespace


Dash Properties

The properties of the Dash class are listed below. For a complete list of Dash class members, see the Dash Members topic.

Public Instance Properties

CommandString (inherited from Command) | The command string
CommandType (inherited from Command) | The command type
Power | The power to dash with

See Also

Dash Class | TeamYaffa.CRaPI.Commands Namespace


Dash.Power Property

The power to dash with

public int Power {get; set;}

See Also

Dash Class | TeamYaffa.CRaPI.Commands Namespace


Kick Class

A wrapper for a kick command.

For a list of all members of this type, see Kick Members.

System.Object
Command
Kick

public class Kick : Command

Requirements

Namespace: TeamYaffa.CRaPI.Commands

Assembly: CRaPI (in CRaPI.dll)

See Also

Kick Members | TeamYaffa.CRaPI.Commands Namespace


Kick Members

Kick overview

Public Instance Constructors

Kick Constructor Constructs a Kick command object

Public Instance Properties

CommandString (inherited from Command) | The command string
CommandType (inherited from Command) | The command type
Direction | The angle to kick, relative the players own body-direction.
Power | Power of the kick

Public Instance Methods

Equals (inherited from Command) | Compares if the Command-object are equal another object.
GetHashCode (inherited from Command) | Returns the hashcode of the Command object.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Fields

mCommand (inherited from Command) | The command string
mCommandType (inherited from Command) | The command type

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Kick Class | TeamYaffa.CRaPI.Commands Namespace


Kick Constructor

Constructs a Kick command object

public Kick(
int pPower,
int pDirection
);

Parameters

pPower
Power of kick
pDirection
Angle where to kick, relative the players own body-direction.

Remarks

The command will of the form:

(kick pPower pDirection)

See Also

Kick Class | TeamYaffa.CRaPI.Commands Namespace


Kick Properties

The properties of the Kick class are listed below. For a complete list of Kick class members, see the Kick Members topic.

Public Instance Properties

CommandString (inherited from Command) | The command string
CommandType (inherited from Command) | The command type
Direction | The angle to kick, relative the players own body-direction.
Power | Power of the kick

See Also

Kick Class | TeamYaffa.CRaPI.Commands Namespace


Kick.Direction Property

The angle to kick, relative the players own body-direction.

public int Direction {get; set;}

See Also

Kick Class | TeamYaffa.CRaPI.Commands Namespace


Kick.Power Property

Power of the kick

public int Power {get; set;}

See Also

Kick Class | TeamYaffa.CRaPI.Commands Namespace


Move Class

A wrapper for a move command.

For a list of all members of this type, see Move Members.

System.Object
Command
Move

public class Move : Command

Requirements

Namespace: TeamYaffa.CRaPI.Commands

Assembly: CRaPI (in CRaPI.dll)

See Also

Move Members | TeamYaffa.CRaPI.Commands Namespace


Move Members

Move overview

Public Instance Constructors

Move Overloaded. Initializes a new instance of the Move class.

Public Instance Properties

CommandString (inherited from Command) | The command string
CommandType (inherited from Command) | The command type
X | X-coordinate
Y | Y-coordinate

Public Instance Methods

Equals (inherited from Command) | Compares if the Command-object are equal another object.
GetHashCode (inherited from Command) | Returns the hashcode of the Command object.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Fields

mCommand (inherited from Command) | The command string
mCommandType (inherited from Command) | The command type

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Move Class | TeamYaffa.CRaPI.Commands Namespace


Move Constructor

Constructs a Move command object

Overload List

Constructs a Move command object

public Move(int,int);

Constructs a Move command object

public Move(Point2D);

See Also

Move Class | TeamYaffa.CRaPI.Commands Namespace


Move Constructor (Int32, Int32)

Constructs a Move command object

public Move(
int pX,
int pY
);

Parameters

pX
X-coordinate
pY
Y-coordinate

Remarks

The command will be of the form:

(move pX pY)

See Also

Move Class | TeamYaffa.CRaPI.Commands Namespace | Move Constructor Overload List


Move Constructor (Point2D)

Constructs a Move command object

public Move(
Point2D pPosition
);

Parameters

pPosition
The position to move to

Remarks

The command will be of the form:

(move pPosition.X pPosition.Y)

See Also

Move Class | TeamYaffa.CRaPI.Commands Namespace | Move Constructor Overload List


Move Properties

The properties of the Move class are listed below. For a complete list of Move class members, see the Move Members topic.

Public Instance Properties

CommandString (inherited from Command) | The command string
CommandType (inherited from Command) | The command type
X | X-coordinate
Y | Y-coordinate

See Also

Move Class | TeamYaffa.CRaPI.Commands Namespace


Move.X Property

X-coordinate

public int X {get; set;}

See Also

Move Class | TeamYaffa.CRaPI.Commands Namespace


Move.Y Property

Y-coordinate

public int Y {get; set;}

See Also

Move Class | TeamYaffa.CRaPI.Commands Namespace


Say Class

A wrapper for a say command.

For a list of all members of this type, see Say Members.

System.Object
Command
Say

public class Say : Command

Requirements

Namespace: TeamYaffa.CRaPI.Commands

Assembly: CRaPI (in CRaPI.dll)

See Also

Say Members | TeamYaffa.CRaPI.Commands Namespace


Say Members

Say overview

Public Instance Constructors

Say Constructor Constructs a Say command object

Public Instance Properties

CommandString (inherited from Command) | The command string
CommandType (inherited from Command) | The command type
Message | Message to say

Public Instance Methods

Equals (inherited from Command) | Compares if the Command-object are equal another object.
GetHashCode (inherited from Command) | Returns the hashcode of the Command object.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Fields

mCommand (inherited from Command) | The command string
mCommandType (inherited from Command) | The command type

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Say Class | TeamYaffa.CRaPI.Commands Namespace


Say Constructor

Constructs a Say command object

public Say(
string pMessage
);

Parameters

pMessage
Message to say

Remarks

The command will of the form:

(say pMessage)

See Also

Say Class | TeamYaffa.CRaPI.Commands Namespace


Say Properties

The properties of the Say class are listed below. For a complete list of Say class members, see the Say Members topic.

Public Instance Properties

CommandString (inherited from Command) | The command string
CommandType (inherited from Command) | The command type
Message | Message to say

See Also

Say Class | TeamYaffa.CRaPI.Commands Namespace


Say.Message Property

Message to say

public string Message {get; set;}

See Also

Say Class | TeamYaffa.CRaPI.Commands Namespace


Turn Class

A wrapper for a turn command.

For a list of all members of this type, see Turn Members.

System.Object
Command
Turn

public class Turn : Command

Requirements

Namespace: TeamYaffa.CRaPI.Commands

Assembly: CRaPI (in CRaPI.dll)

See Also

Turn Members | TeamYaffa.CRaPI.Commands Namespace


Turn Members

Turn overview

Public Instance Constructors

Turn Constructor Constructs a Turn command object

Public Instance Properties

CommandString (inherited from Command) | The command string
CommandType (inherited from Command) | The command type
Moment | The moment of the turn, i.e. how many degrees to turn.

Public Instance Methods

Equals (inherited from Command) | Compares if the Command-object are equal another object.
GetHashCode (inherited from Command) | Returns the hashcode of the Command object.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Fields

mCommand (inherited from Command) | The command string
mCommandType (inherited from Command) | The command type

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Turn Class | TeamYaffa.CRaPI.Commands Namespace


Turn Constructor

Constructs a Turn command object

public Turn(
int pMoment
);

Parameters

pMoment
The moment of the turn, i.e. how many degrees to turn.

Remarks

The command will of the form:

(turn pMoment)

See Also

Turn Class | TeamYaffa.CRaPI.Commands Namespace


Turn Properties

The properties of the Turn class are listed below. For a complete list of Turn class members, see the Turn Members topic.

Public Instance Properties

CommandString (inherited from Command) | The command string
CommandType (inherited from Command) | The command type
Moment | The moment of the turn, i.e. how many degrees to turn.

See Also

Turn Class | TeamYaffa.CRaPI.Commands Namespace


Turn.Moment Property

The moment of the turn, i.e. how many degrees to turn.

public int Moment {get; set;}

See Also

Turn Class | TeamYaffa.CRaPI.Commands Namespace


TurnNeck Class

A wrapper for a turn_neck command.

For a list of all members of this type, see TurnNeck Members.

System.Object
Command
TurnNeck

public class TurnNeck : Command

Requirements

Namespace: TeamYaffa.CRaPI.Commands

Assembly: CRaPI (in CRaPI.dll)

See Also

TurnNeck Members | TeamYaffa.CRaPI.Commands Namespace


TurnNeck Members

TurnNeck overview

Public Instance Constructors

TurnNeck Constructor Constructs a TurnNeck command object

Public Instance Properties

CommandString (inherited from Command) | The command string
CommandType (inherited from Command) | The command type
Moment | The moment of the turn, i.e. how many degrees to turn.

Public Instance Methods

Equals (inherited from Command) | Compares if the Command-object are equal another object.
GetHashCode (inherited from Command) | Returns the hashcode of the Command object.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Fields

mCommand (inherited from Command) | The command string
mCommandType (inherited from Command) | The command type

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

TurnNeck Class | TeamYaffa.CRaPI.Commands Namespace


TurnNeck Constructor

Constructs a TurnNeck command object

public TurnNeck(
int pMoment
);

Parameters

pMoment
The moment of the turn, i.e. how many degrees to turn.

Remarks

The command will of the form:

(turn_neck pMoment)

See Also

TurnNeck Class | TeamYaffa.CRaPI.Commands Namespace


TurnNeck Properties

The properties of the TurnNeck class are listed below. For a complete list of TurnNeck class members, see the TurnNeck Members topic.

Public Instance Properties

CommandString (inherited from Command) | The command string
CommandType (inherited from Command) | The command type
Moment | The moment of the turn, i.e. how many degrees to turn.

See Also

TurnNeck Class | TeamYaffa.CRaPI.Commands Namespace


TurnNeck.Moment Property

The moment of the turn, i.e. how many degrees to turn.

public int Moment {get; set;}

See Also

TurnNeck Class | TeamYaffa.CRaPI.Commands Namespace


TeamYaffa.CRaPI.Info

CRaPI - Correct Robust and Perfect API

TeamYaffa.CRaPI.Info Namespace

Classes

Class | Description
HearInfo | This class acts as a wrapper of hear information from the server.
InfoBase | This is the base class for other info objects.
PlayerParam | This class acts as a wrapper of initial player characteristics
PlayerType | This class acts as a wrapper of initial player characteristics
SenseBody | This class acts as a wrapper of player characteristics received from the server.
ServerParam | Contains the information sent from the server in the server_param message.


HearInfo Class

This class acts as a wrapper of hear information from the server.

For a list of all members of this type, see HearInfo Members.

System.Object
InfoBase
HearInfo

public class HearInfo : InfoBase

Remarks

Sent from the server each time a client or the coach has issued a "say"-command, or when the referee is calling.

Requirements

Namespace: TeamYaffa.CRaPI.Info

Assembly: CRaPI (in CRaPI.dll)

See Also

HearInfo Members | TeamYaffa.CRaPI.Info Namespace


HearInfo Members

HearInfo overview

Public Static Methods

Create Parses the hear message from the server

Public Instance Properties

CurrentPlayMode | The playmode if the message came from the referee.
CurrentRefereeMessage | The referee message if the message came from the referee.
Cycle | What cycle the hear message was received.
IsRefereeMessage | Whether it is a message from the referee or not.
Item (inherited from InfoBase) | The parameter from the server
Message | The message, i.e. what was heard.
Sender | The sender of the message.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
getDouble (inherited from InfoBase) | Overloaded. Gets a value from the message, mapping pKey to an attribute, and converts the value to a double.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
getInt (inherited from InfoBase) | Gets a value from the message, mapping pKey to an attribute, and converts the value to an int.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString | Creates a string representation of the HearInfo

Protected Instance Fields

mValues (inherited from InfoBase) The hashtable containing the keys and values parsed from the message.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

HearInfo Class | TeamYaffa.CRaPI.Info Namespace


HearInfo Properties

The properties of the HearInfo class are listed below. For a complete list of HearInfo class members, see the HearInfo Members topic.

Public Instance Properties

CurrentPlayMode | The playmode if the message came from the referee.
CurrentRefereeMessage | The referee message if the message came from the referee.
Cycle | What cycle the hear message was received.
IsRefereeMessage | Whether it is a message from the referee or not.
Item (inherited from InfoBase) | The parameter from the server
Message | The message, i.e. what was heard.
Sender | The sender of the message.

See Also

HearInfo Class | TeamYaffa.CRaPI.Info Namespace


HearInfo.CurrentPlayMode Property

The playmode if the message came from the referee.

public TeamYaffa.CRaPI.PlayMode CurrentPlayMode {get;}

See Also

HearInfo Class | TeamYaffa.CRaPI.Info Namespace


HearInfo.CurrentRefereeMessage Property

The referee message if the message came from the referee.

public TeamYaffa.CRaPI.RefereeMessage CurrentRefereeMessage {get;}

See Also

HearInfo Class | TeamYaffa.CRaPI.Info Namespace


HearInfo.Cycle Property

What cycle the hear message was received.

public int Cycle {get;}

See Also

HearInfo Class | TeamYaffa.CRaPI.Info Namespace


HearInfo.IsRefereeMessage Property

Whether it is a message from the referee or not.

public bool IsRefereeMessage {get;}

Property Value

True if the message is from the referee, false otherwise.

See Also

HearInfo Class | TeamYaffa.CRaPI.Info Namespace


HearInfo.Message Property

The message, i.e. what was heard.

public string Message {get;}

See Also

HearInfo Class | TeamYaffa.CRaPI.Info Namespace


HearInfo.Sender Property

The sender of the message.

public string Sender {get;}

See Also

HearInfo Class | TeamYaffa.CRaPI.Info Namespace


HearInfo Methods

The methods of the HearInfo class are listed below. For a complete list of HearInfo class members, see the HearInfo Members topic.

Public Static Methods

Create Parses the hear message from the server

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
getDouble (inherited from InfoBase) | Overloaded. Gets a value from the message, mapping pKey to an attribute, and converts the value to a double.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
getInt (inherited from InfoBase) | Gets a value from the message, mapping pKey to an attribute, and converts the value to an int.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString | Creates a string representation of the HearInfo

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

HearInfo Class | TeamYaffa.CRaPI.Info Namespace


HearInfo.Create Method

Parses the hear message from the server

public static HearInfo Create(
string pServerData
);

Parameters

pServerData
The message from the server. Must begin with (hear.

Return Value

A ServerParam object if it was a valid hear message. Null otherwise.

Remarks

HearInfo is able to parse server_param messages from robocup server 9.0.4. Changes to the protocol could require changes to this class.

See Also

HearInfo Class | TeamYaffa.CRaPI.Info Namespace


HearInfo.ToString Method

Creates a string representation of the HearInfo

public override string ToString();

Return Value

The string representation

See Also

HearInfo Class | TeamYaffa.CRaPI.Info Namespace


InfoBase Class

This is the base class for other info objects.

For a list of all members of this type, see InfoBase Members.

System.Object
InfoBase

public abstract class InfoBase

Remarks

This class provides a hashtable where keys-value pairs from messages from the server can be stored, e.g. server parameters, player parameters or sensebody information. This class also provides functionality to parse doubles and ints from the values in the hashtable, and if it is the first or the second value that is of interest, i.e. one key can have one or two values connected to it, it depends on the message.

Requirements

Namespace: TeamYaffa.CRaPI.Info

Assembly: CRaPI (in CRaPI.dll)

See Also

InfoBase Members | TeamYaffa.CRaPI.Info Namespace


InfoBase Members

InfoBase overview

Public Instance Properties

Item The parameter from the server

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
getDouble | Overloaded. Gets a value from the message, mapping pKey to an attribute, and converts the value to a double.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
getInt | Gets a value from the message, mapping pKey to an attribute, and converts the value to an int.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString | The string representation of the class.

Protected Instance Constructors

InfoBase Constructor Makes sure the decimal separator is a . (dot).

Protected Instance Fields

mValues The hashtable containing the keys and values parsed from the message.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

InfoBase Class | TeamYaffa.CRaPI.Info Namespace


InfoBase Constructor

Makes sure the decimal separator is a . (dot).

protected InfoBase();

See Also

InfoBase Class | TeamYaffa.CRaPI.Info Namespace


InfoBase Fields

The fields of the InfoBase class are listed below. For a complete list of InfoBase class members, see the InfoBase Members topic.

Protected Instance Fields

mValues The hashtable containing the keys and values parsed from the message.

See Also

InfoBase Class | TeamYaffa.CRaPI.Info Namespace


InfoBase.mValues Field

The hashtable containing the keys and values parsed from the message.

protected Hashtable mValues;

See Also

InfoBase Class | TeamYaffa.CRaPI.Info Namespace


InfoBase Properties

The properties of the InfoBase class are listed below. For a complete list of InfoBase class members, see the InfoBase Members topic.

Public Instance Properties

Item The parameter from the server

See Also

InfoBase Class | TeamYaffa.CRaPI.Info Namespace


InfoBase.Item Property

The parameter from the server

public string this[
string pKey
] {get;}

Parameters

pKey
The key that matches the requested server parameter.

Property Value

A string representation of the server parameter associated with the specified key.

Exceptions

Exception Type | Condition
ArgumentNullException | see System.Collections.Hashtable for details.
NotSupportedException | see System.Collections.Hashtable for details.

See Also

InfoBase Class | TeamYaffa.CRaPI.Info Namespace


InfoBase Methods

The methods of the InfoBase class are listed below. For a complete list of InfoBase class members, see the InfoBase Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
getDouble | Overloaded. Gets a value from the message, mapping pKey to an attribute, and converts the value to a double.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
getInt | Gets a value from the message, mapping pKey to an attribute, and converts the value to an int.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString | The string representation of the class.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

InfoBase Class | TeamYaffa.CRaPI.Info Namespace


getDouble Method

CRaPI - Correct Robust and Perfect API

InfoBase.getDouble Method

Gets a value from the message, mapping pKey to an attribute, and converts the value to a double.

Overload List

Gets a value from the message, mapping pKey to an attribute, and converts the value to a double.

public double getDouble(string);

Divides a two value attribute, and returns the requested value.

public double getDouble(string,bool);

See Also

InfoBase Class | TeamYaffa.CRaPI.Info Namespace | getDouble


InfoBase.getDouble Method (String)

Gets a value from the message, mapping pKey to an attribute, and converts the value to a double.

public double getDouble(
string pKey
);

Parameters

pKey
Which attribute that is wanted.

Return Value

The value, or -1 if there is no attribute mapping to pKey.

See Also

InfoBase Class | TeamYaffa.CRaPI.Info Namespace | InfoBase.getDouble Overload List | getDouble


InfoBase.getDouble Method (String, Boolean)

Divides a two value attribute, and returns the requested value.

public double getDouble(
string pKey,
bool pFirst
);

Parameters

pKey
Which attribute that is wanted.
pFirst
If it is the first or the second value.

Return Value

The value, or -1 if there is no attribute mapping to pKey.

Remarks

When an attribute has two values, this method can used to divide the values in two parts, as the values are stored as one string in the hashtable.

See Also

InfoBase Class | TeamYaffa.CRaPI.Info Namespace | InfoBase.getDouble Overload List | getDouble


InfoBase.getInt Method

Gets a value from the message, mapping pKey to an attribute, and converts the value to an int.

public int getInt(
string pKey
);

Parameters

pKey
Which attribute that is wanted.

Return Value

The value, or -1 if there is no attribute mapping to pKey.

See Also

InfoBase Class | TeamYaffa.CRaPI.Info Namespace | getDouble | getDouble


InfoBase.ToString Method

The string representation of the class.

public override string ToString();

Return Value

The type of the class, and all key-value pair in the hashtable.

See Also

InfoBase Class | TeamYaffa.CRaPI.Info Namespace


PlayerParam Class

This class acts as a wrapper of initial player characteristics

For a list of all members of this type, see PlayerParam Members.

System.Object
InfoBase
PlayerParam

public class PlayerParam : InfoBase

Remarks

This class is used for the player characteristics sent by the server when the player connects.

Requirements

Namespace: TeamYaffa.CRaPI.Info

Assembly: CRaPI (in CRaPI.dll)

See Also

PlayerParam Members | TeamYaffa.CRaPI.Info Namespace


PlayerParam Members

PlayerParam overview

Public Static Methods

Create Parses the player_param message from the server

Public Instance Properties

Item (inherited from InfoBase) The parameter from the server

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
getDouble (inherited from InfoBase) | Overloaded. Gets a value from the message, mapping pKey to an attribute, and converts the value to a double.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
getInt (inherited from InfoBase) | Gets a value from the message, mapping pKey to an attribute, and converts the value to an int.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from InfoBase) | The string representation of the class.

Protected Instance Fields

mValues (inherited from InfoBase) The hashtable containing the keys and values parsed from the message.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

PlayerParam Class | TeamYaffa.CRaPI.Info Namespace


PlayerParam Methods

The methods of the PlayerParam class are listed below. For a complete list of PlayerParam class members, see the PlayerParam Members topic.

Public Static Methods

Create Parses the player_param message from the server

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
getDouble (inherited from InfoBase) | Overloaded. Gets a value from the message, mapping pKey to an attribute, and converts the value to a double.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
getInt (inherited from InfoBase) | Gets a value from the message, mapping pKey to an attribute, and converts the value to an int.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from InfoBase) | The string representation of the class.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

PlayerParam Class | TeamYaffa.CRaPI.Info Namespace


PlayerParam.Create Method

Parses the player_param message from the server

public static PlayerParam Create(
string pServerData
);

Parameters

pServerData
The message from the server. Must begin with (player_param.

Return Value

A ServerParam object if it was a valid player_param message. Null otherwise.

Remarks

PlayerParam is able to parse player_param messages from robocup server 9.0.4. Changes to the protocol could require changes to this class.

See Also

PlayerParam Class | TeamYaffa.CRaPI.Info Namespace


PlayerType Class

This class acts as a wrapper of initial player characteristics

For a list of all members of this type, see PlayerType Members.

System.Object
InfoBase
PlayerType

public class PlayerType : InfoBase

Remarks

This class is used for the player characteristics sent by the server when the player connects.

Requirements

Namespace: TeamYaffa.CRaPI.Info

Assembly: CRaPI (in CRaPI.dll)

See Also

PlayerType Members | TeamYaffa.CRaPI.Info Namespace


PlayerType Members

PlayerType overview

Public Static Methods

Create Parses the player_type message from the server

Public Instance Properties

Item (inherited from InfoBase) The parameter from the server

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
getDouble (inherited from InfoBase) | Overloaded. Gets a value from the message, mapping pKey to an attribute, and converts the value to a double.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
getInt (inherited from InfoBase) | Gets a value from the message, mapping pKey to an attribute, and converts the value to an int.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from InfoBase) | The string representation of the class.

Protected Instance Fields

mValues (inherited from InfoBase) The hashtable containing the keys and values parsed from the message.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

PlayerType Class | TeamYaffa.CRaPI.Info Namespace


PlayerType Methods

The methods of the PlayerType class are listed below. For a complete list of PlayerType class members, see the PlayerType Members topic.

Public Static Methods

Create Parses the player_type message from the server

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
getDouble (inherited from InfoBase) | Overloaded. Gets a value from the message, mapping pKey to an attribute, and converts the value to a double.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
getInt (inherited from InfoBase) | Gets a value from the message, mapping pKey to an attribute, and converts the value to an int.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from InfoBase) | The string representation of the class.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

PlayerType Class | TeamYaffa.CRaPI.Info Namespace


PlayerType.Create Method

Parses the player_type message from the server

public static PlayerType Create(
string pServerData
);

Parameters

pServerData
The message from the server. Must begin with (player_type.

Return Value

A ServerParam object if it was a valid player_type message. Null otherwise.

Remarks

PlayerType is able to parse player_type messages from robocup server 9.0.4. Changes to the protocol could require changes to this class.

See Also

PlayerType Class | TeamYaffa.CRaPI.Info Namespace


SenseBody Class

This class acts as a wrapper of player characteristics received from the server.

For a list of all members of this type, see SenseBody Members.

System.Object
InfoBase
SenseBody

public class SenseBody : InfoBase

Remarks

Sent from the server each sense_body_step, currently each 100 ms. What value is really used is reasived in the ServerParam message.

Requirements

Namespace: TeamYaffa.CRaPI.Info

Assembly: CRaPI (in CRaPI.dll)

See Also

SenseBody Members | TeamYaffa.CRaPI.Info Namespace | ServerParam


SenseBody Members

SenseBody overview

Public Static Methods

Create Parses the sense_body message from the server

Public Instance Properties

CatchCount | Number of times catch has been sent and acknowledge by the server
ChangeViewCount | Number of times change_view has been sent and acknowledge by the server
Cycle | The cycle the message was sent from the server.
DashCount | Number of times dash has been sent and acknowledge by the server
HeadAngle | The angle of the head
Item (inherited from InfoBase) | The parameter from the server
KickCount | Number of times kick has been sent and acknowledge by the server
MoveCount | Number of times move has been sent and acknowledge by the server
SayCount | Number of times say has been sent and acknowledge by the server
SpeedAmount | The amount of speed
SpeedDirection | The direction of speed
Stamina | The Players stamina.
StaminaEffort | The stamina effort
TurnCount | Number of times turn has been sent and acknowledge by the server
TurnNeckCount | Number of times turn_neck has been sent and acknowledge by the server
ViewQuality | The view quality the player is using.
ViewWidth | The width of the view that the player is using.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
getDouble (inherited from InfoBase) | Overloaded. Gets a value from the message, mapping pKey to an attribute, and converts the value to a double.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
getInt (inherited from InfoBase) | Gets a value from the message, mapping pKey to an attribute, and converts the value to an int.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString | The string representation of the class.

Protected Instance Fields

mValues (inherited from InfoBase) The hashtable containing the keys and values parsed from the message.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SenseBody Class | TeamYaffa.CRaPI.Info Namespace | ServerParam


SenseBody Properties

The properties of the SenseBody class are listed below. For a complete list of SenseBody class members, see the SenseBody Members topic.

Public Instance Properties

CatchCount | Number of times catch has been sent and acknowledge by the server
ChangeViewCount | Number of times change_view has been sent and acknowledge by the server
Cycle | The cycle the message was sent from the server.
DashCount | Number of times dash has been sent and acknowledge by the server
HeadAngle | The angle of the head
Item (inherited from InfoBase) | The parameter from the server
KickCount | Number of times kick has been sent and acknowledge by the server
MoveCount | Number of times move has been sent and acknowledge by the server
SayCount | Number of times say has been sent and acknowledge by the server
SpeedAmount | The amount of speed
SpeedDirection | The direction of speed
Stamina | The Players stamina.
StaminaEffort | The stamina effort
TurnCount | Number of times turn has been sent and acknowledge by the server
TurnNeckCount | Number of times turn_neck has been sent and acknowledge by the server
ViewQuality | The view quality the player is using.
ViewWidth | The width of the view that the player is using.

See Also

SenseBody Class | TeamYaffa.CRaPI.Info Namespace | ServerParam


SenseBody.CatchCount Property

Number of times catch has been sent and acknowledge by the server

public int CatchCount {get;}

See Also

SenseBody Class | TeamYaffa.CRaPI.Info Namespace


SenseBody.ChangeViewCount Property

Number of times change_view has been sent and acknowledge by the server

public int ChangeViewCount {get;}

See Also

SenseBody Class | TeamYaffa.CRaPI.Info Namespace


SenseBody.Cycle Property

The cycle the message was sent from the server.

public int Cycle {get;}

See Also

SenseBody Class | TeamYaffa.CRaPI.Info Namespace


SenseBody.DashCount Property

Number of times dash has been sent and acknowledge by the server

public int DashCount {get;}

See Also

SenseBody Class | TeamYaffa.CRaPI.Info Namespace


SenseBody.HeadAngle Property

The angle of the head

public int HeadAngle {get;}

See Also

SenseBody Class | TeamYaffa.CRaPI.Info Namespace


SenseBody.KickCount Property

Number of times kick has been sent and acknowledge by the server

public int KickCount {get;}

See Also

SenseBody Class | TeamYaffa.CRaPI.Info Namespace


SenseBody.MoveCount Property

Number of times move has been sent and acknowledge by the server

public int MoveCount {get;}

See Also

SenseBody Class | TeamYaffa.CRaPI.Info Namespace


SenseBody.SayCount Property

Number of times say has been sent and acknowledge by the server

public int SayCount {get;}

See Also

SenseBody Class | TeamYaffa.CRaPI.Info Namespace


SenseBody.SpeedAmount Property

The amount of speed

public double SpeedAmount {get;}

See Also

SenseBody Class | TeamYaffa.CRaPI.Info Namespace


SenseBody.SpeedDirection Property

The direction of speed

public double SpeedDirection {get;}

See Also

SenseBody Class | TeamYaffa.CRaPI.Info Namespace


SenseBody.Stamina Property

The Players stamina.

public double Stamina {get;}

See Also

SenseBody Class | TeamYaffa.CRaPI.Info Namespace


SenseBody.StaminaEffort Property

The stamina effort

public double StaminaEffort {get;}

See Also

SenseBody Class | TeamYaffa.CRaPI.Info Namespace


SenseBody.TurnCount Property

Number of times turn has been sent and acknowledge by the server

public int TurnCount {get;}

See Also

SenseBody Class | TeamYaffa.CRaPI.Info Namespace


SenseBody.TurnNeckCount Property

Number of times turn_neck has been sent and acknowledge by the server

public int TurnNeckCount {get;}

See Also

SenseBody Class | TeamYaffa.CRaPI.Info Namespace


SenseBody.ViewQuality Property

The view quality the player is using.

public TeamYaffa.CRaPI.ViewQuality ViewQuality {get;}

See Also

SenseBody Class | TeamYaffa.CRaPI.Info Namespace


SenseBody.ViewWidth Property

The width of the view that the player is using.

public TeamYaffa.CRaPI.ViewWidth ViewWidth {get;}

See Also

SenseBody Class | TeamYaffa.CRaPI.Info Namespace


SenseBody Methods

The methods of the SenseBody class are listed below. For a complete list of SenseBody class members, see the SenseBody Members topic.

Public Static Methods

Create Parses the sense_body message from the server

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
getDouble (inherited from InfoBase) | Overloaded. Gets a value from the message, mapping pKey to an attribute, and converts the value to a double.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
getInt (inherited from InfoBase) | Gets a value from the message, mapping pKey to an attribute, and converts the value to an int.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString | The string representation of the class.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SenseBody Class | TeamYaffa.CRaPI.Info Namespace | ServerParam


SenseBody.Create Method

Parses the sense_body message from the server

public static SenseBody Create(
string pServerData
);

Parameters

pServerData
The message from the server. Must begin with (sense_body.

Return Value

A ServerParam object if it was a valid sense_body message. Null otherwise.

Remarks

SenseBody is able to parse server_param messages from robocup server 9.0.4. Changes to the protocol could require changes to this class.

Currently are arm, target, focus, tackle not supported.

See Also

SenseBody Class | TeamYaffa.CRaPI.Info Namespace


SenseBody.ToString Method

The string representation of the class.

public override string ToString();

Return Value

base.ToString() and the cycle the sensebody was sent from the server.

See Also

SenseBody Class | TeamYaffa.CRaPI.Info Namespace


ServerParam Class

Contains the information sent from the server in the server_param message.

For a list of all members of this type, see ServerParam Members.

System.Object
InfoBase
ServerParam

public class ServerParam : InfoBase

Requirements

Namespace: TeamYaffa.CRaPI.Info

Assembly: CRaPI (in CRaPI.dll)

See Also

ServerParam Members | TeamYaffa.CRaPI.Info Namespace


ServerParam Members

ServerParam overview

Public Static Methods

Create Parses the server_param message from the server

Public Instance Properties

BallAccelMax | Gets maximum acceleration of the ball, according to the server_param message ball_accel_mas.
BallDecay | Gets loss of speed of the ball, according to the server_param message ball_decay.
BallRand | Gets the noice of the ball, according to the server_param message ball_rand.
BallSize | Gets ball size, according to the server_param message ball_size.
BallSpeedMax | Gets the maximum speed of the ball, according to the server_param message ball_speed_max.
CatchableAreaLength | Gets the length of the catchable area where the ball must reside if the goalie should be able to catch the ball, according to the server_param message catchable_area_l.
CatchableAreaWidth | Gets the width of the catchable area where the ball must reside if the goalie should be able to catch the ball, according to the server_param message catchable_area_w.
DashPowerRate | Gets the dash power rate, according to the server_param message dash_power_rate.
InertiaMoment | Gets the inertia moment, according to the server_param message inertia_moment.
Item (inherited from InfoBase) | The parameter from the server
KickableMargin | Gets kickable margin, according to the server_param message kickable_margin.
KickPowerRate | Gets power rate of a kick, according to the server_param message kick_power_rate.
MaxMoment | Gets how much the body can be turned to the right at the most in one turn, according to the server_param message maxmoment.
MaxNeckAngle | Gets the maximum value the neck-angle can be, according to the server_param message maxneckang.
MaxNeckMoment | Gets how much the neck can be turned to the right at the most in one turn, according to the server_param message maxneckmoment.
MaxPower | Gets the max power of i.e. kick and dash, according to the server_param message maxpower.
MaxStamina | Gets the maximum stamina for a player, according to the server_param message stamina_max.
MinMoment | Gets how much the body can be turned to the left at the most in one turn, according to the server_param message minmoment.
MinNeckAngle | Gets the minimum value the neck-angle can be, according to the server_param message minneckang.
MinNeckMoment | Gets how much the neck can be turned to the left at the most in one turn, according to the server_param message minneckmoment.
MinPower | Gets the min power of i.e. kick and dash, according to the server_param message minpower.
PlayerDecay | Gets the decay of the player, according to the server_param message player_decay.
PlayerSize | Gets the size of the player, according to the server_param message player_size.
PlayerSpeedMax | Gets the maximum speed for a player, according to the server_param message player_speed_max.
SimulatorStep | Gets the step of the simulation in milliseconds, according to the server_param message simulator_step.
WindDir | Gets direction of the wind, according to the server_param message wind_dir.
WindForce | Gets force of the wind, according to the server_param message wind_force.
WindRand | Gets noice of the wind, according to the server_param message wind_rand.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
getDouble (inherited from InfoBase) | Overloaded. Gets a value from the message, mapping pKey to an attribute, and converts the value to a double.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
getInt (inherited from InfoBase) | Gets a value from the message, mapping pKey to an attribute, and converts the value to an int.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from InfoBase) | The string representation of the class.

Protected Instance Fields

mValues (inherited from InfoBase) The hashtable containing the keys and values parsed from the message.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam Properties

The properties of the ServerParam class are listed below. For a complete list of ServerParam class members, see the ServerParam Members topic.

Public Instance Properties

BallAccelMax | Gets maximum acceleration of the ball, according to the server_param message ball_accel_mas.
BallDecay | Gets loss of speed of the ball, according to the server_param message ball_decay.
BallRand | Gets the noice of the ball, according to the server_param message ball_rand.
BallSize | Gets ball size, according to the server_param message ball_size.
BallSpeedMax | Gets the maximum speed of the ball, according to the server_param message ball_speed_max.
CatchableAreaLength | Gets the length of the catchable area where the ball must reside if the goalie should be able to catch the ball, according to the server_param message catchable_area_l.
CatchableAreaWidth | Gets the width of the catchable area where the ball must reside if the goalie should be able to catch the ball, according to the server_param message catchable_area_w.
DashPowerRate | Gets the dash power rate, according to the server_param message dash_power_rate.
InertiaMoment | Gets the inertia moment, according to the server_param message inertia_moment.
Item (inherited from InfoBase) | The parameter from the server
KickableMargin | Gets kickable margin, according to the server_param message kickable_margin.
KickPowerRate | Gets power rate of a kick, according to the server_param message kick_power_rate.
MaxMoment | Gets how much the body can be turned to the right at the most in one turn, according to the server_param message maxmoment.
MaxNeckAngle | Gets the maximum value the neck-angle can be, according to the server_param message maxneckang.
MaxNeckMoment | Gets how much the neck can be turned to the right at the most in one turn, according to the server_param message maxneckmoment.
MaxPower | Gets the max power of i.e. kick and dash, according to the server_param message maxpower.
MaxStamina | Gets the maximum stamina for a player, according to the server_param message stamina_max.
MinMoment | Gets how much the body can be turned to the left at the most in one turn, according to the server_param message minmoment.
MinNeckAngle | Gets the minimum value the neck-angle can be, according to the server_param message minneckang.
MinNeckMoment | Gets how much the neck can be turned to the left at the most in one turn, according to the server_param message minneckmoment.
MinPower | Gets the min power of i.e. kick and dash, according to the server_param message minpower.
PlayerDecay | Gets the decay of the player, according to the server_param message player_decay.
PlayerSize | Gets the size of the player, according to the server_param message player_size.
PlayerSpeedMax | Gets the maximum speed for a player, according to the server_param message player_speed_max.
SimulatorStep | Gets the step of the simulation in milliseconds, according to the server_param message simulator_step.
WindDir | Gets direction of the wind, according to the server_param message wind_dir.
WindForce | Gets force of the wind, according to the server_param message wind_force.
WindRand | Gets noice of the wind, according to the server_param message wind_rand.

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.BallAccelMax Property

Gets maximum acceleration of the ball, according to the server_param message ball_accel_mas.

public double BallAccelMax {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.BallDecay Property

Gets loss of speed of the ball, according to the server_param message ball_decay.

public double BallDecay {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.BallRand Property

Gets the noice of the ball, according to the server_param message ball_rand.

public double BallRand {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.BallSize Property

Gets ball size, according to the server_param message ball_size.

public double BallSize {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.BallSpeedMax Property

Gets the maximum speed of the ball, according to the server_param message ball_speed_max.

public double BallSpeedMax {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.CatchableAreaLength Property

Gets the length of the catchable area where the ball must reside if the goalie should be able to catch the ball, according to the server_param message catchable_area_l.

public double CatchableAreaLength {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.CatchableAreaWidth Property

Gets the width of the catchable area where the ball must reside if the goalie should be able to catch the ball, according to the server_param message catchable_area_w.

public double CatchableAreaWidth {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.DashPowerRate Property

Gets the dash power rate, according to the server_param message dash_power_rate.

public double DashPowerRate {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.InertiaMoment Property

Gets the inertia moment, according to the server_param message inertia_moment.

public double InertiaMoment {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.KickableMargin Property

Gets kickable margin, according to the server_param message kickable_margin.

public double KickableMargin {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.KickPowerRate Property

Gets power rate of a kick, according to the server_param message kick_power_rate.

public double KickPowerRate {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.MaxMoment Property

Gets how much the body can be turned to the right at the most in one turn, according to the server_param message maxmoment.

public int MaxMoment {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.MaxNeckAngle Property

Gets the maximum value the neck-angle can be, according to the server_param message maxneckang.

public int MaxNeckAngle {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.MaxNeckMoment Property

Gets how much the neck can be turned to the right at the most in one turn, according to the server_param message maxneckmoment.

public int MaxNeckMoment {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.MaxPower Property

Gets the max power of i.e. kick and dash, according to the server_param message maxpower.

public int MaxPower {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.MaxStamina Property

Gets the maximum stamina for a player, according to the server_param message stamina_max.

public int MaxStamina {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.MinMoment Property

Gets how much the body can be turned to the left at the most in one turn, according to the server_param message minmoment.

public int MinMoment {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.MinNeckAngle Property

Gets the minimum value the neck-angle can be, according to the server_param message minneckang.

public int MinNeckAngle {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.MinNeckMoment Property

Gets how much the neck can be turned to the left at the most in one turn, according to the server_param message minneckmoment.

public int MinNeckMoment {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.MinPower Property

Gets the min power of i.e. kick and dash, according to the server_param message minpower.

public int MinPower {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.PlayerDecay Property

Gets the decay of the player, according to the server_param message player_decay.

public double PlayerDecay {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.PlayerSize Property

Gets the size of the player, according to the server_param message player_size.

public double PlayerSize {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.PlayerSpeedMax Property

Gets the maximum speed for a player, according to the server_param message player_speed_max.

public double PlayerSpeedMax {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.SimulatorStep Property

Gets the step of the simulation in milliseconds, according to the server_param message simulator_step.

public int SimulatorStep {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.WindDir Property

Gets direction of the wind, according to the server_param message wind_dir.

public double WindDir {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.WindForce Property

Gets force of the wind, according to the server_param message wind_force.

public double WindForce {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.WindRand Property

Gets noice of the wind, according to the server_param message wind_rand.

public double WindRand {get;}

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam Methods

The methods of the ServerParam class are listed below. For a complete list of ServerParam class members, see the ServerParam Members topic.

Public Static Methods

Create Parses the server_param message from the server

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
getDouble (inherited from InfoBase) | Overloaded. Gets a value from the message, mapping pKey to an attribute, and converts the value to a double.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
getInt (inherited from InfoBase) | Gets a value from the message, mapping pKey to an attribute, and converts the value to an int.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from InfoBase) | The string representation of the class.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


ServerParam.Create Method

Parses the server_param message from the server

public static ServerParam Create(
string pServerData
);

Parameters

pServerData
The message from the server. Must begin with (server_param.

Return Value

A ServerParam object if it was a valid server_param message. Null otherwise.

Remarks

ServerParam is able to parse server_param messages from robocup server 9.0.4. Changes to the protocol could require changes to this class.

See Also

ServerParam Class | TeamYaffa.CRaPI.Info Namespace


TeamYaffa.CRaPI.Net

CRaPI - Correct Robust and Perfect API

TeamYaffa.CRaPI.Net Namespace

Classes

Class | Description
ServerConnection | This class takes care of all communication with the server.


ServerConnection Class

This class takes care of all communication with the server.

For a list of all members of this type, see ServerConnection Members.

System.Object
ServerConnection

public class ServerConnection

Remarks

This class makes it possible and simplifies to Connect, Reconnect and Send to the server, and Receive from the server.

The ServerConnection class should later also be able to handle the connection between the server and a monitor.

Requirements

Namespace: TeamYaffa.CRaPI.Net

Assembly: CRaPI (in CRaPI.dll)

See Also

ServerConnection Members | TeamYaffa.CRaPI.Net Namespace


ServerConnection Members

ServerConnection overview

Public Instance Constructors

ServerConnection Constructor Creates a ServerConnection

Public Instance Properties

Adress | The adress where the server resides.
Port | The port which the server is listening on.

Public Instance Methods

CloseConnection | Closes the socket to the server.
Connect | Overloaded. Connects to the server by sending an init-command.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
Receive | Retrieves a messages from the Robocup server.
Reconnect | Reconnects to a server
Send | Sends a message to the Robocup server.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

ServerConnection Class | TeamYaffa.CRaPI.Net Namespace


ServerConnection Constructor

Creates a ServerConnection

public ServerConnection(
string pServerAddress,
int pServerPort,
int pTimeOut
);

Parameters

pServerAddress
The address of the server
pServerPort
The port of the server to connect to
pTimeOut
The time to wait for a receive before timing out

Remarks

A number of exception can occur when creating the ServerConnection. You could take a closer look at IPEndPoint, Dns and IPAddress.

See Also

ServerConnection Class | TeamYaffa.CRaPI.Net Namespace


ServerConnection Properties

The properties of the ServerConnection class are listed below. For a complete list of ServerConnection class members, see the ServerConnection Members topic.

Public Instance Properties

Adress | The adress where the server resides.
Port | The port which the server is listening on.

See Also

ServerConnection Class | TeamYaffa.CRaPI.Net Namespace


ServerConnection.Adress Property

The adress where the server resides.

public string Adress {get;}

Property Value

The ip-adress to the server, and the adress family it belongs to.

Remarks

Since the adress of the server most likely won't change during a game, the Adress is read-only.

See Also

ServerConnection Class | TeamYaffa.CRaPI.Net Namespace


ServerConnection.Port Property

The port which the server is listening on.

public int Port {get;}

Property Value

The servers port number for the current player

Remarks

The port number is obtained from the last message from the server.

See Also

ServerConnection Class | TeamYaffa.CRaPI.Net Namespace


ServerConnection Methods

The methods of the ServerConnection class are listed below. For a complete list of ServerConnection class members, see the ServerConnection Members topic.

Public Instance Methods

CloseConnection | Closes the socket to the server.
Connect | Overloaded. Connects to the server by sending an init-command.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
Receive | Retrieves a messages from the Robocup server.
Reconnect | Reconnects to a server
Send | Sends a message to the Robocup server.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

ServerConnection Class | TeamYaffa.CRaPI.Net Namespace


ServerConnection.CloseConnection Method

Closes the socket to the server.

public void CloseConnection();

See Also

ServerConnection Class | TeamYaffa.CRaPI.Net Namespace


Connect Method

CRaPI - Correct Robust and Perfect API

ServerConnection.Connect Method

Connects to the server by sending an init-command.

Overload List

Connects to the server by sending an init-command.

public string Connect(string,bool);

Connects to the server by sending an init-command.

public string Connect(string,bool,int);

See Also

ServerConnection Class | TeamYaffa.CRaPI.Net Namespace


ServerConnection.Connect Method (String, Boolean)

Connects to the server by sending an init-command.

public string Connect(
string pTeamName,
bool pIsGoalie
);

Parameters

pTeamName
The name of the player's team
pIsGoalie
Whether the player is a goalie or not

Return Value

The response from the server. Can be one of two things:

  • (init Side Unum PlayMode)
  • (error no_more_team_or_player_or_goalie)

Remarks

  • Side == l | r
  • Unum == the player number
  • PlayMode == PlayMode

Exceptions

Exception Type | Condition
SocketException | Thrown when the socket times-out

See Also

ServerConnection Class | TeamYaffa.CRaPI.Net Namespace | ServerConnection.Connect Overload List


ServerConnection.Connect Method (String, Boolean, Int32)

Connects to the server by sending an init-command.

public string Connect(
string pTeamName,
bool pIsGoalie,
int pVersion
);

Parameters

pTeamName
The name of the player's team
pIsGoalie
Whether the player is a goalie or not
pVersion
The version of the player

Return Value

The response from the server. Can be one of two things:

  • (init Side Unum PlayMode)
  • (error no_more_team_or_player_or_goalie)

Remarks

  • Side == l | r
  • Unum == the player number
  • PlayMode == PlayMode

Exceptions

Exception Type | Condition
SocketException | Thrown when the socket times-out

See Also

ServerConnection Class | TeamYaffa.CRaPI.Net Namespace | ServerConnection.Connect Overload List


ServerConnection.Receive Method

Retrieves a messages from the Robocup server.

public string Receive();

Return Value

The message from the server.

Exceptions

Exception Type | Condition
SocketException | Thrown when the socket times-out

See Also

ServerConnection Class | TeamYaffa.CRaPI.Net Namespace


ServerConnection.Reconnect Method

Reconnects to a server

public string Reconnect(
string pTeamName,
int pPlayerNumber
);

Parameters

pTeamName
The name of the player's team
pPlayerNumber
The player's jersey number

Return Value

The response from the server. Can be one of three things:

  • (init Side Unum PlayMode)
  • (error no_more_team_or_player)
  • (error reconnect)

Remarks

  • Side == l | r
  • Unum == 1 ~ 11
  • PlayMode == PlayMode

Exceptions

Exception Type | Condition
SocketException | Thrown when the socket times-out

See Also

ServerConnection Class | TeamYaffa.CRaPI.Net Namespace


ServerConnection.Send Method

Sends a message to the Robocup server.

public int Send(
string pMessage
);

Parameters

pMessage
The message to send to the server.

Return Value

Number of bytes sent to the server.

Remarks

Since ServerConnection uses the udp-protocol, no evaluation is made whether the message was received by the server or not.

See Also

ServerConnection Class | TeamYaffa.CRaPI.Net Namespace


TeamYaffa.CRaPI.Utility

CRaPI - Correct Robust and Perfect API

TeamYaffa.CRaPI.Utility Namespace

Classes

Class | Description
MathUtility | This class provides a set of frequently used mathematical functions
Matrix | This class provides a matrix with rudimentary operations.
Tokenizer | This class handles tokenizing of strings.
Tokenizer.TokenEnumerator | Inner class implements IEnumerator interface:

Structures

Structure | Description
CellCoordinate | This struct represents a coordinate in a Matrix.
Line2D | This class represents a line of double precision on a 2 dimensional plane.
Point2D | This class represents a point of double precision on a 2 dimensional plane.
Rectangle2D | This class represents a rectangle in a 2 dimensional plane.


CellCoordinate Structure

This struct represents a coordinate in a Matrix.

For a list of all members of this type, see CellCoordinate Members.

System.Object
ValueType
CellCoordinate

public struct CellCoordinate

Requirements

Namespace: TeamYaffa.CRaPI.Utility

Assembly: CRaPI (in CRaPI.dll)

See Also

CellCoordinate Members | TeamYaffa.CRaPI.Utility Namespace


CellCoordinate Members

CellCoordinate overview

Public Instance Constructors

CellCoordinate Constructor Creates the CellCoordinate with the horizontal and the vertical cell number, that together makes up the cellcoordinate.

Public Instance Properties

HorizontalCell | The horizontal cell
VerticalCell | The vertical cell

Public Instance Methods

Equals (inherited from ValueType) | Indicates whether this instance and a specified object are equal.
GetHashCode (inherited from ValueType) | Returns the hash code for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from ValueType) | Returns the fully qualified type name of this instance.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

CellCoordinate Class | TeamYaffa.CRaPI.Utility Namespace


CellCoordinate Constructor

Creates the CellCoordinate with the horizontal and the vertical cell number, that together makes up the cellcoordinate.

public CellCoordinate(
int pHCell,
int pVCell
);

Parameters

pHCell
The horizontal cell
pVCell
The vertical cell

Exceptions

Exception Type | Condition
ArgumentOutOfRangeException | If either of the parameters are less than zero this exception will be thrown.

See Also

CellCoordinate Class | TeamYaffa.CRaPI.Utility Namespace


CellCoordinate Properties

The properties of the CellCoordinate structure are listed below. For a complete list of CellCoordinate structure members, see the CellCoordinate Members topic.

Public Instance Properties

HorizontalCell | The horizontal cell
VerticalCell | The vertical cell

See Also

CellCoordinate Class | TeamYaffa.CRaPI.Utility Namespace


CellCoordinate.HorizontalCell Property

The horizontal cell

public int HorizontalCell {get; set;}

Exceptions

Exception Type | Condition
ArgumentOutOfRangeException | If the value are less than zero this exception will be thrown.

See Also

CellCoordinate Class | TeamYaffa.CRaPI.Utility Namespace


CellCoordinate.VerticalCell Property

The vertical cell

public int VerticalCell {get; set;}

Exceptions

Exception Type | Condition
ArgumentOutOfRangeException | If the value are less than zero this exception will be thrown.

See Also

CellCoordinate Class | TeamYaffa.CRaPI.Utility Namespace


Line2D Structure

This class represents a line of double precision on a 2 dimensional plane.

For a list of all members of this type, see Line2D Members.

System.Object
ValueType
Line2D

public struct Line2D

Remarks

The line is represented by a start point and an end point.

Requirements

Namespace: TeamYaffa.CRaPI.Utility

Assembly: CRaPI (in CRaPI.dll)

See Also

Line2D Members | TeamYaffa.CRaPI.Utility Namespace


Line2D Members

Line2D overview

Public Instance Constructors

Line2D Constructor Constructs a Line2D

Public Instance Properties

End | End position of line
Length | Length of Line. Point2D substraction
Start | Start position of line
XLength | Length in X of Line
YLength | Length in Y of Line

Public Instance Methods

Equals (inherited from ValueType) | Indicates whether this instance and a specified object are equal.
GetHashCode (inherited from ValueType) | Returns the hash code for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
Intersection | Calculates where two lines intersect.
Intersects | Checks if this Line2D intersects another Line2D
OnLine | Checks if a Point2D is on this Line2D
ToString (inherited from ValueType) | Returns the fully qualified type name of this instance.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Line2D Class | TeamYaffa.CRaPI.Utility Namespace


Line2D Constructor

Constructs a Line2D

public Line2D(
Point2D pStart,
Point2D pEnd
);

Parameters

pStart
Start position of line
pEnd
End position of line

Remarks

The line is created with two points, which are the lines start and end points.

See Also

Line2D Class | TeamYaffa.CRaPI.Utility Namespace


Line2D Properties

The properties of the Line2D structure are listed below. For a complete list of Line2D structure members, see the Line2D Members topic.

Public Instance Properties

End | End position of line
Length | Length of Line. Point2D substraction
Start | Start position of line
XLength | Length in X of Line
YLength | Length in Y of Line

See Also

Line2D Class | TeamYaffa.CRaPI.Utility Namespace


Line2D.End Property

End position of line

public Point2D End {get; set;}

Property Value

A Point2D as a representation of the point where the line ends.

See Also

Line2D Class | TeamYaffa.CRaPI.Utility Namespace


Line2D.Length Property

Length of Line. Point2D substraction

public double Length {get;}

Remarks

The Length of the line is the distance between the Start point and the End point.

See Also

Line2D Class | TeamYaffa.CRaPI.Utility Namespace | Point2D substraction


Line2D.Start Property

Start position of line

public Point2D Start {get; set;}

Property Value

A Point2D as a representation of the point where the line starts.

See Also

Line2D Class | TeamYaffa.CRaPI.Utility Namespace


Line2D.XLength Property

Length in X of Line

public double XLength {get;}

Remarks

The XLength of the line is the same as the XDistanceTo between Start and End.

See Also

Line2D Class | TeamYaffa.CRaPI.Utility Namespace


Line2D.YLength Property

Length in Y of Line

public double YLength {get;}

Remarks

The YLength of the line is the same as the YDistanceTo between Start and End.

See Also

Line2D Class | TeamYaffa.CRaPI.Utility Namespace


Line2D Methods

The methods of the Line2D structure are listed below. For a complete list of Line2D structure members, see the Line2D Members topic.

Public Instance Methods

Equals (inherited from ValueType) | Indicates whether this instance and a specified object are equal.
GetHashCode (inherited from ValueType) | Returns the hash code for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
Intersection | Calculates where two lines intersect.
Intersects | Checks if this Line2D intersects another Line2D
OnLine | Checks if a Point2D is on this Line2D
ToString (inherited from ValueType) | Returns the fully qualified type name of this instance.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Line2D Class | TeamYaffa.CRaPI.Utility Namespace


Line2D.Intersection Method

Calculates where two lines intersect.

public bool Intersection(
Line2D pLine,
out Point2D intersection
);

Parameters

pLine
Line2D to check for intersection.
intersection
Intersection point.

Return Value

true if intersection is found, otherwise false

Remarks

See http://astronomy.swin.edu.au/~pbourke/geometry/lineline2d/ for details

See Also

Line2D Class | TeamYaffa.CRaPI.Utility Namespace


Line2D.Intersects Method

Checks if this Line2D intersects another Line2D

public bool Intersects(
Line2D pLine
);

Parameters

pLine
Line2D to check for intersection

Return Value

true if intersection is found, otherwise false

Remarks

See http://astronomy.swin.edu.au/~pbourke/geometry/lineline2d/ for details

See Also

Line2D Class | TeamYaffa.CRaPI.Utility Namespace


Line2D.OnLine Method

Checks if a Point2D is on this Line2D

public bool OnLine(
Point2D pPoint
);

Parameters

pPoint
The point

Return Value

true if the point is on line, otherwise false

See Also

Line2D Class | TeamYaffa.CRaPI.Utility Namespace


MathUtility Class

This class provides a set of frequently used mathematical functions

For a list of all members of this type, see MathUtility Members.

System.Object
MathUtility

public class MathUtility

Requirements

Namespace: TeamYaffa.CRaPI.Utility

Assembly: CRaPI (in CRaPI.dll)

See Also

MathUtility Members | TeamYaffa.CRaPI.Utility Namespace


MathUtility Members

MathUtility overview

Public Static Methods

IntersectionPoint | Calculates the intersection point between the player and a MobileObject
NormalizeAngle | Normalizes an angle to fit into the range -180 ~ 180
ToDegrees | Transforms an angle from radians to degrees
ToRadians | Transforms an angle from degrees to radians
WithinPhysicalBoundary | Checks if a position is within the physical boundary for the agent.
WithinPlayFieldBoundary | Checks if a position is within the boundaries of the playfield.

Public Instance Constructors

MathUtility Constructor Initializes a new instance of the MathUtility class.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

MathUtility Class | TeamYaffa.CRaPI.Utility Namespace


MathUtility Constructor

Initializes a new instance of the MathUtility class.

public MathUtility();

See Also

MathUtility Class | TeamYaffa.CRaPI.Utility Namespace


MathUtility Methods

The methods of the MathUtility class are listed below. For a complete list of MathUtility class members, see the MathUtility Members topic.

Public Static Methods

IntersectionPoint | Calculates the intersection point between the player and a MobileObject
NormalizeAngle | Normalizes an angle to fit into the range -180 ~ 180
ToDegrees | Transforms an angle from radians to degrees
ToRadians | Transforms an angle from degrees to radians
WithinPhysicalBoundary | Checks if a position is within the physical boundary for the agent.
WithinPlayFieldBoundary | Checks if a position is within the boundaries of the playfield.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

MathUtility Class | TeamYaffa.CRaPI.Utility Namespace


MathUtility.IntersectionPoint Method

Calculates the intersection point between the player and a MobileObject

public static bool IntersectionPoint(
Player pSelf,
MobileObject pIntersectObject,
out Point2D pIntersectionPoint
);

Parameters

pSelf
The player
pIntersectObject
The MobileObject to intersect
pIntersectionPoint
The intersection point

Return Value

true if intersection found, otherwise false

See Also

MathUtility Class | TeamYaffa.CRaPI.Utility Namespace


MathUtility.NormalizeAngle Method

Normalizes an angle to fit into the range -180 ~ 180

public static double NormalizeAngle(
double pAngle
);

Parameters

pAngle
Anglo to normalize

Return Value

Normalized angle, a value between -180 and 180

See Also

MathUtility Class | TeamYaffa.CRaPI.Utility Namespace


MathUtility.ToDegrees Method

Transforms an angle from radians to degrees

public static double ToDegrees(
double pRadians
);

Parameters

pRadians
The angle to transform

Return Value

The angle in degrees

See Also

MathUtility Class | TeamYaffa.CRaPI.Utility Namespace


MathUtility.ToRadians Method

Transforms an angle from degrees to radians

public static double ToRadians(
double pDegrees
);

Parameters

pDegrees
The angle to transform

Return Value

The angle in radians

See Also

MathUtility Class | TeamYaffa.CRaPI.Utility Namespace


MathUtility.WithinPhysicalBoundary Method

Checks if a position is within the physical boundary for the agent.

public static bool WithinPhysicalBoundary(
WorldModel pWm,
Point2D pPosition
);

Parameters

pWm
The agents world-model
pPosition
The position to check

Return Value

True if the point is within the physical boundary, false otherwise

See Also

MathUtility Class | TeamYaffa.CRaPI.Utility Namespace


MathUtility.WithinPlayFieldBoundary Method

Checks if a position is within the boundaries of the playfield.

public static bool WithinPlayFieldBoundary(
WorldModel pWm,
Point2D pPosition
);

Parameters

pWm
The agents world-model
pPosition
The position to check

Return Value

True if the point is within boundaries of the playfield, false otherwise

See Also

MathUtility Class | TeamYaffa.CRaPI.Utility Namespace


Matrix Class

This class provides a matrix with rudimentary operations.

For a list of all members of this type, see Matrix Members.

System.Object
Matrix

public class Matrix : ICloneable

Requirements

Namespace: TeamYaffa.CRaPI.Utility

Assembly: CRaPI (in CRaPI.dll)

See Also

Matrix Members | TeamYaffa.CRaPI.Utility Namespace


Matrix Members

Matrix overview

Public Static Operators

Addition Operator | Calculates the added value of each cell of two matrices
Division Operator | Calculates the divided value of each cell of two matrices
Multiplication Operator | Calculates the multiplicated value of each cell of the two matrices
Subtraction Operator | Calculates the subtracted value of each cell of two matrices

Public Instance Constructors

Matrix Constructor Constructs a matrix with given size

Public Instance Properties

Field | The internal representation
Height | The number of cells of the matrix in Y-dimension
Item | This Matrix
Size | The number of cells of the matrix in both dimensions
Width | The number of cells of the matrix in X-dimension

Public Instance Methods

CalculateMAX | Calculates the MAX of each cell of the two matrices
CalculateMIN | Calculate the MIN of each cell of the two matrices
Clone | Creates a deep copy of the Matrix.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
SuperimposeAdd | Superimposes this matrix with the supplied, with respect to the added value of each cell
SuperimposeDIV | Superimposes this matrix with the supplied, with respect to the divided value of each cell
SuperimposeMax | Superimposes this matrix with the supplied, with respect to the max value of each cell
SuperimposeMin | Superimposes this matrix with the supplied, with respect to the min value of each cell
SuperimposeMUL | Superimposes this matrix with the supplied, with respect to the mulitplicated value of each cell
SuperimposeSub | Superimposes this matrix with the supplied, with respect to the subtracted value of each cell
ToString | A string representation of the matrix.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

Explicit Interface Implementations

ICloneable.Clone Creates a deep copy of the Matrix.

See Also

Matrix Class | TeamYaffa.CRaPI.Utility Namespace


Matrix Constructor

Constructs a matrix with given size

public Matrix(
int pWidth,
int pHeight
);

Parameters

pWidth
The width of the matrix
pHeight
The height of the matrix

See Also

Matrix Class | TeamYaffa.CRaPI.Utility Namespace


Matrix Properties

The properties of the Matrix class are listed below. For a complete list of Matrix class members, see the Matrix Members topic.

Public Instance Properties

Field | The internal representation
Height | The number of cells of the matrix in Y-dimension
Item | This Matrix
Size | The number of cells of the matrix in both dimensions
Width | The number of cells of the matrix in X-dimension

See Also

Matrix Class | TeamYaffa.CRaPI.Utility Namespace


Matrix.Field Property

The internal representation

public double[,] Field {get; set;}

See Also

Matrix Class | TeamYaffa.CRaPI.Utility Namespace


Matrix.Height Property

The number of cells of the matrix in Y-dimension

public int Height {get;}

See Also

Matrix Class | TeamYaffa.CRaPI.Utility Namespace


Matrix.Item Property

This Matrix

public double this[
int x,
int y
] {get; set;}

See Also

Matrix Class | TeamYaffa.CRaPI.Utility Namespace


Matrix.Size Property

The number of cells of the matrix in both dimensions

public int Size {get;}

See Also

Matrix Class | TeamYaffa.CRaPI.Utility Namespace


Matrix.Width Property

The number of cells of the matrix in X-dimension

public int Width {get;}

See Also

Matrix Class | TeamYaffa.CRaPI.Utility Namespace


Matrix Methods

The methods of the Matrix class are listed below. For a complete list of Matrix class members, see the Matrix Members topic.

Public Instance Methods

CalculateMAX | Calculates the MAX of each cell of the two matrices
CalculateMIN | Calculate the MIN of each cell of the two matrices
Clone | Creates a deep copy of the Matrix.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
SuperimposeAdd | Superimposes this matrix with the supplied, with respect to the added value of each cell
SuperimposeDIV | Superimposes this matrix with the supplied, with respect to the divided value of each cell
SuperimposeMax | Superimposes this matrix with the supplied, with respect to the max value of each cell
SuperimposeMin | Superimposes this matrix with the supplied, with respect to the min value of each cell
SuperimposeMUL | Superimposes this matrix with the supplied, with respect to the mulitplicated value of each cell
SuperimposeSub | Superimposes this matrix with the supplied, with respect to the subtracted value of each cell
ToString | A string representation of the matrix.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

Explicit Interface Implementations

ICloneable.Clone Creates a deep copy of the Matrix.

See Also

Matrix Class | TeamYaffa.CRaPI.Utility Namespace


Matrix.CalculateMAX Method

Calculates the MAX of each cell of the two matrices

public Matrix CalculateMAX(
Matrix pMatrix1,
Matrix pMatrix2
);

Parameters

pMatrix1
First matrix
pMatrix2
Second matrix

Return Value

The result matrix

Remarks

A new Matrix is produced

Exceptions

Exception Type | Condition
ArgumentException | is thrown when the two matrices are of different sizes

See Also

Matrix Class | TeamYaffa.CRaPI.Utility Namespace


Matrix.CalculateMIN Method

Calculate the MIN of each cell of the two matrices

public Matrix CalculateMIN(
Matrix pMatrix1,
Matrix pMatrix2
);

Parameters

pMatrix1
First matrix
pMatrix2
Second matrix

Return Value

The result matrix

Remarks

A new Matrix is produced

Exceptions

Exception Type | Condition
ArgumentException | is thrown when the two matrices are of different sizes

See Also

Matrix Class | TeamYaffa.CRaPI.Utility Namespace


Matrix.Clone Method

Creates a deep copy of the Matrix.

public Matrix Clone();

Return Value

A copy of the Matrix.

Remarks

The deep copy creates a new Matrix and copies the values from the origin to the new Matrix.

See Also

Matrix Class | TeamYaffa.CRaPI.Utility Namespace


Matrix.SuperimposeAdd Method

Superimposes this matrix with the supplied, with respect to the added value of each cell

public void SuperimposeAdd(
Matrix pMatrix,
int pXOffset,
int pYOffset
);

Parameters

pMatrix
he matrix to superimpose
pXOffset
The X-offset where to superimpose the matrix
pYOffset
The Y-offset where to superimpose the matrix

Remarks

The called matrix is altered

Exceptions

Exception Type | Condition
ArgumentException | is thrown when supplied Matrix is superimposed out of bounds of the called Matrix

See Also

Matrix Class | TeamYaffa.CRaPI.Utility Namespace


Matrix.SuperimposeDIV Method

Superimposes this matrix with the supplied, with respect to the divided value of each cell

public void SuperimposeDIV(
Matrix pMatrix,
int pXOffset,
int pYOffset
);

Parameters

pMatrix
he matrix to superimpose
pXOffset
The X-offset where to superimpose the matrix
pYOffset
The Y-offset where to superimpose the matrix

Remarks

The called matrix is altered

Exceptions

Exception Type | Condition
ArgumentException | is thrown when supplied Matrix is superimposed out of bounds of the called Matrix

See Also

Matrix Class | TeamYaffa.CRaPI.Utility Namespace


Matrix.SuperimposeMax Method

Superimposes this matrix with the supplied, with respect to the max value of each cell

public void SuperimposeMax(
Matrix pMatrix,
int pXOffset,
int pYOffset
);

Parameters

pMatrix
The matrix to superimpose
pXOffset
The X-offset where to superimpose the matrix
pYOffset
The Y-offset where to superimpose the matrix

Remarks

The called matrix is altered

Exceptions

Exception Type | Condition
ArgumentException | is thrown when supplied Matrix is superimposed out of bounds of the called Matrix

See Also

Matrix Class | TeamYaffa.CRaPI.Utility Namespace


Matrix.SuperimposeMin Method

Superimposes this matrix with the supplied, with respect to the min value of each cell

public void SuperimposeMin(
Matrix pMatrix,
int pXOffset,
int pYOffset
);

Parameters

pMatrix
The matrix to superimpose
pXOffset
The X-offset where to superimpose the matrix
pYOffset
The Y-offset where to superimpose the matrix

Remarks

The called matrix is altered

Exceptions

Exception Type | Condition
ArgumentException | is thrown when supplied Matrix is superimposed out of bounds of the called Matrix

See Also

Matrix Class | TeamYaffa.CRaPI.Utility Namespace


Matrix.SuperimposeMUL Method

Superimposes this matrix with the supplied, with respect to the mulitplicated value of each cell

public void SuperimposeMUL(
Matrix pMatrix,
int pXOffset,
int pYOffset
);

Parameters

pMatrix
he matrix to superimpose
pXOffset
The X-offset where to superimpose the matrix
pYOffset
The Y-offset where to superimpose the matrix

Remarks

The called matrix is altered

Exceptions

Exception Type | Condition
ArgumentException | is thrown when supplied Matrix is superimposed out of bounds of the called Matrix

See Also

Matrix Class | TeamYaffa.CRaPI.Utility Namespace


Matrix.SuperimposeSub Method

Superimposes this matrix with the supplied, with respect to the subtracted value of each cell

public void SuperimposeSub(
Matrix pMatrix,
int pXOffset,
int pYOffset
);

Parameters

pMatrix
he matrix to superimpose
pXOffset
The X-offset where to superimpose the matrix
pYOffset
The Y-offset where to superimpose the matrix

Remarks

The called matrix is altered

Exceptions

Exception Type | Condition
ArgumentException | is thrown when supplied Matrix is superimposed out of bounds of the called Matrix

See Also

Matrix Class | TeamYaffa.CRaPI.Utility Namespace


Matrix.ICloneable.Clone Method

Creates a deep copy of the Matrix.

object ICloneable.Clone();

Return Value

A copy of the Matrix.

Implements

ICloneable.Clone

Remarks

The deep copy creates a new Matrix and copies the values from the origin to the new Matrix.

The clone is of type Matrix.

See Also

Matrix Class | TeamYaffa.CRaPI.Utility Namespace


Matrix.ToString Method

A string representation of the matrix.

public override string ToString();

Return Value

A string

See Also

Matrix Class | TeamYaffa.CRaPI.Utility Namespace


Matrix Operators

The operators of the Matrix class are listed below. For a complete list of Matrix class members, see the Matrix Members topic.

Public Static Operators

Addition Operator | Calculates the added value of each cell of two matrices
Division Operator | Calculates the divided value of each cell of two matrices
Multiplication Operator | Calculates the multiplicated value of each cell of the two matrices
Subtraction Operator | Calculates the subtracted value of each cell of two matrices

See Also

Matrix Class | Matrix Members | TeamYaffa.CRaPI.Utility Namespace


Matrix Addition Operator

Calculates the added value of each cell of two matrices

public static Matrix operator +(
Matrix pMatrix1,
Matrix pMatrix2
);

Parameters

pMatrix1
First matrix
pMatrix2
Second matrix

Return Value

The result matrix

Remarks

A new Matrix is produced

Exceptions

Exception Type | Condition
ArgumentException | is thrown when the two matrices are of different sizes

See Also

Matrix Class | TeamYaffa.CRaPI.Utility Namespace


Matrix Division Operator

Calculates the divided value of each cell of two matrices

public static Matrix operator /(
Matrix pMatrix1,
Matrix pMatrix2
);

Parameters

pMatrix1
First matrix
pMatrix2
Second matrix

Return Value

The result matrix

Remarks

A new Matrix is produced

Exceptions

Exception Type | Condition
ArgumentException | is thrown when the two matrices are of different sizes

See Also

Matrix Class | TeamYaffa.CRaPI.Utility Namespace


Matrix Multiplication Operator

Calculates the multiplicated value of each cell of the two matrices

public static Matrix operator *(
Matrix pMatrix1,
Matrix pMatrix2
);

Parameters

pMatrix1
First matrix
pMatrix2
Second matrix

Return Value

The result matrix

Remarks

A new Matrix is produced

Exceptions

Exception Type | Condition
ArgumentException | is thrown when the two matrices are of different sizes

See Also

Matrix Class | TeamYaffa.CRaPI.Utility Namespace


Matrix Subtraction Operator

Calculates the subtracted value of each cell of two matrices

public static Matrix operator -(
Matrix pMatrix1,
Matrix pMatrix2
);

Parameters

pMatrix1
First matrix
pMatrix2
Second matrix

Return Value

The result matrix

Remarks

A new Matrix is produced

Exceptions

Exception Type | Condition
ArgumentException | is thrown when the two matrices are of different sizes

See Also

Matrix Class | TeamYaffa.CRaPI.Utility Namespace


Point2D Structure

This class represents a point of double precision on a 2 dimensional plane.

For a list of all members of this type, see Point2D Members.

System.Object
ValueType
Point2D

public struct Point2D

Requirements

Namespace: TeamYaffa.CRaPI.Utility

Assembly: CRaPI (in CRaPI.dll)

See Also

Point2D Members | TeamYaffa.CRaPI.Utility Namespace


Point2D Members

Point2D overview

Public Static Methods

Distance Calculates the distance between two points

Public Static Operators

Equality Operator | Checks if two Point2D are equal
Inequality Operator | Checks if two Point2D are inequal
Subtraction Operator | Calculates the distance between two points

Public Instance Constructors

Point2D Overloaded. Initializes a new instance of the Point2D class.

Public Instance Properties

X | The X-coordinate of the point
Y | The Y-coordinate of the point

Public Instance Methods

AngleTo | The angle from this point to another point
Equals | Checks if this point have the same coordinate as a second point
GetHashCode | The hash code of this object
GetType (inherited from Object) | Gets the Type of the current instance.
MidwayTo | Calculates the position on the middle of the imagined line between two points.
SetLocation | Sets the location of this Point2D to the location supplied.
SignedXDistanceTo | The x distance to a point
SignedYDistanceTo | The y distance to a point
ToPoint | Creates a Point from this Point2D.
ToString | A string representation of the point.
XDistanceTo | The absolute value of the x distance to a point
YDistanceTo | The absolute value of the y distance to a point

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Point2D Class | TeamYaffa.CRaPI.Utility Namespace


Point2D Constructor

Constructs a Point2D of two doubles

Overload List

Constructs a Point2D of two doubles

public Point2D(double,double);

Creates a new Point2D from an existing Point2D

public Point2D(Point2D);

Constructs a Point2D of a Point2D and a direction and distance from that point

public Point2D(Point2D,double,double);

See Also

Point2D Class | TeamYaffa.CRaPI.Utility Namespace


Point2D Constructor (Double, Double)

Constructs a Point2D of two doubles

public Point2D(
double pX,
double pY
);

Parameters

pX
The X position
pY
The Y position

See Also

Point2D Class | TeamYaffa.CRaPI.Utility Namespace | Point2D Constructor Overload List


Point2D Constructor (Point2D, Double, Double)

Constructs a Point2D of a Point2D and a direction and distance from that point

public Point2D(
Point2D pPosition,
double pDirection,
double pDistance
);

Parameters

pPosition
The starting point
pDirection
The direction of the new point in relation to the starting point
pDistance
The distance to the new point in relation to the starting point

See Also

Point2D Class | TeamYaffa.CRaPI.Utility Namespace | Point2D Constructor Overload List


Point2D Constructor (Point2D)

Creates a new Point2D from an existing Point2D

public Point2D(
Point2D pPosition
);

Parameters

pPosition
The point to copy

See Also

Point2D Class | TeamYaffa.CRaPI.Utility Namespace | Point2D Constructor Overload List


Point2D Properties

The properties of the Point2D structure are listed below. For a complete list of Point2D structure members, see the Point2D Members topic.

Public Instance Properties

X | The X-coordinate of the point
Y | The Y-coordinate of the point

See Also

Point2D Class | TeamYaffa.CRaPI.Utility Namespace


Point2D.X Property

The X-coordinate of the point

public double X {get; set;}

Property Value

mX

See Also

Point2D Class | TeamYaffa.CRaPI.Utility Namespace


Point2D.Y Property

The Y-coordinate of the point

public double Y {get; set;}

Property Value

mY

See Also

Point2D Class | TeamYaffa.CRaPI.Utility Namespace


Point2D Methods

The methods of the Point2D structure are listed below. For a complete list of Point2D structure members, see the Point2D Members topic.

Public Static Methods

Distance Calculates the distance between two points

Public Instance Methods

AngleTo | The angle from this point to another point
Equals | Checks if this point have the same coordinate as a second point
GetHashCode | The hash code of this object
GetType (inherited from Object) | Gets the Type of the current instance.
MidwayTo | Calculates the position on the middle of the imagined line between two points.
SetLocation | Sets the location of this Point2D to the location supplied.
SignedXDistanceTo | The x distance to a point
SignedYDistanceTo | The y distance to a point
ToPoint | Creates a Point from this Point2D.
ToString | A string representation of the point.
XDistanceTo | The absolute value of the x distance to a point
YDistanceTo | The absolute value of the y distance to a point

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Point2D Class | TeamYaffa.CRaPI.Utility Namespace


Point2D.AngleTo Method

The angle from this point to another point

public double AngleTo(
Point2D pPoint
);

Parameters

pPoint
The point to calculate angle to

Return Value

The angle to the point

See Also

Point2D Class | TeamYaffa.CRaPI.Utility Namespace


Point2D.Distance Method

Calculates the distance between two points

public static double Distance(
Point2D pP1,
Point2D pP2
);

Parameters

pP1
Point 1
pP2
Point 2

Return Value

The distance between the two points.

Remarks

The distance between the two points are calculated with

dist = Sqrt(xDist^2 + yDist^2)
where xDist is the X-difference and yDist is the Y-difference for the two points.

See Also

Point2D Class | TeamYaffa.CRaPI.Utility Namespace | op_Subtraction


Point2D.Equals Method

Checks if this point have the same coordinate as a second point

public override bool Equals(
object o
);

Parameters

o
The second point

Return Value

true if equal, otherwise false

See Also

Point2D Class | TeamYaffa.CRaPI.Utility Namespace | op_Equality


Point2D.GetHashCode Method

The hash code of this object

public override int GetHashCode();

Return Value

The hash code of this object

Remarks

Calculated by:

X XOR (Y (left shift operator) 1)

See Also

Point2D Class | TeamYaffa.CRaPI.Utility Namespace


Point2D.MidwayTo Method

Calculates the position on the middle of the imagined line between two points.

public Point2D MidwayTo(
Point2D pPoint
);

Parameters

pPoint
The other point

Return Value

A point representing the position on the middle of the imagined line between the two points.

See Also

Point2D Class | TeamYaffa.CRaPI.Utility Namespace


Point2D.SetLocation Method

Sets the location of this Point2D to the location supplied.

public void SetLocation(
double pX,
double pY
);

Parameters

pX
The X position of the new location
pY
The Y position of the new location

See Also

Point2D Class | TeamYaffa.CRaPI.Utility Namespace


Point2D.SignedXDistanceTo Method

The x distance to a point

public double SignedXDistanceTo(
Point2D pPoint
);

Parameters

pPoint
The point

Return Value

The distance

See Also

Point2D Class | TeamYaffa.CRaPI.Utility Namespace


Point2D.SignedYDistanceTo Method

The y distance to a point

public double SignedYDistanceTo(
Point2D pPoint
);

Parameters

pPoint
The point

Return Value

The distance

See Also

Point2D Class | TeamYaffa.CRaPI.Utility Namespace


Point2D.ToPoint Method

Creates a Point from this Point2D.

public Point ToPoint();

Return Value

A Point based on this Point2D where the x- and y-value is rounded off.

See Also

Point2D Class | TeamYaffa.CRaPI.Utility Namespace


Point2D.ToString Method

A string representation of the point.

public override string ToString();

Return Value

X; Y

Remarks

The X and Y values are round to precision of 4.

See Also

Point2D Class | TeamYaffa.CRaPI.Utility Namespace


Point2D.XDistanceTo Method

The absolute value of the x distance to a point

public double XDistanceTo(
Point2D pPoint
);

Parameters

pPoint
The point

Return Value

The distance

See Also

Point2D Class | TeamYaffa.CRaPI.Utility Namespace


Point2D.YDistanceTo Method

The absolute value of the y distance to a point

public double YDistanceTo(
Point2D pPoint
);

Parameters

pPoint
The point

Return Value

The distance

See Also

Point2D Class | TeamYaffa.CRaPI.Utility Namespace


Point2D Operators

The operators of the Point2D structure are listed below. For a complete list of Point2D structure members, see the Point2D Members topic.

Public Static Operators

Equality Operator | Checks if two Point2D are equal
Inequality Operator | Checks if two Point2D are inequal
Subtraction Operator | Calculates the distance between two points

See Also

Point2D Class | Point2D Members | TeamYaffa.CRaPI.Utility Namespace


Point2D Equality Operator

Checks if two Point2D are equal

public static bool operator ==(
Point2D pP1,
Point2D pP2
);

Parameters

pP1
Point 1
pP2
Point 2

Return Value

true if the points are equal

Remarks

Two points are equal if (P1.X == P2.X) and (P1.Y == P2.Y)

See Also

Point2D Class | TeamYaffa.CRaPI.Utility Namespace


Point2D Inequality Operator

Checks if two Point2D are inequal

public static bool operator !=(
Point2D pP1,
Point2D pP2
);

Parameters

pP1
Point 1
pP2
Point 2

Return Value

true if not equal

See Also

Point2D Class | TeamYaffa.CRaPI.Utility Namespace | op_Equality


Point2D Subtraction Operator

Calculates the distance between two points

public static double operator -(
Point2D pP1,
Point2D pP2
);

Parameters

pP1
Point 1
pP2
Point 2

Return Value

The distance between the two points.

Remarks

The distance between the two points are calculated with

dist = Sqrt(xDist^2 + yDist^2)
where xDist is the X-difference and yDist is the Y-difference for the two points.

See Also

Point2D Class | TeamYaffa.CRaPI.Utility Namespace | Distance


Rectangle2D Structure

This class represents a rectangle in a 2 dimensional plane.

For a list of all members of this type, see Rectangle2D Members.

System.Object
ValueType
Rectangle2D

public struct Rectangle2D

Requirements

Namespace: TeamYaffa.CRaPI.Utility

Assembly: CRaPI (in CRaPI.dll)

See Also

Rectangle2D Members | TeamYaffa.CRaPI.Utility Namespace


Rectangle2D Members

Rectangle2D overview

Public Instance Constructors

Rectangle2D Overloaded. Initializes a new instance of the Rectangle2D class.

Public Instance Properties

CentralPoint | Gets the central point of the rectangle.
LowerLeft | Lower left corner of the Rectangle.
LowerRight | Lower right corner of the Rectangle.
UpperLeft | Upper left corner of the Rectangle.
UpperRight | Upper right corner of the Rectangle.

Public Instance Methods

Contains | Checks if a Point2D is contained by this rectangle.
Equals (inherited from ValueType) | Indicates whether this instance and a specified object are equal.
GetHashCode (inherited from ValueType) | Returns the hash code for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString | The string representation of the rectangle.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Rectangle2D Class | TeamYaffa.CRaPI.Utility Namespace


Rectangle2D Constructor

Creates a Rectangle2D of the upper left corner coordinate and a width and an height.

Overload List

Creates a Rectangle2D of the upper left corner coordinate and a width and an height.

public Rectangle2D(double,double,double,double);

Create a Rectangle2D of four Point2D, representing the corners.

public Rectangle2D(Point2D,Point2D,Point2D,Point2D);

See Also

Rectangle2D Class | TeamYaffa.CRaPI.Utility Namespace


Rectangle2D Constructor (Double, Double, Double, Double)

Creates a Rectangle2D of the upper left corner coordinate and a width and an height.

public Rectangle2D(
double pUpperLeftX,
double pUpperLeftY,
double pWidth,
double pHeight
);

Parameters

pUpperLeftX
The X position of the upper left corner
pUpperLeftY
The Y position of the upper left corner
pWidth
The width of the rectangle
pHeight
The height of the rectangle

See Also

Rectangle2D Class | TeamYaffa.CRaPI.Utility Namespace | Rectangle2D Constructor Overload List


Rectangle2D Constructor (Point2D, Point2D, Point2D, Point2D)

Create a Rectangle2D of four Point2D, representing the corners.

public Rectangle2D(
Point2D pLowerLeft,
Point2D pLowerRight,
Point2D pUpperLeft,
Point2D pUpperRight
);

Parameters

pLowerLeft
Lower left corner
pLowerRight
Lower right corner
pUpperLeft
Upper left corner
pUpperRight
Upper right corner

See Also

Rectangle2D Class | TeamYaffa.CRaPI.Utility Namespace | Rectangle2D Constructor Overload List


Rectangle2D Properties

The properties of the Rectangle2D structure are listed below. For a complete list of Rectangle2D structure members, see the Rectangle2D Members topic.

Public Instance Properties

CentralPoint | Gets the central point of the rectangle.
LowerLeft | Lower left corner of the Rectangle.
LowerRight | Lower right corner of the Rectangle.
UpperLeft | Upper left corner of the Rectangle.
UpperRight | Upper right corner of the Rectangle.

See Also

Rectangle2D Class | TeamYaffa.CRaPI.Utility Namespace


Rectangle2D.CentralPoint Property

Gets the central point of the rectangle.

public Point2D CentralPoint {get;}

See Also

Rectangle2D Class | TeamYaffa.CRaPI.Utility Namespace


Rectangle2D.LowerLeft Property

Lower left corner of the Rectangle.

public Point2D LowerLeft {get; set;}

See Also

Rectangle2D Class | TeamYaffa.CRaPI.Utility Namespace


Rectangle2D.LowerRight Property

Lower right corner of the Rectangle.

public Point2D LowerRight {get; set;}

See Also

Rectangle2D Class | TeamYaffa.CRaPI.Utility Namespace


Rectangle2D.UpperLeft Property

Upper left corner of the Rectangle.

public Point2D UpperLeft {get; set;}

See Also

Rectangle2D Class | TeamYaffa.CRaPI.Utility Namespace


Rectangle2D.UpperRight Property

Upper right corner of the Rectangle.

public Point2D UpperRight {get; set;}

See Also

Rectangle2D Class | TeamYaffa.CRaPI.Utility Namespace


Rectangle2D Methods

The methods of the Rectangle2D structure are listed below. For a complete list of Rectangle2D structure members, see the Rectangle2D Members topic.

Public Instance Methods

Contains | Checks if a Point2D is contained by this rectangle.
Equals (inherited from ValueType) | Indicates whether this instance and a specified object are equal.
GetHashCode (inherited from ValueType) | Returns the hash code for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString | The string representation of the rectangle.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Rectangle2D Class | TeamYaffa.CRaPI.Utility Namespace


Rectangle2D.Contains Method

Checks if a Point2D is contained by this rectangle.

public bool Contains(
Point2D pPoint
);

Parameters

pPoint
The Point2D to make the check on.

Return Value

true if the point is contained in this rectangle, otherwise false

See Also

Rectangle2D Class | TeamYaffa.CRaPI.Utility Namespace


Rectangle2D.ToString Method

The string representation of the rectangle.

public override string ToString();

Return Value

[upper left point][upper right point][lower left point][lower right point]

See Also

Rectangle2D Class | TeamYaffa.CRaPI.Utility Namespace


Tokenizer Class

This class handles tokenizing of strings.

For a list of all members of this type, see Tokenizer Members.

System.Object
Tokenizer

public class Tokenizer : IEnumerable

Requirements

Namespace: TeamYaffa.CRaPI.Utility

Assembly: CRaPI (in CRaPI.dll)

See Also

Tokenizer Members | TeamYaffa.CRaPI.Utility Namespace


Tokenizer Members

Tokenizer overview

Public Instance Constructors

Tokenizer Constructor Creates a Tokenizer of a string and and array of delimiters.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEnumerator | Returns a TokenEnumerator of the tokenized string
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

Explicit Interface Implementations

IEnumerable.GetEnumerator Returns a IEnumerator of the tokenized string

See Also

Tokenizer Class | TeamYaffa.CRaPI.Utility Namespace


Tokenizer Constructor

Creates a Tokenizer of a string and and array of delimiters.

public Tokenizer(
string pSource,
params char[] pDelimiters
);

Parameters

pSource
The string to tokenize
pDelimiters
The delimiters to tokenize on

See Also

Tokenizer Class | TeamYaffa.CRaPI.Utility Namespace


Tokenizer Methods

The methods of the Tokenizer class are listed below. For a complete list of Tokenizer class members, see the Tokenizer Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEnumerator | Returns a TokenEnumerator of the tokenized string
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

Explicit Interface Implementations

IEnumerable.GetEnumerator Returns a IEnumerator of the tokenized string

See Also

Tokenizer Class | TeamYaffa.CRaPI.Utility Namespace


Tokenizer.GetEnumerator Method

Returns a TokenEnumerator of the tokenized string

public TokenEnumerator GetEnumerator();

Return Value

TokenEnumerator

See Also

Tokenizer Class | TeamYaffa.CRaPI.Utility Namespace


Tokenizer.IEnumerable.GetEnumerator Method

Returns a IEnumerator of the tokenized string

IEnumerator IEnumerable.GetEnumerator();

Return Value

IEnumerator

Implements

IEnumerable.GetEnumerator

See Also

Tokenizer Class | TeamYaffa.CRaPI.Utility Namespace


Tokenizer.TokenEnumerator Class

Inner class implements IEnumerator interface:

For a list of all members of this type, see Tokenizer.TokenEnumerator Members.

System.Object
Tokenizer.TokenEnumerator

public class Tokenizer.TokenEnumerator : IEnumerator

Requirements

Namespace: TeamYaffa.CRaPI.Utility

Assembly: CRaPI (in CRaPI.dll)

See Also

Tokenizer.TokenEnumerator Members | TeamYaffa.CRaPI.Utility Namespace


Tokenizer.TokenEnumerator Members

Tokenizer.TokenEnumerator overview

Public Instance Constructors

Tokenizer.TokenEnumerator Constructor Creates a TokenEnumerator of a Tokenizer

Public Instance Properties

Current The current token in the TokenEnumerator

Public Instance Methods

CountTokens | Counts the tokens in the TokenEnumerator
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
MoveNext | Moves the position to the next token in the TokenEnumerator
Reset | Resets the position in the TokenEnumerator
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Tokenizer.TokenEnumerator Class | TeamYaffa.CRaPI.Utility Namespace


Tokenizer.TokenEnumerator Constructor

Creates a TokenEnumerator of a Tokenizer

public Tokenizer.TokenEnumerator(
Tokenizer pTokenizer
);

Parameters

pTokenizer
Tokenizer

See Also

Tokenizer.TokenEnumerator Class | TeamYaffa.CRaPI.Utility Namespace


Tokenizer.TokenEnumerator Properties

The properties of the Tokenizer.TokenEnumerator class are listed below. For a complete list of Tokenizer.TokenEnumerator class members, see the Tokenizer.TokenEnumerator Members topic.

Public Instance Properties

Current The current token in the TokenEnumerator

See Also

Tokenizer.TokenEnumerator Class | TeamYaffa.CRaPI.Utility Namespace


Tokenizer.TokenEnumerator.Current Property

The current token in the TokenEnumerator

public string Current {get;}

See Also

Tokenizer.TokenEnumerator Class | TeamYaffa.CRaPI.Utility Namespace


Tokenizer.TokenEnumerator Methods

The methods of the Tokenizer.TokenEnumerator class are listed below. For a complete list of Tokenizer.TokenEnumerator class members, see the Tokenizer.TokenEnumerator Members topic.

Public Instance Methods

CountTokens | Counts the tokens in the TokenEnumerator
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
MoveNext | Moves the position to the next token in the TokenEnumerator
Reset | Resets the position in the TokenEnumerator
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Tokenizer.TokenEnumerator Class | TeamYaffa.CRaPI.Utility Namespace


Tokenizer.TokenEnumerator.CountTokens Method

Counts the tokens in the TokenEnumerator

public int CountTokens();

Return Value

number of tokens in the TokenEnumerator

See Also

Tokenizer.TokenEnumerator Class | TeamYaffa.CRaPI.Utility Namespace


Tokenizer.TokenEnumerator.MoveNext Method

Moves the position to the next token in the TokenEnumerator

public bool MoveNext();

Return Value

Implements

IEnumerator.MoveNext

See Also

Tokenizer.TokenEnumerator Class | TeamYaffa.CRaPI.Utility Namespace


Tokenizer.TokenEnumerator.Reset Method

Resets the position in the TokenEnumerator

public void Reset();

Implements

IEnumerator.Reset

See Also

Tokenizer.TokenEnumerator Class | TeamYaffa.CRaPI.Utility Namespace


TeamYaffa.CRaPI.World

CRaPI - Correct Robust and Perfect API

TeamYaffa.CRaPI.World Namespace

Classes

Class | Description
FieldPlayerEventArgs | Event arguments FieldPlayers
FlagsEventArgs | Event arguments for Flags
IntersectionsEventArgs | Event arguments for Intersections
PlayerRepository | This class acts as a repository for FieldPlayers, known, unknown and assumed
PositionEventArgs | Event arguments Positions
WorldModel | This class represents the WorldModel of a player. The world model is the players (agents) perception of the state of the play field. E.g. the players position, the position of the team mates, opponents and the ball etc.

Structures

Structure | Description
Flag | This is a representation of the flags that is sent from the server in the see message.
Intersection | A point where the imagined circles of two flag-distances intersect.

Delegates

Delegate | Description
FlagsEventHandler | Handling event fired when Flags have been parsed
IntersectionsEventHandler | Handling event fired when Intersections have been calculated
OpponentsEventHandler | Handling event fired when opponents have been updated
PlayerCalculatedEventHandler | Handling event fired Player has been updated
PositionEventHandler | Handling event fired when player position has been calculated
PositionUnknownEventHandler | Handling event fired when position of one self is unknown
TeamMatesEventHandler | Handling event fired when team mates have been updated


FieldPlayerEventArgs Class

Event arguments FieldPlayers

For a list of all members of this type, see FieldPlayerEventArgs Members.

System.Object
EventArgs
FieldPlayerEventArgs

public class FieldPlayerEventArgs : EventArgs

Remarks

Used when an ArrayList of field players should be provided with the event.

Requirements

Namespace: TeamYaffa.CRaPI.World

Assembly: CRaPI (in CRaPI.dll)

See Also

FieldPlayerEventArgs Members | TeamYaffa.CRaPI.World Namespace


FieldPlayerEventArgs Members

FieldPlayerEventArgs overview

Public Instance Constructors

FieldPlayerEventArgs Constructor Creates an FieldPlayerEventArgs with an ArrayList of field players and a server cycle.

Public Instance Properties

Players | Gets the field players
ServerCycle | Gets the server cycle

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

FieldPlayerEventArgs Class | TeamYaffa.CRaPI.World Namespace


FieldPlayerEventArgs Constructor

Creates an FieldPlayerEventArgs with an ArrayList of field players and a server cycle.

public FieldPlayerEventArgs(
ArrayList pPlayers,
int pServerCycle
);

Parameters

pPlayers
The players
pServerCycle
The server cycle

See Also

FieldPlayerEventArgs Class | TeamYaffa.CRaPI.World Namespace


FieldPlayerEventArgs Properties

The properties of the FieldPlayerEventArgs class are listed below. For a complete list of FieldPlayerEventArgs class members, see the FieldPlayerEventArgs Members topic.

Public Instance Properties

Players | Gets the field players
ServerCycle | Gets the server cycle

See Also

FieldPlayerEventArgs Class | TeamYaffa.CRaPI.World Namespace


FieldPlayerEventArgs.Players Property

Gets the field players

public System.Collections.ArrayList Players {get;}

See Also

FieldPlayerEventArgs Class | TeamYaffa.CRaPI.World Namespace


FieldPlayerEventArgs.ServerCycle Property

Gets the server cycle

public int ServerCycle {get;}

See Also

FieldPlayerEventArgs Class | TeamYaffa.CRaPI.World Namespace


Flag Structure

This is a representation of the flags that is sent from the server in the see message.

For a list of all members of this type, see Flag Members.

System.Object
ValueType
Flag

public struct Flag : IComparable

Requirements

Namespace: TeamYaffa.CRaPI.World

Assembly: CRaPI (in CRaPI.dll)

See Also

Flag Members | TeamYaffa.CRaPI.World Namespace


Flag Members

Flag overview

Public Instance Constructors

Flag Constructor Consructs a Flag

Public Instance Properties

Direction | The direction to the flag, relative the direction of the players view
Distance | The distance between the player and the seen flag
Name | The name of the flag
Position | The static position of the flag

Public Instance Methods

CompareTo | Compares the current instance with another flag.
Equals (inherited from ValueType) | Indicates whether this instance and a specified object are equal.
GetHashCode (inherited from ValueType) | Returns the hash code for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString | Creates a string representation of the Flag

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

Explicit Interface Implementations

IComparable.CompareTo Compares the current instance with another flag.

See Also

Flag Class | TeamYaffa.CRaPI.World Namespace


Flag Constructor

Consructs a Flag

public Flag(
string pName,
Point2D pPosition,
double pDistance,
double pDirection
);

Parameters

pName
The name
pPosition
The position
pDistance
The distance to the flag
pDirection
The direction to the flag

See Also

Flag Class | TeamYaffa.CRaPI.World Namespace


Flag Properties

The properties of the Flag structure are listed below. For a complete list of Flag structure members, see the Flag Members topic.

Public Instance Properties

Direction | The direction to the flag, relative the direction of the players view
Distance | The distance between the player and the seen flag
Name | The name of the flag
Position | The static position of the flag

See Also

Flag Class | TeamYaffa.CRaPI.World Namespace


Flag.Direction Property

The direction to the flag, relative the direction of the players view

public double Direction {get;}

See Also

Flag Class | TeamYaffa.CRaPI.World Namespace


Flag.Distance Property

The distance between the player and the seen flag

public double Distance {get;}

See Also

Flag Class | TeamYaffa.CRaPI.World Namespace


Flag.Name Property

The name of the flag

public string Name {get;}

See Also

Flag Class | TeamYaffa.CRaPI.World Namespace


Flag.Position Property

The static position of the flag

public TeamYaffa.CRaPI.Utility.Point2D Position {get;}

See Also

Flag Class | TeamYaffa.CRaPI.World Namespace


Flag Methods

The methods of the Flag structure are listed below. For a complete list of Flag structure members, see the Flag Members topic.

Public Instance Methods

CompareTo | Compares the current instance with another flag.
Equals (inherited from ValueType) | Indicates whether this instance and a specified object are equal.
GetHashCode (inherited from ValueType) | Returns the hash code for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString | Creates a string representation of the Flag

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

Explicit Interface Implementations

IComparable.CompareTo Compares the current instance with another flag.

See Also

Flag Class | TeamYaffa.CRaPI.World Namespace


Flag.CompareTo Method

Compares the current instance with another flag.

public int CompareTo(
Flag pFlag
);

Parameters

pFlag
The flag to compare with.

Return Value

A 32-bit signed integer that indicates the relative order of the flags. The return value has these meanings:

  • Less than zero : The distance to this flag i less than to pFlag.
  • Zero : The distance to the flags are equal.
  • Greater than zero : The distance to this flag is greater than to pFlag.

See Also

Flag Class | TeamYaffa.CRaPI.World Namespace


Flag.IComparable.CompareTo Method

Compares the current instance with another flag.

int IComparable.CompareTo(
object pFlag
);

Parameters

pFlag
The flag to compare with.

Return Value

A 32-bit signed integer that indicates the relative order of the flags. The return value has these meanings:

  • Less than zero : The distance to this flag i less than to pFlag.
  • Zero : The distance to the flags are equal.
  • Greater than zero : The distance to this flag is greater than to pFlag.

Implements

IComparable.CompareTo

Exceptions

Exception Type | Condition
ArgumentException | pFlag is not a Flag.

See Also

Flag Class | TeamYaffa.CRaPI.World Namespace


Flag.ToString Method

Creates a string representation of the Flag

public override string ToString();

Return Value

string representation

See Also

Flag Class | TeamYaffa.CRaPI.World Namespace


FlagsEventArgs Class

Event arguments for Flags

For a list of all members of this type, see FlagsEventArgs Members.

System.Object
EventArgs
FlagsEventArgs

public class FlagsEventArgs : EventArgs

Remarks

Used when an array of flags should be provided with the event.

Requirements

Namespace: TeamYaffa.CRaPI.World

Assembly: CRaPI (in CRaPI.dll)

See Also

FlagsEventArgs Members | TeamYaffa.CRaPI.World Namespace


FlagsEventArgs Members

FlagsEventArgs overview

Public Instance Constructors

FlagsEventArgs Constructor Creates an FlagsEventArgs with an array of flags and a server cycle.

Public Instance Properties

Flags | Gets the array of flags
ServerCycle | Gets the server cycle

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

FlagsEventArgs Class | TeamYaffa.CRaPI.World Namespace


FlagsEventArgs Constructor

Creates an FlagsEventArgs with an array of flags and a server cycle.

public FlagsEventArgs(
Flag[] pFlags,
int pServerCycle
);

Parameters

pFlags
The array of flags
pServerCycle
The server cycle

See Also

FlagsEventArgs Class | TeamYaffa.CRaPI.World Namespace


FlagsEventArgs Properties

The properties of the FlagsEventArgs class are listed below. For a complete list of FlagsEventArgs class members, see the FlagsEventArgs Members topic.

Public Instance Properties

Flags | Gets the array of flags
ServerCycle | Gets the server cycle

See Also

FlagsEventArgs Class | TeamYaffa.CRaPI.World Namespace


FlagsEventArgs.Flags Property

Gets the array of flags

public Flag[] Flags {get;}

See Also

FlagsEventArgs Class | TeamYaffa.CRaPI.World Namespace


FlagsEventArgs.ServerCycle Property

Gets the server cycle

public int ServerCycle {get;}

See Also

FlagsEventArgs Class | TeamYaffa.CRaPI.World Namespace


FlagsEventHandler Delegate

Handling event fired when Flags have been parsed

public delegate void FlagsEventHandler(
object sender,
FlagsEventArgs e
);

Requirements

Namespace: TeamYaffa.CRaPI.World

Assembly: CRaPI (in CRaPI.dll)

See Also

TeamYaffa.CRaPI.World Namespace


Intersection Structure

A point where the imagined circles of two flag-distances intersect.

For a list of all members of this type, see Intersection Members.

System.Object
ValueType
Intersection

public struct Intersection

Remarks

If a circle is imagined around each flag, where the circle represent the distance to the flag, then this class is a representation of an intersection between two flags. The order of the flag can be of any order.

Requirements

Namespace: TeamYaffa.CRaPI.World

Assembly: CRaPI (in CRaPI.dll)

See Also

Intersection Members | TeamYaffa.CRaPI.World Namespace


Intersection Members

Intersection overview

Public Instance Constructors

Intersection Constructor Constructs an Intersection, with a point and 2 flags.

Public Instance Properties

FlagOne | The first flag
FlagTwo | The second flag
Point | The position

Public Instance Methods

Equals (inherited from ValueType) | Indicates whether this instance and a specified object are equal.
GetHashCode (inherited from ValueType) | Returns the hash code for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from ValueType) | Returns the fully qualified type name of this instance.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Intersection Class | TeamYaffa.CRaPI.World Namespace


Intersection Constructor

Constructs an Intersection, with a point and 2 flags.

public Intersection(
Point2D pPoint,
Flag pFlagOne,
Flag pFlagTwo
);

Parameters

pPoint
The position
pFlagOne
The first flag
pFlagTwo
The second flag

See Also

Intersection Class | TeamYaffa.CRaPI.World Namespace


Intersection Properties

The properties of the Intersection structure are listed below. For a complete list of Intersection structure members, see the Intersection Members topic.

Public Instance Properties

FlagOne | The first flag
FlagTwo | The second flag
Point | The position

See Also

Intersection Class | TeamYaffa.CRaPI.World Namespace


Intersection.FlagOne Property

The first flag

public Flag FlagOne {get;}

See Also

Intersection Class | TeamYaffa.CRaPI.World Namespace


Intersection.FlagTwo Property

The second flag

public Flag FlagTwo {get;}

See Also

Intersection Class | TeamYaffa.CRaPI.World Namespace


Intersection.Point Property

The position

public TeamYaffa.CRaPI.Utility.Point2D Point {get;}

See Also

Intersection Class | TeamYaffa.CRaPI.World Namespace


IntersectionsEventArgs Class

Event arguments for Intersections

For a list of all members of this type, see IntersectionsEventArgs Members.

System.Object
EventArgs
IntersectionsEventArgs

public class IntersectionsEventArgs : EventArgs

Remarks

Used when an array of intersections should be provided with the event.

Requirements

Namespace: TeamYaffa.CRaPI.World

Assembly: CRaPI (in CRaPI.dll)

See Also

IntersectionsEventArgs Members | TeamYaffa.CRaPI.World Namespace


IntersectionsEventArgs Members

IntersectionsEventArgs overview

Public Instance Constructors

IntersectionsEventArgs Constructor Creates an IntersectionsEventArgs with an array of intersections and a server cycle.

Public Instance Properties

Intersections | Gets the array of intersections
ServerCycle | Gets the server cycle

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

IntersectionsEventArgs Class | TeamYaffa.CRaPI.World Namespace


IntersectionsEventArgs Constructor

Creates an IntersectionsEventArgs with an array of intersections and a server cycle.

public IntersectionsEventArgs(
Intersection[] pIntersections,
int pServerCycle
);

Parameters

pIntersections
The array of intersections
pServerCycle
The server cycle

See Also

IntersectionsEventArgs Class | TeamYaffa.CRaPI.World Namespace


IntersectionsEventArgs Properties

The properties of the IntersectionsEventArgs class are listed below. For a complete list of IntersectionsEventArgs class members, see the IntersectionsEventArgs Members topic.

Public Instance Properties

Intersections | Gets the array of intersections
ServerCycle | Gets the server cycle

See Also

IntersectionsEventArgs Class | TeamYaffa.CRaPI.World Namespace


IntersectionsEventArgs.Intersections Property

Gets the array of intersections

public Intersection[] Intersections {get;}

See Also

IntersectionsEventArgs Class | TeamYaffa.CRaPI.World Namespace


IntersectionsEventArgs.ServerCycle Property

Gets the server cycle

public int ServerCycle {get;}

See Also

IntersectionsEventArgs Class | TeamYaffa.CRaPI.World Namespace


IntersectionsEventHandler Delegate

Handling event fired when Intersections have been calculated

public delegate void IntersectionsEventHandler(
object sender,
IntersectionsEventArgs e
);

Requirements

Namespace: TeamYaffa.CRaPI.World

Assembly: CRaPI (in CRaPI.dll)

See Also

TeamYaffa.CRaPI.World Namespace


OpponentsEventHandler Delegate

Handling event fired when opponents have been updated

public delegate void OpponentsEventHandler(
object sender,
FieldPlayerEventArgs e
);

Requirements

Namespace: TeamYaffa.CRaPI.World

Assembly: CRaPI (in CRaPI.dll)

See Also

TeamYaffa.CRaPI.World Namespace


PlayerCalculatedEventHandler Delegate

Handling event fired Player has been updated

public delegate void PlayerCalculatedEventHandler(
object sender,
FieldPlayerEventArgs e
);

Requirements

Namespace: TeamYaffa.CRaPI.World

Assembly: CRaPI (in CRaPI.dll)

See Also

TeamYaffa.CRaPI.World Namespace


PlayerRepository Class

This class acts as a repository for FieldPlayers, known, unknown and assumed

For a list of all members of this type, see PlayerRepository Members.

System.Object
PlayerRepository

public class PlayerRepository

Requirements

Namespace: TeamYaffa.CRaPI.World

Assembly: CRaPI (in CRaPI.dll)

See Also

PlayerRepository Members | TeamYaffa.CRaPI.World Namespace


PlayerRepository Members

PlayerRepository overview

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

PlayerRepository Class | TeamYaffa.CRaPI.World Namespace


PositionEventArgs Class

Event arguments Positions

For a list of all members of this type, see PositionEventArgs Members.

System.Object
EventArgs
PositionEventArgs

public class PositionEventArgs : EventArgs

Remarks

Used when a position should be provided with the event.

Requirements

Namespace: TeamYaffa.CRaPI.World

Assembly: CRaPI (in CRaPI.dll)

See Also

PositionEventArgs Members | TeamYaffa.CRaPI.World Namespace


PositionEventArgs Members

PositionEventArgs overview

Public Instance Constructors

PositionEventArgs Constructor Creates an PositionEventArgs with a position and a server cycle.

Public Instance Properties

Position | Gets the position
ServerCycle | Gets the server cycle

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

PositionEventArgs Class | TeamYaffa.CRaPI.World Namespace


PositionEventArgs Constructor

Creates an PositionEventArgs with a position and a server cycle.

public PositionEventArgs(
Point2D pPosition,
int pServerCycle
);

Parameters

pPosition
The position
pServerCycle
The server cycle

See Also

PositionEventArgs Class | TeamYaffa.CRaPI.World Namespace


PositionEventArgs Properties

The properties of the PositionEventArgs class are listed below. For a complete list of PositionEventArgs class members, see the PositionEventArgs Members topic.

Public Instance Properties

Position | Gets the position
ServerCycle | Gets the server cycle

See Also

PositionEventArgs Class | TeamYaffa.CRaPI.World Namespace


PositionEventArgs.Position Property

Gets the position

public TeamYaffa.CRaPI.Utility.Point2D Position {get;}

See Also

PositionEventArgs Class | TeamYaffa.CRaPI.World Namespace


PositionEventArgs.ServerCycle Property

Gets the server cycle

public int ServerCycle {get;}

See Also

PositionEventArgs Class | TeamYaffa.CRaPI.World Namespace


PositionEventHandler Delegate

Handling event fired when player position has been calculated

public delegate void PositionEventHandler(
object sender,
PositionEventArgs e
);

Requirements

Namespace: TeamYaffa.CRaPI.World

Assembly: CRaPI (in CRaPI.dll)

See Also

TeamYaffa.CRaPI.World Namespace


PositionUnknownEventHandler Delegate

Handling event fired when position of one self is unknown

public delegate void PositionUnknownEventHandler(
object sender,
EventArgs e
);

Requirements

Namespace: TeamYaffa.CRaPI.World

Assembly: CRaPI (in CRaPI.dll)

See Also

TeamYaffa.CRaPI.World Namespace


TeamMatesEventHandler Delegate

Handling event fired when team mates have been updated

public delegate void TeamMatesEventHandler(
object sender,
FieldPlayerEventArgs e
);

Requirements

Namespace: TeamYaffa.CRaPI.World

Assembly: CRaPI (in CRaPI.dll)

See Also

TeamYaffa.CRaPI.World Namespace


WorldModel Class

This class represents the WorldModel of a player. The world model is the players (agents) perception of the state of the play field. E.g. the players position, the position of the team mates, opponents and the ball etc.

For a list of all members of this type, see WorldModel Members.

System.Object
WorldModel

public class WorldModel

Requirements

Namespace: TeamYaffa.CRaPI.World

Assembly: CRaPI (in CRaPI.dll)

See Also

WorldModel Members | TeamYaffa.CRaPI.World Namespace


WorldModel Members

WorldModel overview

Public Static Fields

MAXFLAGS | The number of flags used for positioning
NOISE | The noise factor

Public Static Methods

initStaticObjects Sets up the static objects, e.g. flags

Public Instance Constructors

WorldModel Constructor Constructs a new worldmodel

Public Instance Properties

AllOpponents | Gets all known opponents
AllTeamMates | Gets all known team-mates
MyPosition | The own position
Opponents | Gets all opponents.
Self | Gets the representation of the player that is associated with this worldmodel.
StaticObjects | Returns the static objects, e.g. flags and lines
TeamMates | Gets all teammates.
TheBall | Returns the ball
UpdatedFrame | Returns the simulation frame when the worldmodel was updated.
VagueBall | Returns the vague information about the ball, if the last information about the ball from the server wasn't accurate enough to calculate the balls position.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Public Instance Events

BallPositionCalculated | Event for ball position calculated
FlagsParsed | Event for Flags parsed
IntersectionsCalculated | Event for Intersections calculated
OpponentsCalculated | Event for opponents calculated
PlayerCalculated | Event for player calculated
PositionCalculated | Event for position of player calculated
PositionUnknown | Event indicating that the players own position is unknown
TeamMatesCalculated | Event for team mates calculated

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
OnBallPositionCalculated | Generates a BallPositionCalculated event when the position of the ball has calculated
OnFlagsParsed | Generates a FlagsParsed event when all flags have been parsed
OnIntersectionsCalculated | Generates a IntersectionsCalculated when all intersections have been calculated
OnOpponentsCalculated | Generates a OpponentsCalculated event when all have been calculated
OnPlayerCalculated | Generates a PlayerCalculated event when the player has been updated
OnPositionCalculated | Generates a PositionCalculated event when the players own position has been calculated
OnPositionUnknown | Generates a PositionUnknown event when own position is unknown
OnTeamMatesCalculated | Generates a TeamMates calculated event when all team mates have been calulated

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel Constructor

Constructs a new worldmodel

public WorldModel(
Player pPlayer
);

Parameters

pPlayer
The player that is assoicated with this world model

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel Fields

The fields of the WorldModel class are listed below. For a complete list of WorldModel class members, see the WorldModel Members topic.

Public Static Fields

MAXFLAGS | The number of flags used for positioning
NOISE | The noise factor

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.MAXFLAGS Field

The number of flags used for positioning

public const int MAXFLAGS;

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.NOISE Field

The noise factor

public const double NOISE;

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel Properties

The properties of the WorldModel class are listed below. For a complete list of WorldModel class members, see the WorldModel Members topic.

Public Instance Properties

AllOpponents | Gets all known opponents
AllTeamMates | Gets all known team-mates
MyPosition | The own position
Opponents | Gets all opponents.
Self | Gets the representation of the player that is associated with this worldmodel.
StaticObjects | Returns the static objects, e.g. flags and lines
TeamMates | Gets all teammates.
TheBall | Returns the ball
UpdatedFrame | Returns the simulation frame when the worldmodel was updated.
VagueBall | Returns the vague information about the ball, if the last information about the ball from the server wasn't accurate enough to calculate the balls position.

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.AllOpponents Property

Gets all known opponents

public GameObjects.FieldPlayer[] AllOpponents {get;}

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.AllTeamMates Property

Gets all known team-mates

public GameObjects.FieldPlayer[] AllTeamMates {get;}

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.MyPosition Property

The own position

public TeamYaffa.CRaPI.Utility.Point2D MyPosition {get;}

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.Opponents Property

Gets all opponents.

public System.Collections.ArrayList Opponents {get;}

Property Value

An ArrayList

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.Self Property

Gets the representation of the player that is associated with this worldmodel.

public GameObjects.FieldPlayer Self {get;}

Property Value

A represention of ourself

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.StaticObjects Property

Returns the static objects, e.g. flags and lines

public System.Collections.Hashtable StaticObjects {get;}

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.TeamMates Property

Gets all teammates.

public System.Collections.ArrayList TeamMates {get;}

Property Value

An ArrayList

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.TheBall Property

Returns the ball

public GameObjects.Ball TheBall {get;}

Property Value

The ball object.

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.UpdatedFrame Property

Returns the simulation frame when the worldmodel was updated.

public int UpdatedFrame {get;}

Property Value

Initially this will return -1 until the worldmodel is updated.

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.VagueBall Property

Returns the vague information about the ball, if the last information about the ball from the server wasn't accurate enough to calculate the balls position.

public GameObjects.VagueObject VagueBall {get;}

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel Methods

The methods of the WorldModel class are listed below. For a complete list of WorldModel class members, see the WorldModel Members topic.

Public Static Methods

initStaticObjects Sets up the static objects, e.g. flags

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
OnBallPositionCalculated | Generates a BallPositionCalculated event when the position of the ball has calculated
OnFlagsParsed | Generates a FlagsParsed event when all flags have been parsed
OnIntersectionsCalculated | Generates a IntersectionsCalculated when all intersections have been calculated
OnOpponentsCalculated | Generates a OpponentsCalculated event when all have been calculated
OnPlayerCalculated | Generates a PlayerCalculated event when the player has been updated
OnPositionCalculated | Generates a PositionCalculated event when the players own position has been calculated
OnPositionUnknown | Generates a PositionUnknown event when own position is unknown
OnTeamMatesCalculated | Generates a TeamMates calculated event when all team mates have been calulated

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.initStaticObjects Method

Sets up the static objects, e.g. flags

public static Hashtable initStaticObjects(
Side pTeamSide
);

Return Value

The static objects

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.OnBallPositionCalculated Method

Generates a BallPositionCalculated event when the position of the ball has calculated

protected void OnBallPositionCalculated(
PositionEventArgs e
);

Parameters

e
The event arguments

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.OnFlagsParsed Method

Generates a FlagsParsed event when all flags have been parsed

protected void OnFlagsParsed(
FlagsEventArgs e
);

Parameters

e
The event arguments

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.OnIntersectionsCalculated Method

Generates a IntersectionsCalculated when all intersections have been calculated

protected void OnIntersectionsCalculated(
IntersectionsEventArgs e
);

Parameters

e
The event arguments

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.OnOpponentsCalculated Method

Generates a OpponentsCalculated event when all have been calculated

protected void OnOpponentsCalculated(
FieldPlayerEventArgs e
);

Parameters

e
The event arguments

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.OnPlayerCalculated Method

Generates a PlayerCalculated event when the player has been updated

protected void OnPlayerCalculated(
FieldPlayerEventArgs e
);

Parameters

e
The event arguments

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.OnPositionCalculated Method

Generates a PositionCalculated event when the players own position has been calculated

protected void OnPositionCalculated(
PositionEventArgs e
);

Parameters

e
The event arguments

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.OnPositionUnknown Method

Generates a PositionUnknown event when own position is unknown

protected void OnPositionUnknown();

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.OnTeamMatesCalculated Method

Generates a TeamMates calculated event when all team mates have been calulated

protected void OnTeamMatesCalculated(
FieldPlayerEventArgs e
);

Parameters

e
The event arguments

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel Events

The events of the WorldModel class are listed below. For a complete list of WorldModel class members, see the WorldModel Members topic.

Public Instance Events

BallPositionCalculated | Event for ball position calculated
FlagsParsed | Event for Flags parsed
IntersectionsCalculated | Event for Intersections calculated
OpponentsCalculated | Event for opponents calculated
PlayerCalculated | Event for player calculated
PositionCalculated | Event for position of player calculated
PositionUnknown | Event indicating that the players own position is unknown
TeamMatesCalculated | Event for team mates calculated

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.BallPositionCalculated Event

Event for ball position calculated

public event PositionEventHandler BallPositionCalculated;

Event Data

The event handler receives an argument of type PositionEventArgs containing data related to this event. The following PositionEventArgs properties provide information specific to this event.

Property | Description
Position | Gets the position
ServerCycle | Gets the server cycle

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.FlagsParsed Event

Event for Flags parsed

public event FlagsEventHandler FlagsParsed;

Event Data

The event handler receives an argument of type FlagsEventArgs containing data related to this event. The following FlagsEventArgs properties provide information specific to this event.

Property | Description
Flags | Gets the array of flags
ServerCycle | Gets the server cycle

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.IntersectionsCalculated Event

Event for Intersections calculated

public event IntersectionsEventHandler IntersectionsCalculated;

Event Data

The event handler receives an argument of type IntersectionsEventArgs containing data related to this event. The following IntersectionsEventArgs properties provide information specific to this event.

Property | Description
Intersections | Gets the array of intersections
ServerCycle | Gets the server cycle

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.OpponentsCalculated Event

Event for opponents calculated

public event OpponentsEventHandler OpponentsCalculated;

Event Data

The event handler receives an argument of type FieldPlayerEventArgs containing data related to this event. The following FieldPlayerEventArgs properties provide information specific to this event.

Property | Description
Players | Gets the field players
ServerCycle | Gets the server cycle

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.PlayerCalculated Event

Event for player calculated

public event PlayerCalculatedEventHandler PlayerCalculated;

Event Data

The event handler receives an argument of type FieldPlayerEventArgs containing data related to this event. The following FieldPlayerEventArgs properties provide information specific to this event.

Property | Description
Players | Gets the field players
ServerCycle | Gets the server cycle

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.PositionCalculated Event

Event for position of player calculated

public event PositionEventHandler PositionCalculated;

Event Data

The event handler receives an argument of type PositionEventArgs containing data related to this event. The following PositionEventArgs properties provide information specific to this event.

Property | Description
Position | Gets the position
ServerCycle | Gets the server cycle

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.PositionUnknown Event

Event indicating that the players own position is unknown

public event PositionUnknownEventHandler PositionUnknown;

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


WorldModel.TeamMatesCalculated Event

Event for team mates calculated

public event TeamMatesEventHandler TeamMatesCalculated;

Event Data

The event handler receives an argument of type FieldPlayerEventArgs containing data related to this event. The following FieldPlayerEventArgs properties provide information specific to this event.

Property | Description
Players | Gets the field players
ServerCycle | Gets the server cycle

See Also

WorldModel Class | TeamYaffa.CRaPI.World Namespace


TeamYaffa.CRaPI.World.GameObjects

CRaPI - Correct Robust and Perfect API

TeamYaffa.CRaPI.World.GameObjects Namespace

Classes

Class | Description
Ball | This class represents a Ball.
FieldObject | This class represents a FieldObject.
FieldPlayer | This class represents a FieldPlayer.
GameObject | This class represents a GameObject.
MobileObject | This class represents a MobileObject.
VagueObject | A model of objects that are seen on the playfield, but where only the direction to the object is known.

Enumerations

Enumeration | Description
VagueType | What different VagueObjects CRaPI can handle.


Ball Class

This class represents a Ball.

For a list of all members of this type, see Ball Members.

System.Object
GameObject
FieldObject
MobileObject
Ball

public class Ball : MobileObject

Requirements

Namespace: TeamYaffa.CRaPI.World.GameObjects

Assembly: CRaPI (in CRaPI.dll)

See Also

Ball Members | TeamYaffa.CRaPI.World.GameObjects Namespace


Ball Members

Ball overview

Public Instance Constructors

Ball Constructor Initializes a new instance of the Ball class.

Public Instance Properties

Direction (inherited from GameObject) | Direction to the GameObject
DirectionChange (inherited from MobileObject) | The direction change
Distance (inherited from GameObject) | Distance to the GameObject
DistanceChange (inherited from MobileObject) | The distance change
Forecasts (inherited from MobileObject) | The forecasted positions of the MobileObject
LastSeen (inherited from MobileObject) | The server cycle in which this MobileObject was last seen
Name (inherited from GameObject) | The name
Position (inherited from FieldObject) | The position of the FieldObject
SeenThisCycle (inherited from MobileObject) | Gets and sets if the object has been seen this cycle.
SpeedAmount (inherited from MobileObject) | The current approximate speed of the MobileObject (distance per cycle)
SpeedDirection (inherited from MobileObject) | The current approximate direction of the speed of the MobileObject

Public Instance Methods

CalculateSpeed (inherited from MobileObject) | Calculates the speed direction and amount of this MobileObject
ClearForecasts (inherited from MobileObject) | Clears the forecasts
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
ForecastPosition (inherited from MobileObject) | Forecast the position of this MobileObject a certain cycles into the future
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString | Returns a string representation of the ball.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Ball Class | TeamYaffa.CRaPI.World.GameObjects Namespace


Ball Constructor

Initializes a new instance of the Ball class.

public Ball();

See Also

Ball Class | TeamYaffa.CRaPI.World.GameObjects Namespace


Ball Methods

The methods of the Ball class are listed below. For a complete list of Ball class members, see the Ball Members topic.

Public Instance Methods

CalculateSpeed (inherited from MobileObject) | Calculates the speed direction and amount of this MobileObject
ClearForecasts (inherited from MobileObject) | Clears the forecasts
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
ForecastPosition (inherited from MobileObject) | Forecast the position of this MobileObject a certain cycles into the future
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString | Returns a string representation of the ball.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Ball Class | TeamYaffa.CRaPI.World.GameObjects Namespace


Ball.ToString Method

Returns a string representation of the ball.

public override string ToString();

Return Value

string representation

See Also

Ball Class | TeamYaffa.CRaPI.World.GameObjects Namespace


FieldObject Class

This class represents a FieldObject.

For a list of all members of this type, see FieldObject Members.

System.Object
GameObject
FieldObject

public class FieldObject : GameObject

Requirements

Namespace: TeamYaffa.CRaPI.World.GameObjects

Assembly: CRaPI (in CRaPI.dll)

See Also

FieldObject Members | TeamYaffa.CRaPI.World.GameObjects Namespace


FieldObject Members

FieldObject overview

Public Instance Constructors

FieldObject Overloaded. Initializes a new instance of the FieldObject class.

Public Instance Properties

Direction (inherited from GameObject) | Direction to the GameObject
Distance (inherited from GameObject) | Distance to the GameObject
Name (inherited from GameObject) | The name
Position | The position of the FieldObject

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString | Returns a string representation of the FieldObject

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

FieldObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


FieldObject Constructor

Constructs a FieldObject

Overload List

Constructs a FieldObject

public FieldObject();

Constructs a FieldObject with a designated position

public FieldObject(Point2D);

Constructs a FieldObject with a designated position, distance, direction and name

public FieldObject(Point2D,double,double,string);

See Also

FieldObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


FieldObject Constructor ()

Constructs a FieldObject

public FieldObject();

See Also

FieldObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace | FieldObject Constructor Overload List


FieldObject Constructor (Point2D)

Constructs a FieldObject with a designated position

public FieldObject(
Point2D pPosition
);

Parameters

pPosition
The position

See Also

FieldObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace | FieldObject Constructor Overload List


FieldObject Constructor (Point2D, Double, Double, String)

Constructs a FieldObject with a designated position, distance, direction and name

public FieldObject(
Point2D pPosition,
double pDistance,
double pDirection,
string pName
);

Parameters

pPosition
The position
pDistance
The distance
pDirection
The direction
pName
The name

See Also

FieldObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace | FieldObject Constructor Overload List


FieldObject Properties

The properties of the FieldObject class are listed below. For a complete list of FieldObject class members, see the FieldObject Members topic.

Public Instance Properties

Direction (inherited from GameObject) | Direction to the GameObject
Distance (inherited from GameObject) | Distance to the GameObject
Name (inherited from GameObject) | The name
Position | The position of the FieldObject

See Also

FieldObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


FieldObject.Position Property

The position of the FieldObject

public TeamYaffa.CRaPI.Utility.Point2D Position {get; set;}

See Also

FieldObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


FieldObject Methods

The methods of the FieldObject class are listed below. For a complete list of FieldObject class members, see the FieldObject Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString | Returns a string representation of the FieldObject

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

FieldObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


FieldObject.ToString Method

Returns a string representation of the FieldObject

public override string ToString();

Return Value

string representation

See Also

FieldObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


FieldPlayer Class

This class represents a FieldPlayer.

For a list of all members of this type, see FieldPlayer Members.

System.Object
GameObject
FieldObject
MobileObject
FieldPlayer

public class FieldPlayer : MobileObject

Requirements

Namespace: TeamYaffa.CRaPI.World.GameObjects

Assembly: CRaPI (in CRaPI.dll)

See Also

FieldPlayer Members | TeamYaffa.CRaPI.World.GameObjects Namespace


FieldPlayer Members

FieldPlayer overview

Public Instance Constructors

FieldPlayer Overloaded. Initializes a new instance of the FieldPlayer class.

Public Instance Properties

AbsoluteBodyDirection | The direction of the body relative the opponent goal
AbsoluteFaceDirection | The direction of the face relative the opponent goal (absolute body direction + head angle)
BodyDirection | Direction of the body
Direction (inherited from GameObject) | Direction to the GameObject
DirectionChange (inherited from MobileObject) | The direction change
Distance (inherited from GameObject) | Distance to the GameObject
DistanceChange (inherited from MobileObject) | The distance change
FaceDirection | Direction of the face
Forecasts (inherited from MobileObject) | The forecasted positions of the MobileObject
Goalie | If this player is a goalie or not
HeadAngle | The angle of the head
LastSeen (inherited from MobileObject) | The server cycle in which this MobileObject was last seen
Name (inherited from GameObject) | The name
Position (inherited from FieldObject) | The position of the FieldObject
SeenThisCycle (inherited from MobileObject) | Gets and sets if the object has been seen this cycle.
SpeedAmount (inherited from MobileObject) | The current approximate speed of the MobileObject (distance per cycle)
SpeedDirection (inherited from MobileObject) | The current approximate direction of the speed of the MobileObject
TeamName | The team name
UniformNumber | The number

Public Instance Methods

CalculateSpeed (inherited from MobileObject) | Calculates the speed direction and amount of this MobileObject
ClearForecasts (inherited from MobileObject) | Clears the forecasts
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
ForecastPosition (inherited from MobileObject) | Forecast the position of this MobileObject a certain cycles into the future
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
SetData | Sets the data of the FieldPlayer
ToString | Returns a string representation of the FieldPlayer

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

FieldPlayer Class | TeamYaffa.CRaPI.World.GameObjects Namespace


FieldPlayer Constructor

Default constructor

Overload List

Default constructor

public FieldPlayer();

Constructs a FieldPlayer

public FieldPlayer(int);

Constructs a FieldPlayer

public FieldPlayer(int,bool);

Consructs a FieldPlayer

public FieldPlayer(string,int,bool,double,double,int,Point2D);

See Also

FieldPlayer Class | TeamYaffa.CRaPI.World.GameObjects Namespace


FieldPlayer Constructor ()

Default constructor

public FieldPlayer();

See Also

FieldPlayer Class | TeamYaffa.CRaPI.World.GameObjects Namespace | FieldPlayer Constructor Overload List


FieldPlayer Constructor (Int32)

Constructs a FieldPlayer

public FieldPlayer(
int pUniformNumber
);

Parameters

pUniformNumber
The number

See Also

FieldPlayer Class | TeamYaffa.CRaPI.World.GameObjects Namespace | FieldPlayer Constructor Overload List


FieldPlayer Constructor (Int32, Boolean)

Constructs a FieldPlayer

public FieldPlayer(
int pUniformNumber,
bool pGoalie
);

Parameters

pUniformNumber
The number
pGoalie
Toggle if this player is a goalie

See Also

FieldPlayer Class | TeamYaffa.CRaPI.World.GameObjects Namespace | FieldPlayer Constructor Overload List


FieldPlayer Constructor (String, Int32, Boolean, Double, Double, Int32, Point2D)

Consructs a FieldPlayer

public FieldPlayer(
string pTeamName,
int pUniformNumber,
bool pGoalie,
double pDirectionChange,
double pDistanceChange,
int pLastSeen,
Point2D pPosition
);

Parameters

pTeamName
The team name
pUniformNumber
The number
pGoalie
Toggle if this player is a goalie
pDirectionChange
The change in direction
pDistanceChange
The change in distance
pLastSeen
When this player was last seen
pPosition
The position

See Also

FieldPlayer Class | TeamYaffa.CRaPI.World.GameObjects Namespace | FieldPlayer Constructor Overload List


FieldPlayer Properties

The properties of the FieldPlayer class are listed below. For a complete list of FieldPlayer class members, see the FieldPlayer Members topic.

Public Instance Properties

AbsoluteBodyDirection | The direction of the body relative the opponent goal
AbsoluteFaceDirection | The direction of the face relative the opponent goal (absolute body direction + head angle)
BodyDirection | Direction of the body
Direction (inherited from GameObject) | Direction to the GameObject
DirectionChange (inherited from MobileObject) | The direction change
Distance (inherited from GameObject) | Distance to the GameObject
DistanceChange (inherited from MobileObject) | The distance change
FaceDirection | Direction of the face
Forecasts (inherited from MobileObject) | The forecasted positions of the MobileObject
Goalie | If this player is a goalie or not
HeadAngle | The angle of the head
LastSeen (inherited from MobileObject) | The server cycle in which this MobileObject was last seen
Name (inherited from GameObject) | The name
Position (inherited from FieldObject) | The position of the FieldObject
SeenThisCycle (inherited from MobileObject) | Gets and sets if the object has been seen this cycle.
SpeedAmount (inherited from MobileObject) | The current approximate speed of the MobileObject (distance per cycle)
SpeedDirection (inherited from MobileObject) | The current approximate direction of the speed of the MobileObject
TeamName | The team name
UniformNumber | The number

See Also

FieldPlayer Class | TeamYaffa.CRaPI.World.GameObjects Namespace


FieldPlayer.AbsoluteBodyDirection Property

The direction of the body relative the opponent goal

public double AbsoluteBodyDirection {get; set;}

See Also

FieldPlayer Class | TeamYaffa.CRaPI.World.GameObjects Namespace


FieldPlayer.AbsoluteFaceDirection Property

The direction of the face relative the opponent goal (absolute body direction + head angle)

public double AbsoluteFaceDirection {get; set;}

See Also

FieldPlayer Class | TeamYaffa.CRaPI.World.GameObjects Namespace


FieldPlayer.BodyDirection Property

Direction of the body

public double BodyDirection {get; set;}

See Also

FieldPlayer Class | TeamYaffa.CRaPI.World.GameObjects Namespace


FieldPlayer.FaceDirection Property

Direction of the face

public double FaceDirection {get; set;}

See Also

FieldPlayer Class | TeamYaffa.CRaPI.World.GameObjects Namespace


FieldPlayer.Goalie Property

If this player is a goalie or not

public bool Goalie {get; set;}

See Also

FieldPlayer Class | TeamYaffa.CRaPI.World.GameObjects Namespace


FieldPlayer.HeadAngle Property

The angle of the head

public double HeadAngle {get; set;}

See Also

FieldPlayer Class | TeamYaffa.CRaPI.World.GameObjects Namespace


FieldPlayer.TeamName Property

The team name

public string TeamName {get; set;}

See Also

FieldPlayer Class | TeamYaffa.CRaPI.World.GameObjects Namespace


FieldPlayer.UniformNumber Property

The number

public int UniformNumber {get; set;}

See Also

FieldPlayer Class | TeamYaffa.CRaPI.World.GameObjects Namespace


FieldPlayer Methods

The methods of the FieldPlayer class are listed below. For a complete list of FieldPlayer class members, see the FieldPlayer Members topic.

Public Instance Methods

CalculateSpeed (inherited from MobileObject) | Calculates the speed direction and amount of this MobileObject
ClearForecasts (inherited from MobileObject) | Clears the forecasts
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
ForecastPosition (inherited from MobileObject) | Forecast the position of this MobileObject a certain cycles into the future
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
SetData | Sets the data of the FieldPlayer
ToString | Returns a string representation of the FieldPlayer

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

FieldPlayer Class | TeamYaffa.CRaPI.World.GameObjects Namespace


FieldPlayer.SetData Method

Sets the data of the FieldPlayer

public void SetData(
FieldPlayer pFP
);

Parameters

pFP
The FieldPlayer to copy data from

Remarks

Used in some cases to not have to construct a new FieldPlayer

See Also

FieldPlayer Class | TeamYaffa.CRaPI.World.GameObjects Namespace


FieldPlayer.ToString Method

Returns a string representation of the FieldPlayer

public override string ToString();

Return Value

string representation

See Also

FieldPlayer Class | TeamYaffa.CRaPI.World.GameObjects Namespace


GameObject Class

This class represents a GameObject.

For a list of all members of this type, see GameObject Members.

System.Object
GameObject

public class GameObject

Requirements

Namespace: TeamYaffa.CRaPI.World.GameObjects

Assembly: CRaPI (in CRaPI.dll)

See Also

GameObject Members | TeamYaffa.CRaPI.World.GameObjects Namespace


GameObject Members

GameObject overview

Public Instance Constructors

GameObject Overloaded. Initializes a new instance of the GameObject class.

Public Instance Properties

Direction | Direction to the GameObject
Distance | Distance to the GameObject
Name | The name

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString | Returns a string representation of the GameObject

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

GameObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


GameObject Constructor

Constructs a GameObject

Overload List

Constructs a GameObject

public GameObject();

Constructs a GameObject

public GameObject(double,double,string);

See Also

GameObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


GameObject Constructor ()

Constructs a GameObject

public GameObject();

See Also

GameObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace | GameObject Constructor Overload List


GameObject Constructor (Double, Double, String)

Constructs a GameObject

public GameObject(
double pDistance,
double pDirection,
string pName
);

Parameters

pDistance
Distance to the GameObject
pDirection
Direction to the GameObject
pName
The name

See Also

GameObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace | GameObject Constructor Overload List


GameObject Properties

The properties of the GameObject class are listed below. For a complete list of GameObject class members, see the GameObject Members topic.

Public Instance Properties

Direction | Direction to the GameObject
Distance | Distance to the GameObject
Name | The name

See Also

GameObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


GameObject.Direction Property

Direction to the GameObject

public double Direction {get; set;}

See Also

GameObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


GameObject.Distance Property

Distance to the GameObject

public double Distance {get; set;}

See Also

GameObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


GameObject.Name Property

The name

public string Name {get; set;}

See Also

GameObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


GameObject Methods

The methods of the GameObject class are listed below. For a complete list of GameObject class members, see the GameObject Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString | Returns a string representation of the GameObject

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

GameObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


GameObject.ToString Method

Returns a string representation of the GameObject

public override string ToString();

Return Value

string representation

See Also

GameObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


MobileObject Class

This class represents a MobileObject.

For a list of all members of this type, see MobileObject Members.

System.Object
GameObject
FieldObject
MobileObject

public class MobileObject : FieldObject

Requirements

Namespace: TeamYaffa.CRaPI.World.GameObjects

Assembly: CRaPI (in CRaPI.dll)

See Also

MobileObject Members | TeamYaffa.CRaPI.World.GameObjects Namespace


MobileObject Members

MobileObject overview

Public Instance Constructors

MobileObject Overloaded. Initializes a new instance of the MobileObject class.

Public Instance Properties

Direction (inherited from GameObject) | Direction to the GameObject
DirectionChange | The direction change
Distance (inherited from GameObject) | Distance to the GameObject
DistanceChange | The distance change
Forecasts | The forecasted positions of the MobileObject
LastSeen | The server cycle in which this MobileObject was last seen
Name (inherited from GameObject) | The name
Position (inherited from FieldObject) | The position of the FieldObject
SeenThisCycle | Gets and sets if the object has been seen this cycle.
SpeedAmount | The current approximate speed of the MobileObject (distance per cycle)
SpeedDirection | The current approximate direction of the speed of the MobileObject

Public Instance Methods

CalculateSpeed | Calculates the speed direction and amount of this MobileObject
ClearForecasts | Clears the forecasts
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
ForecastPosition | Forecast the position of this MobileObject a certain cycles into the future
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString | Returns a string representation of the MobileObject

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

MobileObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


MobileObject Constructor

Default constructor

Overload List

Default constructor

public MobileObject();

Constructs a MobileObject

public MobileObject(double,double,int,Point2D);

Constructs a MobileObject

public MobileObject(double,double,int,Point2D,double,double,string);

Constructs a MobileObject

public MobileObject(int,Point2D);

See Also

MobileObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


MobileObject Constructor ()

Default constructor

public MobileObject();

Remarks

Sets last seen to -1

See Also

MobileObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace | MobileObject Constructor Overload List


MobileObject Constructor (Double, Double, Int32, Point2D, Double, Double, String)

Constructs a MobileObject

public MobileObject(
double pDirectionChange,
double pDistanceChange,
int pLastSeen,
Point2D pPosition,
double pDistance,
double pDirection,
string pName
);

Parameters

pDirectionChange
The direction change
pDistanceChange
The distance change
pLastSeen
The server cycle in which this MobileObject was last seen
pPosition
The position
pDistance
The distance to this MobileObject
pDirection
The direction to this MobileObject
pName
The name of this MobileObject

See Also

MobileObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace | MobileObject Constructor Overload List


MobileObject Constructor (Double, Double, Int32, Point2D)

Constructs a MobileObject

public MobileObject(
double pDirectionChange,
double pDistanceChange,
int pLastSeen,
Point2D pPosition
);

Parameters

pDirectionChange
The direction change
pDistanceChange
The distance change
pLastSeen
The server cycle in which this MobileObject was last seen
pPosition
The position

See Also

MobileObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace | MobileObject Constructor Overload List


MobileObject Constructor (Int32, Point2D)

Constructs a MobileObject

public MobileObject(
int pLastSeen,
Point2D pPosition
);

Parameters

pLastSeen
The server cycle in which this MobileObject was last seen
pPosition
The position

See Also

MobileObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace | MobileObject Constructor Overload List


MobileObject Properties

The properties of the MobileObject class are listed below. For a complete list of MobileObject class members, see the MobileObject Members topic.

Public Instance Properties

Direction (inherited from GameObject) | Direction to the GameObject
DirectionChange | The direction change
Distance (inherited from GameObject) | Distance to the GameObject
DistanceChange | The distance change
Forecasts | The forecasted positions of the MobileObject
LastSeen | The server cycle in which this MobileObject was last seen
Name (inherited from GameObject) | The name
Position (inherited from FieldObject) | The position of the FieldObject
SeenThisCycle | Gets and sets if the object has been seen this cycle.
SpeedAmount | The current approximate speed of the MobileObject (distance per cycle)
SpeedDirection | The current approximate direction of the speed of the MobileObject

See Also

MobileObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


MobileObject.DirectionChange Property

The direction change

public double DirectionChange {get; set;}

See Also

MobileObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


MobileObject.DistanceChange Property

The distance change

public double DistanceChange {get; set;}

See Also

MobileObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


MobileObject.Forecasts Property

The forecasted positions of the MobileObject

public TeamYaffa.CRaPI.Utility.Point2D[] Forecasts {get;}

See Also

MobileObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


MobileObject.LastSeen Property

The server cycle in which this MobileObject was last seen

public int LastSeen {get; set;}

See Also

MobileObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


MobileObject.SeenThisCycle Property

Gets and sets if the object has been seen this cycle.

public bool SeenThisCycle {get; set;}

See Also

MobileObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


MobileObject.SpeedAmount Property

The current approximate speed of the MobileObject (distance per cycle)

public double SpeedAmount {get; set;}

See Also

MobileObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


MobileObject.SpeedDirection Property

The current approximate direction of the speed of the MobileObject

public double SpeedDirection {get; set;}

See Also

MobileObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


MobileObject Methods

The methods of the MobileObject class are listed below. For a complete list of MobileObject class members, see the MobileObject Members topic.

Public Instance Methods

CalculateSpeed | Calculates the speed direction and amount of this MobileObject
ClearForecasts | Clears the forecasts
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
ForecastPosition | Forecast the position of this MobileObject a certain cycles into the future
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString | Returns a string representation of the MobileObject

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

MobileObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


MobileObject.CalculateSpeed Method

Calculates the speed direction and amount of this MobileObject

public void CalculateSpeed(
FieldPlayer pSelf
);

Parameters

pSelf
This player

See Also

MobileObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


MobileObject.ClearForecasts Method

Clears the forecasts

public void ClearForecasts();

See Also

MobileObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


MobileObject.ForecastPosition Method

Forecast the position of this MobileObject a certain cycles into the future

public Point2D ForecastPosition(
int pCycles,
Positioner pPositioner
);

Parameters

pCycles
The number of cycles for forecast
pPositioner
The positioner to use when calculating the position

Return Value

A forecasted position

See Also

MobileObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


MobileObject.ToString Method

Returns a string representation of the MobileObject

public override string ToString();

Return Value

string representation

See Also

MobileObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


VagueObject Class

A model of objects that are seen on the playfield, but where only the direction to the object is known.

For a list of all members of this type, see VagueObject Members.

System.Object
VagueObject

public class VagueObject

Requirements

Namespace: TeamYaffa.CRaPI.World.GameObjects

Assembly: CRaPI (in CRaPI.dll)

See Also

VagueObject Members | TeamYaffa.CRaPI.World.GameObjects Namespace


VagueObject Members

VagueObject overview

Public Instance Constructors

VagueObject Constructor Creates the VagueObject with a type, direction and what cycle it was seen.

Public Instance Fields

mType The type of object, i.e. player, ball or flag

Public Instance Properties

Direction | The direction to the object
LastSeen | What cycle the object was seen
Type | The type of the vague object

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

VagueObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


VagueObject Constructor

Creates the VagueObject with a type, direction and what cycle it was seen.

public VagueObject(
VagueType pType,
double pDirection,
int pCycle
);

Parameters

pType
What type of object that is seen.
pDirection
In what direction the object was seen.
pCycle
What cycle it was seen.

See Also

VagueObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


VagueObject Fields

The fields of the VagueObject class are listed below. For a complete list of VagueObject class members, see the VagueObject Members topic.

Public Instance Fields

mType The type of object, i.e. player, ball or flag

See Also

VagueObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


VagueObject.mType Field

The type of object, i.e. player, ball or flag

public VagueType mType;

See Also

VagueObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


VagueObject Properties

The properties of the VagueObject class are listed below. For a complete list of VagueObject class members, see the VagueObject Members topic.

Public Instance Properties

Direction | The direction to the object
LastSeen | What cycle the object was seen
Type | The type of the vague object

See Also

VagueObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


VagueObject.Direction Property

The direction to the object

public double Direction {get;}

See Also

VagueObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


VagueObject.LastSeen Property

What cycle the object was seen

public int LastSeen {get;}

See Also

VagueObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


VagueObject.Type Property

The type of the vague object

public VagueType Type {get;}

See Also

VagueObject Class | TeamYaffa.CRaPI.World.GameObjects Namespace


VagueType Enumeration

What different VagueObjects CRaPI can handle.

public enum VagueType

Members

Member Name | Description
player | A player
ball | The ball
flag | A flag

Requirements

Namespace: TeamYaffa.CRaPI.World.GameObjects

Assembly: CRaPI (in CRaPI.dll)

See Also

TeamYaffa.CRaPI.World.GameObjects Namespace


TeamYaffa.CRaPI.World.Positioning

CRaPI - Correct Robust and Perfect API

TeamYaffa.CRaPI.World.Positioning Namespace

Classes

Class | Description
Positioner | This class handles positioning of the player with the help of IntersectionPoints.


Positioner Class

This class handles positioning of the player with the help of IntersectionPoints.

For a list of all members of this type, see Positioner Members.

System.Object
Positioner

public class Positioner

Requirements

Namespace: TeamYaffa.CRaPI.World.Positioning

Assembly: CRaPI (in CRaPI.dll)

See Also

Positioner Members | TeamYaffa.CRaPI.World.Positioning Namespace


Positioner Members

Positioner overview

Public Static Methods

XToWorld | Converts a X-coordinate to the coordinate system of the play field
YToWorld | Converts a Y-coordinate to the coordinate system of the play field

Public Instance Constructors

Positioner Constructor Creates a Positioner object

Public Instance Properties

Resolution Gets and sets the resolution used for positioning

Public Instance Methods

CalculateClosestLegalPosition | Calculates the position within the play-field that is closest to a point
CalculateDeadReckoningPosition | Calculate the coordinates of the position of the player with regard to previous location, direction and speed
CalculatePosition | Calculates the position of an object from the supplied intersections
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Positioner Class | TeamYaffa.CRaPI.World.Positioning Namespace


Positioner Constructor

Creates a Positioner object

public Positioner(
double pStep,
WorldModel pWM
);

Parameters

pStep
The simulator step
pWM
The actual world-model of the agent

See Also

Positioner Class | TeamYaffa.CRaPI.World.Positioning Namespace


Positioner Properties

The properties of the Positioner class are listed below. For a complete list of Positioner class members, see the Positioner Members topic.

Public Instance Properties

Resolution Gets and sets the resolution used for positioning

See Also

Positioner Class | TeamYaffa.CRaPI.World.Positioning Namespace


Positioner.Resolution Property

Gets and sets the resolution used for positioning

public double Resolution {get; set;}

See Also

Positioner Class | TeamYaffa.CRaPI.World.Positioning Namespace


Positioner Methods

The methods of the Positioner class are listed below. For a complete list of Positioner class members, see the Positioner Members topic.

Public Static Methods

XToWorld | Converts a X-coordinate to the coordinate system of the play field
YToWorld | Converts a Y-coordinate to the coordinate system of the play field

Public Instance Methods

CalculateClosestLegalPosition | Calculates the position within the play-field that is closest to a point
CalculateDeadReckoningPosition | Calculate the coordinates of the position of the player with regard to previous location, direction and speed
CalculatePosition | Calculates the position of an object from the supplied intersections
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Positioner Class | TeamYaffa.CRaPI.World.Positioning Namespace


Positioner.CalculateClosestLegalPosition Method

Calculates the position within the play-field that is closest to a point

public Point2D CalculateClosestLegalPosition(
Point2D pPosition
);

Parameters

pPosition
The point to be as close to as possible

Return Value

The point closest to pPosition

See Also

Positioner Class | TeamYaffa.CRaPI.World.Positioning Namespace


Positioner.CalculateDeadReckoningPosition Method

Calculate the coordinates of the position of the player with regard to previous location, direction and speed

public Point2D CalculateDeadReckoningPosition(
Point2D pOldPos,
double pDirection,
double pSpeed,
int pCycles
);

Parameters

pOldPos
The position in the previous cycle
pDirection
The direction
pSpeed
The speed
pCycles
How many cycles ahead the position should be calculated for

Return Value

The approximate location of the player

See Also

Positioner Class | TeamYaffa.CRaPI.World.Positioning Namespace


Positioner.CalculatePosition Method

Calculates the position of an object from the supplied intersections

public Point2D CalculatePosition(
Intersection[] pIntersections,
Point2D pDRPos
);

Parameters

pIntersections
An ArrayList of intersections
pDRPos
The position calculated with dead reckogning, used for weighing intersections

Return Value

The position of an object

See Also

Positioner Class | TeamYaffa.CRaPI.World.Positioning Namespace


Positioner.XToWorld Method

Converts a X-coordinate to the coordinate system of the play field

public static float XToWorld(
double x
);

Parameters

x
X coordinate to convert

Return Value

X coordinate

See Also

Positioner Class | TeamYaffa.CRaPI.World.Positioning Namespace


Positioner.YToWorld Method

Converts a Y-coordinate to the coordinate system of the play field

public static float YToWorld(
double y
);

Parameters

y
Y coordinate to convert

Return Value

Y coordinate

See Also

Positioner Class | TeamYaffa.CRaPI.World.Positioning Namespace