/** * Assignment 2, COMP268 Class: Point.java * * @description A class used to represent a point for a single round. * @author: mo khan Student ID: 3431709 * @date August 3, 2019 * @version 1.0 */ package Q8; public class Point { public static final int PLAYER1 = 0; public static final int PLAYER2 = 1; private int player; private int score; private String stroke; /** * Creates an instance of a Point. * * @param player the numeric identifer to identify the player that received the point. * @param stroke the name of the stroke that was used to score the point. * @param score the current score for the player who earned the point. */ public Point(int player, String stroke, int score) { this.player = player; this.stroke = stroke; this.score = score; } /** * @return the player that scored the point. */ public int getPlayer() { return this.player; } /** * @return the score for the player at the time the point was scored. */ public int getScore() { return this.score; } /** * @return the stroke used to score the point. */ public String getStroke() { switch (this.stroke) { case "a": return "slice"; case "b": return "drive"; case "c": return "smash"; case "d": return "drop"; case "e": return "net-shot"; default: return "unknown"; } } }