rc.yoda
Class Yoda

java.lang.Object
  extended by robocode._RobotBase
      extended by robocode._Robot
          extended by robocode.Robot
              extended by robocode._AdvancedRobot
                  extended by robocode._AdvancedRadiansRobot
                      extended by robocode.AdvancedRobot
                          extended by rc.yoda.Yoda
All Implemented Interfaces:
java.lang.Runnable, robocode.robotinterfaces.IAdvancedEvents, robocode.robotinterfaces.IAdvancedRobot, robocode.robotinterfaces.IBasicEvents, robocode.robotinterfaces.IBasicEvents2, robocode.robotinterfaces.IBasicEvents3, robocode.robotinterfaces.IBasicRobot, robocode.robotinterfaces.IInteractiveEvents, robocode.robotinterfaces.IInteractiveRobot, robocode.robotinterfaces.IPaintEvents, robocode.robotinterfaces.IPaintRobot

public class Yoda
extends robocode.AdvancedRobot

Yoda is an AdvancedRobot that provides basic robot operations. Yoda has quick scan radar with a one hundred percent lock on the enemy and provides accurate energy tracking to provide an extra event method for additional high-level robot behaviours

Version:
v1.0
Author:
Robert Codd

Field Summary
 
Fields inherited from class robocode._RobotBase
out
 
Constructor Summary
Yoda()
           
 
Method Summary
 void onBulletHit(robocode.BulletHitEvent e)
          Event method called by Robocode when a bullet this robot fired hits another robot
 void onBulletHitBullet(robocode.BulletHitBulletEvent e)
          Event method called by Robocode when a bullet this robot fired collides with a bullet fired by another robot
 void onBulletMissed(robocode.BulletMissedEvent e)
          Event method called by Robocode when a bullet this robot fired hit a wall
 void onDeath(robocode.DeathEvent e)
          Event method called by Robocode when this robot dies
 void onHitByBullet(robocode.HitByBulletEvent e)
          Event method called by Robocode when this robot gets hit by a bullet
 void onHitRobot(robocode.HitRobotEvent e)
          Event method called by Robocode when this robot collides with another robot
 void onHitWall(robocode.HitWallEvent e)
          Event method called by Robocode when this robot hits a wall
 void onPaint(java.awt.Graphics2D g)
          Event method called by Robocode when this robot is allowed to draw debugging graphics to the screen
 void onRobotDeath(robocode.RobotDeathEvent e)
          Event method called by Robocode when a robot dies
 void onScannedRobot(robocode.ScannedRobotEvent e)
          Event method called by Robocode when this robot's scanner passes over another robot
 void onWin(robocode.WinEvent e)
          Event method called by Robocode when this robot wins a round
 void run()
          Yoda's default behavior, all actions in while loop execute every round
 void setFire(double power)
          fires a bullet with the specified power and keeps track of lossed energy due to firing
 
Methods inherited from class robocode.AdvancedRobot
addCustomEvent, clearAllEvents, execute, getAdvancedEventListener, getAllEvents, getBulletHitBulletEvents, getBulletHitEvents, getBulletMissedEvents, getDataDirectory, getDataFile, getDataQuotaAvailable, getDistanceRemaining, getEventPriority, getGunHeadingRadians, getGunTurnRemaining, getGunTurnRemainingRadians, getHeadingRadians, getHitByBulletEvents, getHitRobotEvents, getHitWallEvents, getRadarHeadingRadians, getRadarTurnRemaining, getRadarTurnRemainingRadians, getRobotDeathEvents, getScannedRobotEvents, getStatusEvents, getTurnRemaining, getTurnRemainingRadians, isAdjustGunForRobotTurn, isAdjustRadarForGunTurn, isAdjustRadarForRobotTurn, onCustomEvent, onSkippedTurn, removeCustomEvent, setAhead, setBack, setEventPriority, setFireBullet, setInterruptible, setMaxTurnRate, setMaxVelocity, setResume, setStop, setStop, setTurnGunLeft, setTurnGunLeftRadians, setTurnGunRight, setTurnGunRightRadians, setTurnLeft, setTurnLeftRadians, setTurnRadarLeft, setTurnRadarLeftRadians, setTurnRadarRight, setTurnRadarRightRadians, setTurnRight, setTurnRightRadians, turnGunLeftRadians, turnGunRightRadians, turnLeftRadians, turnRadarLeftRadians, turnRadarRightRadians, turnRightRadians, waitFor
 
Methods inherited from class robocode._AdvancedRobot
endTurn, getGunHeadingDegrees, getHeadingDegrees, getMaxWaitCount, getRadarHeadingDegrees, getWaitCount, setTurnGunLeftDegrees, setTurnGunRightDegrees, setTurnLeftDegrees, setTurnRadarLeftDegrees, setTurnRadarRightDegrees, setTurnRightDegrees, turnGunLeftDegrees, turnGunRightDegrees, turnLeftDegrees, turnRadarLeftDegrees, turnRadarRightDegrees, turnRightDegrees
 
