Class Formation

java.lang.Object
  |
  +--Formation
All Implemented Interfaces:
DebugInterface, StrategyGeneralInterface
Direct Known Subclasses:
Formation244, Formation433, Formation541, FormationCatenaggio

public abstract class Formation
extends java.lang.Object
implements StrategyGeneralInterface, DebugInterface

Abstract Formation class

Version:
1.00
Author:
Michael Schifferdecker

Field Summary
private  boolean DEBUG
          class internal debug switch
protected  java.awt.geom.Point2D.Double[] formationPointArray
          array for formation points
protected  java.awt.geom.Ellipse2D.Double[] formationShapeArray
          array for formation attention fields
protected  java.awt.geom.Point2D.Double[] formationStartPointArray
          array for formation start points
protected  char[] formationStrategicRoleArray
          array for strategic player roles (defensive, offensive or goalie role)
protected  Player player
          reference to Player
protected  java.awt.geom.Point2D.Double playerCurrentFormationPoint
          current formation point of player
 
Fields inherited from interface StrategyGeneralInterface
AUDIO_CUT_DIST, BALL_DECAY, BALL_RAND, BALL_SIZE, BALL_SPEED_MAX, BALL_WEIGHT, CATCH_BAN_CYCLE, CATCH_PROBABILITY, CATCHABLE_AREA_L, CATCHABLE_AREA_W, CKICK_MARGIN, DASH_POWER_RATE, EFFORT_DEC, EFFORT_DEC_THR, EFFORT_INC, EFFORT_INC_THR, EFFORT_MIN, FORMATION_244, FORMATION_433, FORMATION_541, FORMATION_CATENAGIO, FORMATIONS_NUM_OF, GOAL_CENTER_POINT, GOAL_WIDTH, HEAR_DECAY, HEAR_INC, HEAR_MAX, INERTIA_MOMENT, KICK_POWER_RATE, KICKABLE_AREA, KICKABLE_MARGIN, MAX_AUDIOINFO, MAX_DASH_PER_CYCLE, MAXMOMENT, MAXPOWER, MIN_STAMINA, MINMOMENT, MINPOWER, NECK, OFFSIDE_ACTIVE_AREA_SIZE, PENALTY_AREA_X_WIDTH, PENALTY_AREA_Y_WIDTH, PLAYER_DECAY, PLAYER_RAND, PLAYER_SIZE, PLAYER_SPEED_MAX, PLAYER_WEIGHT, PORT, RECOVER_DEC, RECOVER_DEC_THR, RECOVER_MIN, RECV_STEP, SEND_STEP, SENSE_BODY_STEP, SIMULATOR_STEP, SKILL_CENTER_EGDE_OF_VIEW, SKILL_CONST_SLOPE, SKILL_DEC_SLOPE, SKILL_DESTINATION_DASH, SKILL_DISTANCE_DASH, SKILL_DYNOBJ_DASH, SKILL_DYNOBJ_SHOOT, SKILL_FIX_ANGLE_TURN, SKILL_FIX_ANGLE_TURN_NECK, SKILL_HIGH_PRECISION, SKILL_INC_SLOPE, SKILL_INFINIT, SKILL_KOORD_SHOOT, SKILL_LEFT_EGDE_OF_VIEW, SKILL_LOW_PRECISION, SKILL_MEDIUM_PRECISION, SKILL_RIGHT_EGDE_OF_VIEW, SKILL_TO_COORDINATES_TURN, SKILL_TO_COORDINATES_TURN_NECK, SKILL_TO_DYNOBJ_TURN, STAMINA_INC_MAX, STAMINA_MAX, STRATEGIES, STRATEGY_FLAG_OPPGOAL, STRATEGY_FLAG_PUMP, STRATEGY_FLAG_TESTFLAG, VISIBLE_ANGLE
 
Fields inherited from interface DebugInterface
DEBUG_SWITCH_STRATEGY_IS_SET, DEBUG_SWITCH_VISUALISATION_IS_SET, DEBUG_SWITCH_WORLDMODEL_AUDIOEVENT_IS_SET, DEBUG_SWITCH_WORLDMODEL_BODYEVENT_IS_SET, DEBUG_SWITCH_WORLDMODEL_VISUALEVENT_IS_SET
 
Constructor Summary
Formation(Player player)
          standard constructor
 
Method Summary
protected  java.awt.geom.Point2D.Double findNearestFormationPoint()
          this method can be used to retrieve the nearest point to in a player formation (four players in defense line)
protected  java.awt.geom.Ellipse2D.Double getAttentionFieldByPlayerID(int playerID)
          getAttentionFieldByPlayerID
