rc.yoda.plugin.guns
Class Random

java.lang.Object
  extended by rc.yoda.utils.Gun
      extended by rc.yoda.plugin.guns.Random

public class Random
extends Gun

Random a gun that fires at a random angle between -46.6 and 46.6

Version:
v1.0
Author:
Robert Codd

Constructor Summary
Random(robocode.AdvancedRobot robot)
          Class Constructor specifying the robot this gun is virtually mounted on
 
Method Summary
 double getBulletPower()
          Generates a random bullet power in keeping with the name of this gun
 double getFireAngle()
          Generates a random number from -46.6 to 46.6
 
Methods inherited from class rc.yoda.utils.Gun
onBulletHit, onBulletHitBullet, onBulletMissed, onDeath, onPaint, onScannedRobot, onWin
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Random

public Random(robocode.AdvancedRobot robot)
Class Constructor specifying the robot this gun is virtually mounted on

Method Detail

getBulletPower

public double getBulletPower()
Generates a random bullet power in keeping with the name of this gun

Overrides:
getBulletPower in class Gun
Returns:
double number from 0.1 to 3

getFireAngle

public double getFireAngle()
Generates a random number from -46.6 to 46.6

Overrides:
getFireAngle in class Gun
Returns:
double number from -46.6 to 46.6 for the GunArray