diff --git a/src/main/java/uta/cse3310/Player.java b/src/main/java/uta/cse3310/Player.java index 6e4d002..9b50838 100644 --- a/src/main/java/uta/cse3310/Player.java +++ b/src/main/java/uta/cse3310/Player.java @@ -1,5 +1,7 @@ package uta.cse3310; +import java.util.ArrayList; +import java.util.List; import java.util.UUID; public class Player { @@ -8,8 +10,18 @@ public class Player { private int score; private boolean iswinner; private GameTimer timer; // Updated reference + private List boughtVowels; + private List guessedConstants; + public Player(String name) { + this.id = UUID.randomUUID().toString(); + this.name = name; + this.score = 1000; + this.timer = new GameTimer(); // Updated reference + this.boughtVowels = new ArrayList<>(); + this.guessedConstants = new ArrayList<>(); + } public boolean isWinner() { return iswinner; @@ -19,13 +31,6 @@ public void setWinner(boolean iswinner) { this.iswinner = iswinner; } - public Player(String name) { - this.id = UUID.randomUUID().toString(); - this.name = name; - this.score = 0; - this.timer = new GameTimer(); // Updated reference - } - public String getId() { return id; } @@ -42,10 +47,40 @@ public void addScore(int points) { this.score += points; } + public void deductScore(int points) { + this.score -= points; + } + public void resetScore() { this.score = 0; } -} + public GameTimer getTimer() { + return timer; + } + + public boolean hasBoughtVowel(char vowel) { + return this.boughtVowels.contains(vowel); + } + + public void buyVowel(char vowel) { + this.boughtVowels.add(vowel); + } + + public List getBoughtVowels() { + return this.boughtVowels; + } + + public void guessConstant(char constant) { + this.guessedConstants.add(constant); + } + public List getGuessedConstants() { + return this.guessedConstants; + } + + public boolean hasGuessedConstant(char constant) { + return this.guessedConstants.contains(constant); + } +}