/** * GoalGraphics. Object used to store the information of a Goal. * Stores starting x, y pos and ending x,y post. Stores the * player number who scored the goal and the distance. * * @author Adrien Martel * */ public class GoalGraphics{ private double player_num; private double xS; private double yS; private double xE; private double yE; private int dist; /** * Constructor GoalGraphics. Creates an object with all the following * information. * * @param player_num - the player who scored that goal * @param d - starting x pos * @param e - starting y pos * @param f - ending x pos * @param g - ending y pos * @param distance - distance between shot and goal in yards */ public GoalGraphics(int player_num, double d, double e, double f, double g, int distance){ this.player_num = player_num; //remove the floating point this.xS = Math.abs(d); this.yS = Math.abs(e); this.xE = Math.abs(f); this.yE = Math.abs(g); dist = distance; } /** * Method getPlayerNum(). Returns the number of the player * that scored this goal. * * @return Player number */ public int getPlayerNum(){ return (int) player_num; } /** * Method getXS returns the starting X position of the * shot that lead to the goal. * * @return the x cooridinate of the starting shot position. */ public int getXS(){ return (int) xS; } /** * Method getYS returns the starting Y position of the * shot that lead to the goal. * * @return the y cooridinate of the starting shot position. */ public int getYS(){ return (int) yS; } /** * Method getXE returns the ending X position of the goal * * @return the x coordinate of the goal */ public int getXE(){ return (int) xE; } /** * Method getYE returns the ending Y position of the goal * * @return the y coordinate of the goal */ public int getYE(){ return (int) yE; } /** * Method getDistance returns the distance in yards between the scorer * and the goal. * * @return the distance of the goal scored in yards */ public int getDistance(){ return dist; } }