note: you have to pass it the event unlike the normall e.getBearing()
sooo, what's the difference between getBearingToGun? and getBearingToRadar?? they kinda look the same to me :-p --Dummy
Yes I did mess up a bit there, I was a bit hasty. But I made it a bit shorter, the old version is now at the bottom.
public double getBearingTo(String part , ScannedRobotEvent e) { if (part.equals("Gun")) return(e.getBearing() - (getGunHeading() - getHeading())); else return(e.getBearing() - (getRadarHeading() - getHeading())); } public double getBearingTo(String part , HitRobotEvent e) { if (part.equals("Gun")) return(e.getBearing() - (getGunHeading() - getHeading())); else return(e.getBearing() - (getRadarHeading() - getHeading())); } public double getBearingTo(String part , HitByBulletEvent e) { if (part.equals("Gun")) return(e.getBearing() - (getGunHeading() - getHeading())); else return(e.getBearing() - (getRadarHeading() - getHeading())); } public double getRadiansBearingTo(String part , ScannedRobotEvent e) { if (part.equals("Gun")) return(e.getBearingRadians() - (getGunHeadingRadians() - getHeadingRadians())); else return(e.getBearingRadians() - (getRadarHeadingRadians() - getHeadingRadians())); } public double getRadiansBearingTo(String part , HitRobotEvent e) { if (part.equals("Gun")) return(e.getBearingRadians() - (getGunHeadingRadians() - getHeadingRadians())); else return(e.getBearingRadians() - (getRadarHeadingRadians() - getHeadingRadians())); } public double getRadiansBearingTo(String part , HitByBulletEvent e) { if (part.equals("Gun")) return(e.getBearingRadians() - (getGunHeadingRadians() - getHeadingRadians())); else return(e.getBearingRadians() - (getRadarHeadingRadians() - getHeadingRadians())); }
public double getBearingToGun(HitByBulletEvent e) { return(e.getBearing() - (getGunHeading() - getHeading())); } public double getBearingToRadar(HitByBulletEvent e) { return(e.getBearing() - (getGunHeading() - getHeading())); } public double getBearingToGunRadians(HitByBulletEvent e) { return(e.getBearingRadians() - (getGunHeadingRadians() - getHeadingRadians())); } public double getBearingToRadarRadians(HitByBulletEvent e) { return(e.getBearingRadians() - (getGunHeadingRadians() - getHeadingRadians())); } public double getBearingToGun(HitRobotEvent e) { return(e.getBearing() - (getGunHeading() - getHeading())); } public double getBearingToRadar(HitRobotEvent e) { return(e.getBearing() - (getGunHeading() - getHeading())); } public double getBearingToGunRadians(HitRobotEvent e) { return(e.getBearingRadians() - (getGunHeadingRadians() - getHeadingRadians())); } public double getBearingToRadarRadians(HitRobotEvent e) { return(e.getBearingRadians() - (getGunHeadingRadians() - getHeadingRadians())); } public double getBearingToGun(ScannedRobotEvent e) { return(e.getBearing() - (getGunHeading() - getHeading())); } public double getBearingToRadar(ScannedRobotEvent e) { return(e.getBearing() - (getGunHeading() - getHeading())); } public double getBearingToGunRadians(ScannedRobotEvent e) { return(e.getBearingRadians() - (getGunHeadingRadians() - getHeadingRadians())); } public double getBearingToRadarRadians(ScannedRobotEvent e) { return(e.getBearingRadians() - (getGunHeadingRadians() - getHeadingRadians())); }