com.compomics.angrypeptide.fun
Class Shot

java.lang.Object
  extended by com.compomics.angrypeptide.fun.Shot

public class Shot
extends Object

This class represents a shot

Author:
Marc

Constructor Summary
Shot(double energy, double angle)
          Constructor
 
Method Summary
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Shot

public Shot(double energy,
            double angle)
Constructor

Parameters:
energy - the energy of the shoot
angle - the angle of the shoot
Method Detail

getEnergy

public double getEnergy()

getAngle

public double getAngle()

getDistance

public double getDistance()
Returns the distance of the shoot

Returns:

getEnergyForDistance

public static double getEnergyForDistance(double distance,
                                          double angle)
returns the energy necessary to shoot at a given distance with the given angle

Parameters:
distance -
angle - the angle in degree (must be between 0 and 90)
Returns:

getMinEnergyForDistance

public static double getMinEnergyForDistance(double distance)
Returns the minimal energy to reach the distance

Parameters:
distance -
Returns:

getRandomAngle

public static double getRandomAngle()
Returns a random angle

Returns:

getRandomAngleForDistance

public static double getRandomAngleForDistance(double distance,
                                               double maxEnergy)
Returns a random angle allowing shooting at a given distance given the max energy available.

Parameters:
distance -
maxEnergy -
Returns:

getScore

public double getScore()

setScore

public void setScore(double score)


Copyright © 2013. All Rights Reserved.