Methods inherited from class robocode.Robot
ahead, back, doNothing, fire, fireBullet, getBasicEventListener, getBattleFieldHeight, getBattleFieldWidth, getEnergy, getGraphics, getGunCoolingRate, getGunHeading, getGunHeat, getHeading, getHeight, getInteractiveEventListener, getName, getNumRounds, getOthers, getPaintEventListener, getRadarHeading, getRobotRunnable, getRoundNum, getTime, getVelocity, getWidth, getX, getY, onBattleEnded, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragged, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onMouseWheelMoved, onRoundEnded, onStatus, resume, scan, setAdjustGunForRobotTurn, setAdjustRadarForGunTurn, setAdjustRadarForRobotTurn, setAllColors, setBodyColor, setBulletColor, setColors, setColors, setDebugProperty, setGunColor, setRadarColor, setScanColor, stop, stop, turnGunLeft, turnGunRight, turnLeft, turnRadarLeft, turnRadarRight, turnRight
 
Methods inherited from class robocode._Robot
getBattleNum, getGunCharge, getGunImageName, getLife, getNumBattles, getRadarImageName, getRobotImageName, setGunImageName, setRadarImageName, setRobotImageName
 
Methods inherited from class robocode._RobotBase
setOut, setPeer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface robocode.robotinterfaces.IBasicRobot
getBasicEventListener, getRobotRunnable, setOut, setPeer
 

Constructor Detail

Yoda

public Yoda()
Method Detail

run

public void run()
Yoda's default behavior, all actions in while loop execute every round

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class robocode.Robot

onScannedRobot

public void onScannedRobot(robocode.ScannedRobotEvent e)
Event method called by Robocode when this robot's scanner passes over another robot

Specified by:
onScannedRobot in interface robocode.robotinterfaces.IBasicEvents
Overrides:
onScannedRobot in class robocode.Robot
Parameters:
ScannedRobotEvent - information about the scanned robot

onHitByBullet

public void onHitByBullet(robocode.HitByBulletEvent e)
Event method called by Robocode when this robot gets hit by a bullet

Specified by:
onHitByBullet in interface robocode.robotinterfaces.IBasicEvents
Overrides:
onHitByBullet in class robocode.Robot
Parameters:
HitByBulletEvent - information about ther bullet that hit this robot

onBulletHit

public void onBulletHit(robocode.BulletHitEvent e)
Event method called by Robocode when a bullet this robot fired hits another robot

Specified by:
onBulletHit in interface robocode.robotinterfaces.IBasicEvents
Overrides:
onBulletHit in class robocode.Robot
Parameters:
BulletHitEvent - information about the robot that got hit by the bullet

onBulletMissed

public void onBulletMissed(robocode.BulletMissedEvent e)
Event method called by Robocode when a bullet this robot fired hit a wall

Specified by:
onBulletMissed in interface robocode.robotinterfaces.IBasicEvents
Overrides:
onBulletMissed in class robocode.Robot
Parameters:
BulletMissedEvent - information about the bullet

onBulletHitBullet

public void onBulletHitBullet(robocode.BulletHitBulletEvent e)
Event method called by Robocode when a bullet this robot fired collides with a bullet fired by another robot

Specified by:
onBulletHitBullet in interface robocode.robotinterfaces.IBasicEvents
Overrides:
onBulletHitBullet in class robocode.Robot
Parameters:
BulletHitBulletEvent - information about the bullets

onHitWall

public void onHitWall(robocode.HitWallEvent e)
Event method called by Robocode when this robot hits a wall

Specified by:
onHitWall in interface robocode.robotinterfaces.IBasicEvents
Overrides:
onHitWall in class robocode.Robot
Parameters:
HitWallEvent - information about the wall

onHitRobot

public void onHitRobot(robocode.HitRobotEvent e)
Event method called by Robocode when this robot collides with another robot

Specified by:
onHitRobot in interface robocode.robotinterfaces.IBasicEvents
Overrides:
onHitRobot in class robocode.Robot
Parameters:
HitRobotEvent - information about the collision and the other robot in the crash

onRobotDeath

public void onRobotDeath(robocode.RobotDeathEvent e)
Event method called by Robocode when a robot dies

Specified by:
onRobotDeath in interface robocode.robotinterfaces.IBasicEvents
Overrides:
onRobotDeath in class robocode.Robot
Parameters:
RobotDeathEvent - name of decaesed robot

onWin

public void onWin(robocode.WinEvent e)
Event method called by Robocode when this robot wins a round

Specified by:
onWin in interface robocode.robotinterfaces.IBasicEvents
Overrides:
onWin in class robocode.Robot
Parameters:
WinEvent -

onDeath

public void onDeath(robocode.DeathEvent e)
Event method called by Robocode when this robot dies

Specified by:
onDeath in interface robocode.robotinterfaces.IBasicEvents
Overrides:
onDeath in class robocode.AdvancedRobot
Parameters:
DeathEvent -

onPaint

public void onPaint(java.awt.Graphics2D g)
Event method called by Robocode when this robot is allowed to draw debugging graphics to the screen

Specified by:
onPaint in interface robocode.robotinterfaces.IPaintEvents
Overrides:
onPaint in class robocode.Robot
Parameters:
Graphics2D - graphics that provides drawing method for painting

setFire

public void setFire(double power)
fires a bullet with the specified power and keeps track of lossed energy due to firing

Overrides:
setFire in class robocode.AdvancedRobot
Parameters:
double - power of the bullet to fire