diff options
| author | mo khan <mo@mokhan.ca> | 2019-08-11 17:36:23 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2019-08-11 17:36:23 -0600 |
| commit | a04f5ec262de028c843e38bf5864cd84953258b1 (patch) | |
| tree | 7bf48bdc89f0b94e783a0bfeef06b284466832da /src/Q8/BadmintonScoring.java | |
| parent | cebbb584d3ec256dea468e73cec5d8a30d3151d9 (diff) | |
add documentation
Diffstat (limited to 'src/Q8/BadmintonScoring.java')
| -rw-r--r-- | src/Q8/BadmintonScoring.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/Q8/BadmintonScoring.java b/src/Q8/BadmintonScoring.java index 56c8e40..d3c8b29 100644 --- a/src/Q8/BadmintonScoring.java +++ b/src/Q8/BadmintonScoring.java @@ -1,3 +1,11 @@ +/** + * Assignment 2, COMP268 Class: BadmintonScoring.java + * + * @description A class used to keep track of a Badminton game between two opponents. + * @author: mo khan Student ID: 3431709 + * @date August 3, 2019 + * @version 1.0 + */ package Q8; import java.util.*; @@ -7,22 +15,40 @@ public class BadmintonScoring { private static final int PLAYER1 = 0; private static final int PLAYER2 = 1; + /** + * Creates an instance of the BadmintonScoring object with a 2D array of + * scores. + * + * @param scores a 2D array of scores for each player. + */ public BadmintonScoring(int[][] scores) { this.scores = scores; } + /** + * @return the longest point streak for player 1. + */ public int getContinuousPointsPlayer1() { return this.longestStreakFor(PLAYER1); } + /** + * @return the longest point streak for player 2. + */ public int getContinuousPointsPlayer2() { return this.longestStreakFor(PLAYER2); } + /** + * @return the final score for player 1. + */ public int getPlayer1Points() { return this.finalScoreFor(PLAYER1); } + /** + * @return the final score for player 2. + */ public int getPlayer2Points() { return this.finalScoreFor(PLAYER2); } |
