Class TacticsManager

java.lang.Object
  |
  +--TacticsManager
All Implemented Interfaces:
DebugInterface, StrategyGeneralInterface

public class TacticsManager
extends java.lang.Object
implements StrategyGeneralInterface, DebugInterface


Field Summary
(package private)  boolean DEBUG
          class internal debug switch
private  Player player
          pointer to Player
private  java.util.LinkedList TacticsQueue
          holds tactics that were generated for the current strategic game situation
 
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
TacticsManager(Player player)
          constructor
 
Method Summary
 void addTacticToQueue(Tactic tactic)
          adds a Tactic object to the TacticsQueue
 boolean canKickBall()
          returns whether the player is able to kick the ball
(ball is in kickable area then)
 boolean canKickBall(java.awt.geom.Point2D.Double ball)
          return wether a player is able to kick the ball
 boolean canSeeBall()
          returns whether the player can see the ball currently
 void clearTacticsQueue()
          clear the TacticsQueue
(package private)  int countNearerCoPlayersToPoint(java.awt.geom.Point2D point2D)
          Method get Number of nearer coplayers to ball.
(package private)  int countNearerOppPlayersToPoint(java.awt.geom.Point2D point2D)
          Method get Number of nearer coplayers to ball.
(package private)  void debug(java.lang.String id, java.lang.String msg)
           
 Tactic getCurrentTactic()
          returns the current tactic as a Tactic object from the TacticsQueue
(package private)  double getMoment(double speed, double turnAngle)
          Method getMoment returns the angle you have to turn if you want to turn turnAngle.
(package private)  java.awt.geom.Point2D.Double getNextPreGoal()
          getNextPreoGoal
(package private)  int getNoOfOppPlayersInArea(java.awt.geom.Rectangle2D area)
          Method get Number of oppplayers an Area
(package private)  java.awt.geom.Point2D.Double getPosOfNearestCoPlayer()
          Method returns the position of the nearest CoPlayer
 boolean isCatchable(java.awt.geom.Point2D.Double Point)
          returns wether ball is catchable for the goalie
 void removeSucessfullTacticsFromQueue()
          removes all succeede skills from the skill queue
 void removeTacticFromQueue()
          removes the first Tactic object from the TacticsQueue
 boolean TacticQueueIsEmpty()
          returns the current tactic as a Tactic object from the TacticsQueue
(package private)  java.awt.geom.Point2D.Double toOppSide(java.awt.geom.Point2D.Double Point)
          get opponents side coordinates from unsigned standard coordinate values
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

DEBUG

final boolean DEBUG
class internal debug switch

TacticsQueue

private java.util.LinkedList TacticsQueue
holds tactics that were generated for the current strategic game situation

player

private Player player
pointer to Player
Constructor Detail

TacticsManager

public TacticsManager(Player player)
constructor
Parameters:
player - pointer to player object
Method Detail

addTacticToQueue

public void addTacticToQueue(Tactic tactic)
adds a Tactic object to the TacticsQueue
Parameters:
tactic - to add

removeTacticFromQueue

public void removeTacticFromQueue()
removes the first Tactic object from the TacticsQueue

removeSucessfullTacticsFromQueue

public void removeSucessfullTacticsFromQueue()
removes all succeede skills from the skill queue

clearTacticsQueue

public void clearTacticsQueue()
clear the TacticsQueue

getCurrentTactic

public Tactic getCurrentTactic()
returns the current tactic as a Tactic object from the TacticsQueue
Returns:
Tactic object

TacticQueueIsEmpty

public boolean TacticQueueIsEmpty()
returns the current tactic as a Tactic object from the TacticsQueue
Returns:
Tactic object

canSeeBall

public boolean canSeeBall()
returns whether the player can see the ball currently
Returns:
TRUE if player sees the ball, FALSE if player does not see the ball

canKickBall

public boolean canKickBall()
returns whether the player is able to kick the ball
(ball is in kickable area then)
Returns:
boolean TRUE if ball is in kickable area and ball info is not too old, else return FALSE

canKickBall

public boolean canKickBall(java.awt.geom.Point2D.Double ball)
return wether a player is able to kick the ball
Parameters:
ball -  
Returns:
boolean canKickBall

isCatchable

public boolean isCatchable(java.awt.geom.Point2D.Double Point)
returns wether ball is catchable for the goalie
Parameters:
Point - ball
Returns:
boolean isCatchable

toOppSide

java.awt.geom.Point2D.Double toOppSide(java.awt.geom.Point2D.Double Point)
get opponents side coordinates from unsigned standard coordinate values
Parameters:
Point - point to convert
Returns:
java.awt.geom.Point2D.Double point with coordinates converted to oppSide

countNearerCoPlayersToPoint

int countNearerCoPlayersToPoint(java.awt.geom.Point2D point2D)
Method get Number of nearer coplayers to ball.
Parameters:
point2D - myDistance
Returns:
int

countNearerOppPlayersToPoint

int countNearerOppPlayersToPoint(java.awt.geom.Point2D point2D)
Method get Number of nearer coplayers to ball.
Parameters:
point2D - myDistance
Returns:
int

getNoOfOppPlayersInArea

int getNoOfOppPlayersInArea(java.awt.geom.Rectangle2D area)
Method get Number of oppplayers an Area
Parameters:
area -  
Returns:
int number of players that are seen inside the penalty area

getPosOfNearestCoPlayer

java.awt.geom.Point2D.Double getPosOfNearestCoPlayer()
Method returns the position of the nearest CoPlayer
Returns:
position of nearest player [double]

getNextPreGoal

java.awt.geom.Point2D.Double getNextPreGoal()
getNextPreoGoal
Returns:
java.awt.geom.Point2D.Double nextPreGoal

getMoment

double getMoment(double speed,
                 double turnAngle)
Method getMoment returns the angle you have to turn if you want to turn turnAngle.
Parameters:
speed -  
turnAngle -  
Returns:
double

debug

void debug(java.lang.String id,
           java.lang.String msg)