protected  java.awt.geom.Ellipse2D.Double getCurrentAttentionField()
          Method getTranslatedAttentionField.
protected  java.awt.geom.Point2D.Double getCurrentPlayerFormationPoint()
          this method can be used to retrieve the current formation position of a player with player number n from the playerHomePosArray
protected  java.awt.geom.Point2D.Double getFormationPointByPlayerID(int playerID)
          this method can be used to retrieve the current formation position of a player with player number n from the playerFormationPointArray
protected  java.awt.geom.Point2D.Double getFormationStartPointByPlayerID(int playerID)
          this method can be used to retrieve the current formation start position of a player with player number n from the playerFormationStartPointArray
 char getPlayerStrategicRole()
          this method can be used to get the current strategic role of a player (defensive, offensive, goalie)
 char getPlayerStrategicRole(int playerID)
          this method can be used to get the current strategic role of a player (defensive, offensive, goalie)
protected  java.awt.geom.Ellipse2D.Double getTranslatedAttentionField(java.awt.geom.Ellipse2D.Double area, java.awt.geom.Point2D.Double position)
          getTranslatedAttentionField
protected  void setPlayerFormationPoint(java.awt.geom.Point2D.Double newPlayerFormationPoint)
          this method can be used to set the current formation position of a player
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

player

protected Player player
reference to Player

formationPointArray

protected java.awt.geom.Point2D.Double[] formationPointArray
array for formation points

formationStartPointArray

protected java.awt.geom.Point2D.Double[] formationStartPointArray
array for formation start points

formationShapeArray

protected java.awt.geom.Ellipse2D.Double[] formationShapeArray
array for formation attention fields

formationStrategicRoleArray

protected char[] formationStrategicRoleArray
array for strategic player roles (defensive, offensive or goalie role)

playerCurrentFormationPoint

protected java.awt.geom.Point2D.Double playerCurrentFormationPoint
current formation point of player

DEBUG

private boolean DEBUG
class internal debug switch
Constructor Detail

Formation

public Formation(Player player)
standard constructor
Parameters:
player - reference to player
Method Detail

getFormationPointByPlayerID

protected java.awt.geom.Point2D.Double getFormationPointByPlayerID(int playerID)
this method can be used to retrieve the current formation position of a player with player number n from the playerFormationPointArray
Parameters:
playerID - number of player
Returns:
home position of player as 2D point (double precision)

getFormationStartPointByPlayerID

protected java.awt.geom.Point2D.Double getFormationStartPointByPlayerID(int playerID)
this method can be used to retrieve the current formation start position of a player with player number n from the playerFormationStartPointArray
Parameters:
playerID - number of player
Returns:
home position of player as 2D point (double precision)

getCurrentPlayerFormationPoint

protected java.awt.geom.Point2D.Double getCurrentPlayerFormationPoint()
this method can be used to retrieve the current formation position of a player with player number n from the playerHomePosArray
Returns:
home position of player as 2D point (double precision)

setPlayerFormationPoint

protected void setPlayerFormationPoint(java.awt.geom.Point2D.Double newPlayerFormationPoint)
this method can be used to set the current formation position of a player
Parameters:
newPlayerFormationPoint - new current formation point of player

findNearestFormationPoint

protected java.awt.geom.Point2D.Double findNearestFormationPoint()
this method can be used to retrieve the nearest point to in a player formation (four players in defense line)
Returns:
formation point for player as 2D point (double precision)

getAttentionFieldByPlayerID

protected java.awt.geom.Ellipse2D.Double getAttentionFieldByPlayerID(int playerID)
getAttentionFieldByPlayerID
Parameters:
playerID -  
Returns:
Ellipse2D

getTranslatedAttentionField

protected java.awt.geom.Ellipse2D.Double getTranslatedAttentionField(java.awt.geom.Ellipse2D.Double area,
                                                                     java.awt.geom.Point2D.Double position)
getTranslatedAttentionField
Parameters:
area -  
position - position of the player
Returns:
Ellipse2D.Double the recalculated attention field of the player

getCurrentAttentionField

protected java.awt.geom.Ellipse2D.Double getCurrentAttentionField()
Method getTranslatedAttentionField.
Returns:
Ellipse2D.Double the attention laid over the current pos og the player

getPlayerStrategicRole

public char getPlayerStrategicRole(int playerID)
this method can be used to get the current strategic role of a player (defensive, offensive, goalie)
Parameters:
playerID - number of player
Returns:
char strategic role of player

getPlayerStrategicRole

public char getPlayerStrategicRole()
this method can be used to get the current strategic role of a player (defensive, offensive, goalie)
Returns:
char current strategic role of player