Class SkillDash

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

public class SkillDash
extends Skill

This class encapsulates the intelligence for a dash skill

Version:
0.01
Author:
Samuel Broscheit

Field Summary
private  double blurFactor
          The blur-factor steers the sharpness of the Destination, because a bot never runs that straight.
private  boolean correctedMyDirLastTime
          have already corrected direction ?
private  double currentDistance
          Current distance of the destination
private  int dashPower
          The dash power for the bot
private  byte dashType
          There are two Dash Types: The "dash to destination", and "dash a distance", they have constants defined in StrategyGeneralInterface
private  boolean DEBUG
          class internal debug switch
private  java.awt.geom.Point2D.Double destination
          The destination Point
(package private)  DynObject dynObject
          The destination Object
private  double percentage
          percentage between 0 and 1of current dash-power that should be inc/dec
private  byte precision
          precision
 
Fields inherited from class Skill
clearLock, cycles, 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
SkillDash(Player player, double dist, int power)
          Initialise the Skill with a distance, dashPower and a bunch of cycles
SkillDash(Player player, double dist, int power, int cycles)
          Initialise the Skill with a distance, dashPower and a bunch of cycles
SkillDash(Player player, DynObject dynObject, int power, byte precision)
          Initialise the Skill with a distance, dashPower and a bunch of cycles
SkillDash(Player player, DynObject dynObject, int power, byte precision, int cycles)
          Initialise the Skill with a distance, dashPower and a bunch of cycles
SkillDash(Player player, java.awt.geom.Point2D.Double dest, int power)
          Initialise the Skill with a destination, dashPower ,currentDistance gets computed right away
SkillDash(Player player, java.awt.geom.Point2D.Double dest, int power, byte precision)
          Initialise the Skill with a destination, dashPower precision, currentDistance gets computed right away
SkillDash(Player player, java.awt.geom.Point2D.Double dest, int power, byte precision, int cycles)
          Initialise the Skill with a destination, dashPower precision, currentDistance gets computed right away
SkillDash(Player player, java.awt.geom.Point2D.Double dest, int power, int cycles)
          Initialise the Skill with a destination, dashPower precision, currentDistance gets computed right away
 
Method Summary
(package private)  void debug(java.lang.String id, java.lang.String msg)
           
 void perform()
          performs the Skill
(package private)  void setblurFactor()
          setblurfactor in dependeny of precision with which the skill shall be executed
 boolean succeeded()
          checks wether the skill has succeede (TRUE --> will be deleted from SkillQueue)
 
Methods inherited from class Skill
isLocked, setClearLock
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

DEBUG

private final boolean DEBUG
class internal debug switch

dashType

private byte dashType
There are two Dash Types: The "dash to destination", and "dash a distance", they have constants defined in StrategyGeneralInterface

blurFactor

private double blurFactor
The blur-factor steers the sharpness of the Destination, because a bot never runs that straight. So we allow him this - so far hardwired - factor to be unprecise and give an succes when he is an circle with an radius of blurFactor the skill gives a success

currentDistance

private double currentDistance
Current distance of the destination

dynObject

DynObject dynObject
The destination Object

destination

private java.awt.geom.Point2D.Double destination
The destination Point

dashPower

private int dashPower
The dash power for the bot

percentage

private double percentage
percentage between 0 and 1of current dash-power that should be inc/dec

precision

private byte precision
precision

correctedMyDirLastTime

private boolean correctedMyDirLastTime
have already corrected direction ?
Constructor Detail

SkillDash

public SkillDash(Player player,
                 java.awt.geom.Point2D.Double dest,
                 int power)
Initialise the Skill with a destination, dashPower ,currentDistance gets computed right away
Parameters:
player - reference to player
dest - destination
power - dashPower

SkillDash

public SkillDash(Player player,
                 java.awt.geom.Point2D.Double dest,
                 int power,
                 byte precision)
Initialise the Skill with a destination, dashPower precision, currentDistance gets computed right away
Parameters:
player - reference to player
dest - destination
power - dashPower
precision - precision

SkillDash

public SkillDash(Player player,
                 java.awt.geom.Point2D.Double dest,
                 int power,
                 byte precision,
                 int cycles)
Initialise the Skill with a destination, dashPower precision, currentDistance gets computed right away
Parameters:
player - reference to player
dest - destination
precision - precision
cycles - cycles
power - power

SkillDash

public SkillDash(Player player,
                 java.awt.geom.Point2D.Double dest,
                 int power,
                 int cycles)
Initialise the Skill with a destination, dashPower precision, currentDistance gets computed right away
Parameters:
player - reference to player
dest - destination
power - dashPower
cycles - cycles

SkillDash

public SkillDash(Player player,
                 double dist,
                 int power,
                 int cycles)
Initialise the Skill with a distance, dashPower and a bunch of cycles
Parameters:
player - reference to player
dist - distance
power - dashPower
cycles - cycles

SkillDash

public SkillDash(Player player,
                 double dist,
                 int power)
Initialise the Skill with a distance, dashPower and a bunch of cycles
Parameters:
player - reference to player
dist - distance
power - dashPower

SkillDash

public SkillDash(Player player,
                 DynObject dynObject,
                 int power,
                 byte precision)
Initialise the Skill with a distance, dashPower and a bunch of cycles
Parameters:
player - reference to player
dynObject - destination
power - dashPower
precision - precision

SkillDash

public SkillDash(Player player,
                 DynObject dynObject,
                 int power,
                 byte precision,
                 int cycles)
Initialise the Skill with a distance, dashPower and a bunch of cycles
Parameters:
player - reference to player
dynObject - destination
power - dashPower
precision - precision
cycles - cycles
Method Detail

perform

public void perform()
performs the Skill
Overrides:
perform in class Skill

succeeded

public boolean succeeded()
checks wether the skill has succeede (TRUE --> will be deleted from SkillQueue)
Overrides:
succeeded in class Skill
Returns:
boolean succeeded

setblurFactor

void setblurFactor()
setblurfactor in dependeny of precision with which the skill shall be executed

debug

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