Browse Source

Created enum in BlackJack

This is for the PLAYER and BOT
remotes/origin/quiz
Friederike von Gruben 2 years ago
parent
commit
37570a200c
  1. 31
      src/main/java/org/bitbiome/classes/BlackJack.java

31
src/main/java/org/bitbiome/classes/BlackJack.java

@ -1,4 +1,35 @@
package org.bitbiome.classes; package org.bitbiome.classes;
public class BlackJack { public class BlackJack {
public enum Entity {
PLAYER(1), BOT(2);
private int value;
private Entity(int value) {
this.value = value;
}
public int getValue() {
return value;
}
//Just for testing from some SO answers, but no use
public void setValue(int value) {
this.value = value;
}
public static Entity getEventStatusById(int id) {
Entity entity = null;
switch (id) {
case 1 -> entity = PLAYER;
case 2 -> entity = BOT;
default -> {
}
}
return entity;
}
}
} }
Loading…
Cancel
Save