First layout of the game
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
package com.bernard.nodecames.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
public class Grid {
|
||||
|
||||
String id;
|
||||
|
||||
Card[] cards;
|
||||
|
||||
List<GameEvent> gameEvents;
|
||||
Hint currentHint = null;
|
||||
int currentGuessCount;
|
||||
|
||||
int usedHints;
|
||||
int usedWhites;
|
||||
|
||||
Phase phase;
|
||||
|
||||
public Grid(String name, Card[] cards) {
|
||||
this(name, cards, new ArrayList<>(), null, 0, 0, 0, Phase.HINTING_ANY);
|
||||
}
|
||||
|
||||
public void incrementHintCount() {
|
||||
this.setUsedHints(this.getUsedHints()+1);
|
||||
}
|
||||
public void incrementWhiteCount() {
|
||||
this.setUsedWhites(this.getUsedWhites()+1);
|
||||
}
|
||||
public void incrementCurrentGuessCount() {
|
||||
this.setCurrentGuessCount(this.getCurrentGuessCount()+1);
|
||||
}
|
||||
public void newGameEvent(GameEvent event) {
|
||||
this.gameEvents.add(event);
|
||||
}
|
||||
public int getCardCount() {
|
||||
return this.getCards().length;
|
||||
}
|
||||
|
||||
public enum Phase {
|
||||
HINTING_ANY,
|
||||
HINTING_A,
|
||||
HINTING_B,
|
||||
GUESSING_A,
|
||||
GUESSING_B;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user