public class Shot extends Object
Constructor and Description |
---|
Shot(double energy,
double angle)
Constructor
|
Modifier and Type | Method and Description |
---|---|
double |
getAngle() |
double |
getDistance()
Returns the distance of the shoot
|
double |
getEnergy() |
static double |
getEnergyForDistance(double distance,
double angle)
returns the energy necessary to shoot at a given distance with the given angle
|
static double |
getMinEnergyForDistance(double distance)
Returns the minimal energy to reach the distance
|
static double |
getRandomAngle()
Returns a random angle
|
static double |
getRandomAngleForDistance(double distance,
double maxEnergy)
Returns a random angle allowing shooting at a given distance given the max energy available.
|
double |
getScore() |
void |
setScore(double score) |
public Shot(double energy, double angle)
energy
- the energy of the shootangle
- the angle of the shootpublic double getEnergy()
public double getAngle()
public double getDistance()
public static double getEnergyForDistance(double distance, double angle)
distance
- angle
- the angle in degree (must be between 0 and 90)public static double getMinEnergyForDistance(double distance)
distance
- public static double getRandomAngle()
public static double getRandomAngleForDistance(double distance, double maxEnergy)
distance
- maxEnergy
- public double getScore()
public void setScore(double score)
Copyright © 2013. All Rights Reserved.