|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--soccerclient.datamanager.PlayerInfo
Überschrift: PlayerInfo
Beschreibung: This is the heart of datamanger. All information which a player know are safed in this or in some special class like Ball, Score, ... . This class is needed for saving and get information. Some information are safed raw, but all relative values are transformed in absolute values like coordinates or direction of body. If the player starts on the left side the coordinate system is the same of the server's one. Is the startside right, then the coordinate system is turned for 180 degree comparatively with the server. With methods like getObjectDir or getObjectDist the absolute values are transformed back to relative values.
Copyright: Copyright (c) 2002
Organisation: pm39
Inner Class Summary | |
(package private) class |
PlayerInfo.InvalidNumber
|
(package private) class |
PlayerInfo.NoLine
|
Field Summary | |
static boolean |
ENEMY
|
static boolean |
FRIEND
|
static boolean |
LEFT
|
static boolean |
RIGHT
|
Constructor Summary | |
PlayerInfo()
Creates a new PlayerInfo instance |
Method Summary | |
Area |
getAreaOfResponsibility()
|
Ball |
getBallObject()
Returns the ball-object. |
double |
getBodyDir()
Returns the direction of the body |
int |
getCatchCount()
Returns number of executed catch-commands |
int |
getChangeViewCount()
Returns number of executed change_view-commands |
PlayerInfo |
getCopy()
Creates and returns a copy of this object. |
int |
getDashCount()
Returns number of executed dash-commands |
double |
getEffort()
Returns effort |
OtherPlayer |
getEnemyGoalie()
Returns information about the goalie of the other team |
java.util.LinkedList |
getFarEnemy()
Returns the adverse players which uniformnumber is unknown |
java.util.LinkedList |
getFarFriend()
Returns the other friendly players which uniformnumber is unknown |
double |
getHeadAngle()
Returns direction of head |
int |
getKickCount()
Returns number of executed kick-commands |
Log |
getLog()
Returns log-object |
int |
getMoveCount()
Returns number of executed move-commands |
java.util.HashMap |
getNearEnemy()
Returns the adverse players which uniformnumber is known |
java.util.HashMap |
getNearFriend()
Returns the other friendly players which uniformnumber is known |
double |
getObjectDir(Coordinate coor)
Returns the relative direction to the object |
double |
getObjectDist(Coordinate coor)
Returns the relative distance to the object |
double |
getOffside()
Returns x-coordinate of offside-line |
Coordinate |
getOppGoal()
Returns the coordinate of the opponent goal |
Coordinate |
getOwnGoal()
Returns the coordinate of the own goal |
OtherPlayer |
getOwnGoalie()
Returns information about the own goalie |
Coordinate |
getOwnPositon()
Returns absolute position |
PlayMode |
getPlayModeObject()
Returns the playmode-object of the player. |
int |
getSayCount()
Returns number of executed say-commands |
Score |
getScore()
Returns score-object |
boolean |
getSide()
Returns the side of the own half |
double |
getSpeedAmount()
Returns amount of speed |
double |
getSpeedBallDir()
Returns speed-direction of ball |
double |
getSpeedDirection()
Returns direction of speed |
double |
getStamina()
Returns stamina |
Coordinate |
getStandardPosition()
|
Coordinate |
getStartPosition()
Returns the startposition in the formation |
boolean |
getStartSide()
Returns the begining side |
java.lang.String |
getTeamName()
Returns teamname |
int |
getTime()
Returns time |
int |
getTurnCount()
Returns number of executed turn-commands |
int |
getTurnNeckCount()
Returns number of executed turn_neck-commands |
int |
getUniformNumber()
Returns uniformnumber |
ViewMode |
getViewMode()
Returns the viewmode-object of the player. |
boolean |
getVisualInfoNeeded()
|
void |
setBallObject(double distance,
double direction,
int time)
Sets the coordinate of ball with timestamp |
void |
setBody(int quality,
int width,
double stamina,
double effort,
double speedAmount,
double speedDirection,
double headAngle,
int kickCount,
int dashCount,
int turnCount,
int sayCount,
int turnNeckCount,
int catchCount,
int moveCount,
int changeViewCount)
Sets the parameters of the body |
void |
setCatchCount(int catchCount)
Sets the value executed catch-commands |
void |
setChangeViewCount(int changeViewCount)
Sets the value executed change_view-commands |
void |
setDashCount(int dashCount)
Sets the value executed dash-commands |
void |
setEffort(double effort)
Sets the value of effort |
void |
setHeadAngle(double headAngle)
Sets the value of direction of head |
void |
setKickCount(int kickCount)
Sets the value executed kick-commands |
void |
setMoveCount(int moveCount)
Sets the value executed move-commands |
void |
setOtherPlayer(boolean team,
boolean goalie,
double distance,
double direction,
double distChange,
double dirChange,
double bodyDir,
double headDir,
int time)
Sets the parameters of a OtherPlayer with uniformnumber |
void |
setOtherPlayer(boolean team,
int number,
boolean goalie,
double distance,
double direction,
double distChange,
double dirChange,
double bodyDir,
double headDir,
int time)
Sets the parameters of a OtherPlayer without uniformnumber |
void |
setOwnPosition(int lineNumber,
double lineDir,
int flagNumber,
double flagDist,
double flagDir)
Sets the value of position |
void |
setSayCount(int sayCount)
Sets the value executed say-commands |
void |
setSide(boolean side)
Sets the side of the own half |
void |
setSpeedAmount(double speedAmount)
Sets the value of amount of speed |
void |
setSpeedDirection(double speedDirection)
Sets the value of direction of speed |
void |
setStamina(double stamina)
Sets the value of stamina |
void |
setStartSide(boolean startSide)
Sets the begining side |
void |
setTeamName(java.lang.String teamName)
Sets the teamname |
void |
setTime(int time)
Sets the value of time |
void |
setTurnCount(int turnCount)
Sets the value executed turn-commands |
void |
setTurnNeckCount(int turnNeckCount)
Sets the value executed turn_neck-commands |
void |
setUniformNumber(int nr)
Sets uniformnumber |
void |
setVisualInfoNeeded(boolean needed)
|
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final boolean LEFT
public static final boolean RIGHT
public static final boolean FRIEND
public static final boolean ENEMY
Constructor Detail |
public PlayerInfo()
PlayerInfo
instanceMethod Detail |
public PlayerInfo getCopy() throws java.lang.Exception
PlayerInfo
containing a clone of this instancejava.lang.CloneNotSupportedException
- public void setOtherPlayer(boolean team, int number, boolean goalie, double distance, double direction, double distChange, double dirChange, double bodyDir, double headDir, int time)
OtherPlayer
without uniformnumberteam
- a boolean
value specifying whether the other player is a FRIEND or an ENEMYnumber
- a int
value specifying unformnumbergoalie
- a boolean
value specifying whether the other player is a goaliedistance
- a double
value specifying the distance to the other playerdirection
- a double
value specifying relative direction to the other playerdistChange
- a double
value specifying change of the distance to the other playerdirChange
- a double
value specifying change of the relative direction to the other playerbodyDir
- a double
value specifying relative direction of the other player to this
playerheadDir
- a double
value specifying relative direction of the head of the other player to the head of this
playertime
- a int
value specifying the time when the information has been recievedpublic void setOtherPlayer(boolean team, boolean goalie, double distance, double direction, double distChange, double dirChange, double bodyDir, double headDir, int time)
OtherPlayer
with uniformnumberteam
- a boolean
value specifying whether the other player is a FRIEND or an ENEMYnumber
- a int
value specifying unformnumbergoalie
- a boolean
value specifying whether the other player is a goaliedistance
- a double
value specifying the distance to the other playerdirection
- a double
value specifying relative direction to the other playerdistChange
- a double
value specifying change of the distance to the other playerdirChange
- a double
value specifying change of the relative direction to the other playerbodyDir
- a double
value specifying relative direction of the other player to this
playerheadDir
- a double
value specifying relative direction of the head of the other player to the head of this
playertime
- a int
value specifying the time when the information has been recievedpublic java.util.HashMap getNearFriend()
HashMap
containing all known friendly players with uniformnumberpublic java.util.HashMap getNearEnemy()
HashMap
containing all known adverse players with uniformnumberpublic java.util.LinkedList getFarFriend()
LinkedList
containing all known friendly players without uniformnumberpublic java.util.LinkedList getFarEnemy()
LinkedList
containing all known adverse players without uniformnumberpublic OtherPlayer getOwnGoalie()
OtherPlayer
containing own goaliepublic OtherPlayer getEnemyGoalie()
OtherPlayer
containing the goalie of the other teampublic void setBody(int quality, int width, double stamina, double effort, double speedAmount, double speedDirection, double headAngle, int kickCount, int dashCount, int turnCount, int sayCount, int turnNeckCount, int catchCount, int moveCount, int changeViewCount) throws java.lang.Exception
quality
- a int
value specifying quality of the see-sense (ViewMode.LOW|ViewMode.HIGH)width
- a int
value specifying width of the see-sense (ViewMode.NARROW|ViewMode.NORMAL|ViewMode.HIGH)stamina
- a double
value specifying staminaeffort
- a double
value specifying effortspeedAmount
- a double
value specifying amount of speedspeedDirection
- a double
value specifying amount of effortheadAngle
- a double
value specifying direction of headkickCount
- a int
value specifying the numbers of executed kick-commandsdashCount
- a int
value specifying the numbers of executed dash-commandsturnCount
- a int
value specifying the numbers of executed turn-commandssayCount
- a int
value specifying the numbers of executed say-commandsturnNeckCount
- a int
value specifying the numbers of executed turn_neck-commandscatchCount
- a int
value specifying the numbers of executed catch-commandsmoveCount
- a int
value specifying the numbers of executed move-commandschangeViewCount
- a int
value specifying the numbers of executed change_view-commandsNoViewMode
- public boolean getSide()
public void setSide(boolean side)
LEFT
- for left side or RIGHT for right sidepublic void setStartSide(boolean startSide)
LEFT
- for left side or RIGHT for right sidepublic boolean getStartSide()
void
- public Coordinate getOppGoal()
Coordinate
containing the opponent goalpublic Coordinate getOwnGoal()
Coordinate
containing the own goalpublic double getOffside()
double
containing offside-linepublic int getUniformNumber()
int
containing uniformnumberpublic void setUniformNumber(int nr) throws java.lang.Exception
nr
- a int
value specifying uniformnumberPlayerInfo.InvalidNumber
- if nr
< 1 or nr
> 11public java.lang.String getTeamName()
String
containing teamnamepublic void setTeamName(java.lang.String teamName)
teamName
- a String
value specifying teamnamepublic ViewMode getViewMode()
ViewMode
containing viewmodepublic PlayMode getPlayModeObject()
PlayMode
containing playmodepublic double getStamina()
double
containing staminapublic void setStamina(double stamina)
stamina
- a double
value specifying staminapublic double getEffort()
double
containing effortpublic void setEffort(double effort)
effort
- a double
value specifying effortpublic double getSpeedAmount()
double
containing amount of speedpublic void setSpeedAmount(double speedAmount)
speedAmount
- a double
value specifying amount of speedpublic double getSpeedDirection()
double
containing direction of speedpublic void setSpeedDirection(double speedDirection)
speedDirection
- a double
value specifying direction of speedpublic double getHeadAngle()
double
containing direction of headpublic void setHeadAngle(double headAngle)
headAngel
- a double
value specifying direction of headpublic int getKickCount()
int
containing number of executed kick-commandspublic void setKickCount(int kickCount)
kickCount
- a int
value specifying executed kick-commandspublic int getDashCount()
int
containing number of executed dash-commandspublic void setDashCount(int dashCount)
dashCount
- a int
value specifying executed dash-commandspublic int getTurnCount()
int
containing number of executed turn-commandspublic void setTurnCount(int turnCount)
turnCount
- a int
value specifying executed turn-commandspublic int getSayCount()
int
containing number of executed say-commandspublic void setSayCount(int sayCount)
sayCount
- a int
value specifying executed say-commandspublic int getTurnNeckCount()
int
containing number of executed turn_neck-commandspublic void setTurnNeckCount(int turnNeckCount)
turnNeckCount
- a int
value specifying executed turn_neck-commandspublic int getCatchCount()
int
containing number of executed catch-commandspublic void setCatchCount(int catchCount)
catchCount
- a int
value specifying executed catch-commandspublic int getMoveCount()
int
containing number of executed move-commandspublic void setMoveCount(int moveCount)
moveCount
- a int
value specifying executed move-commandspublic int getChangeViewCount()
int
containing number of executed change_view-commandspublic void setChangeViewCount(int changeViewCount)
changeViewCount
- a int
value specifying executed change_view-commandspublic int getTime()
int
containing timepublic void setTime(int time)
time
- a int
value specifying timepublic Coordinate getOwnPositon()
Coordinate
containing absolute positionpublic Ball getBallObject()
Ball
containing absolute position of the ballpublic void setBallObject(double distance, double direction, int time)
distance
- a double
value specifying relative distance to the balldirection
- a double
value specifying relative direction to the balltime
- a int
value specifying tiemstamppublic Score getScore()
Score
public void setOwnPosition(int lineNumber, double lineDir, int flagNumber, double flagDist, double flagDir) throws java.lang.Exception
lineNumber
- a int
value specifying the linelineDist
- a double
value specifying distance to the linelineDir
- a double
value specifying relative direction to the lineflagNumber
- a int
value specifying the flagflagDist
- a double
value specifying distance to the flagflagDir
- a double
value specifying relative direction to the flagNoFlag,
- NoLinepublic Log getLog()
Logcode>
public Coordinate getStartPosition()
Coordinate
containing startpositionpublic Coordinate getStandardPosition()
public Area getAreaOfResponsibility()
public double getBodyDir()
double
containing direction of bodypublic double getSpeedBallDir()
double
containing speed-direction of ballpublic double getObjectDir(Coordinate coor)
coor
- a Coordinate
value specifying coordinate of the objectCoordinate
containing relative direction to objectpublic double getObjectDist(Coordinate coor)
coor
- a Coordinate
value specifying coordinate of the objectCoordinate
containing relative distance to objectpublic boolean getVisualInfoNeeded()
public void setVisualInfoNeeded(boolean needed)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |