From 7ae9e656770dcae4d45f60a2af5b5cc5752532d3 Mon Sep 17 00:00:00 2001 From: edencse Date: Thu, 25 Jul 2024 19:30:14 -0500 Subject: [PATCH] Update Round.java --- src/main/java/uta/cse3310/Round.java | 56 ++++------------------------ 1 file changed, 7 insertions(+), 49 deletions(-) diff --git a/src/main/java/uta/cse3310/Round.java b/src/main/java/uta/cse3310/Round.java index f5dec19..e815c8c 100644 --- a/src/main/java/uta/cse3310/Round.java +++ b/src/main/java/uta/cse3310/Round.java @@ -3,17 +3,14 @@ import java.time.LocalDateTime; public class Round { - + private int roundNumber; private LocalDateTime startTime; private LocalDateTime endTime; private int score; private String status; -<<<<<<< HEAD - // Constructor -======= ->>>>>>> new-branch + public Round(int roundNumber) { this.roundNumber = roundNumber; this.startTime = null; @@ -22,56 +19,32 @@ public Round(int roundNumber) { this.status = "not started"; } -<<<<<<< HEAD - // Start the round -======= - ->>>>>>> new-branch + public void startRound() { this.startTime = LocalDateTime.now(); this.status = "in progress"; } - // End the round + public void endRound() { this.endTime = LocalDateTime.now(); -<<<<<<< HEAD this.status = "finished"; this.score = calculateScore(); -======= - this.status = "completed"; - this.score = calculateScore(); // Assuming score is calculated at the end of the round ->>>>>>> new-branch } - // Calculate the score for the round (dummy implementation, adjust as needed) + public int calculateScore() { -<<<<<<< HEAD - // Example score calculation based on duration (seconds) - replace with actual logic + if (startTime != null && endTime != null) { return (int) java.time.Duration.between(startTime, endTime).getSeconds(); -======= - - if (this.startTime != null && this.endTime != null) { - return (int) java.time.Duration.between(this.startTime, this.endTime).getSeconds(); ->>>>>>> new-branch } else { return 0; } } -<<<<<<< HEAD - // Getters and setters + public int getRoundNumber() { return roundNumber; -======= - public String getStatus() { - return this.status; - } - - public int getRoundNumber() { - return this.roundNumber; ->>>>>>> new-branch } public void setRoundNumber(int roundNumber) { @@ -79,11 +52,7 @@ public void setRoundNumber(int roundNumber) { } public LocalDateTime getStartTime() { -<<<<<<< HEAD return startTime; -======= - return this.startTime; ->>>>>>> new-branch } public void setStartTime(LocalDateTime startTime) { @@ -91,11 +60,7 @@ public void setStartTime(LocalDateTime startTime) { } public LocalDateTime getEndTime() { -<<<<<<< HEAD return endTime; -======= - return this.endTime; ->>>>>>> new-branch } public void setEndTime(LocalDateTime endTime) { @@ -103,22 +68,15 @@ public void setEndTime(LocalDateTime endTime) { } public int getScore() { -<<<<<<< HEAD return score; -======= - return this.score; ->>>>>>> new-branch } public void setScore(int score) { this.score = score; -<<<<<<< HEAD } public String getStatus() { return status; -======= ->>>>>>> new-branch } public void setStatus(String status) {