soccerclient.datamanager
Class Field
java.lang.Object
|
+--soccerclient.datamanager.Field
- All Implemented Interfaces:
- java.io.Serializable
- public class Field
- extends java.lang.Object
- implements java.io.Serializable
Überschrift: Field
Beschreibung: In this class are all relevant information of the soccerfield saved.
The size of the field is represented by the constants maxX und maxY, whereas maxX is the
maximal length of the x-axis and maxY of the y-axis. Because of the mid point has the
coordinates (0,0) so the field is 2*maxX long and 2*maxY wide.
How to get the number of the flag?
Every flag is represented by maximal 3 characters, which can be G,L,R,P,C,B,T or
0,10,20,30,40,50. Each letter represents a int. Each number has the value number/10.
You can calculate the number this way:
Take the first character and multiply with 100.
Take the second character, if it exists, and multiply with 10.
Take the first character, if it exists.
Then add all three characters.
For example: (flag t l 20) has the value of T*100+L*10+2
Copyright: Copyright (c) 2002
Organisation: pm39
- Author:
- J.F.G
- See Also:
- Serialized Form
Constructor Summary |
Field()
Creates a new Field instance with default SoccerCup-Fieldinformation. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
G
public static final int G
L
public static final int L
R
public static final int R
P
public static final int P
C
public static final int C
B
public static final int B
T
public static final int T
maxX
public static final double maxX
maxY
public static final double maxY
LINE_L
public static final int LINE_L
LINE_R
public static final int LINE_R
LINE_T
public static final int LINE_T
LINE_B
public static final int LINE_B
LINE_NO
public static final int LINE_NO
goalY
public static final double goalY
outX
public static final double outX
outY
public static final double outY
penaltyY
public static final double penaltyY
penaltyX
public static final double penaltyX
radius
public static final double radius
Field
public Field()
- Creates a new
Field
instance with default SoccerCup-Fieldinformation.
getRightGoal
public Coordinate getRightGoal()
- Returns coordinate of the right goal (goal r)
- Returns:
- a
Coordinate
containing (goal r)
getLeftGoal
public Coordinate getLeftGoal()
- Returns coordinate of the left goal (goal l)
- Returns:
- a
Coordinate
containing (goal l)
getFlag
public Coordinate getFlag(int nr)
throws java.lang.Exception
- Returns coordinate of the flag specified by
nr
- Returns:
- a
Coordinate
containing coordinate of the flag - Throws:
Field.NoFlag
- if nr
specifies no flag