From 37570a200cb69ddd638a157539efe37758ec8a69 Mon Sep 17 00:00:00 2001 From: Friederike von Gruben Date: Mon, 6 Feb 2023 14:04:35 +0100 Subject: [PATCH] Created enum in BlackJack This is for the PLAYER and BOT --- .../java/org/bitbiome/classes/BlackJack.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/main/java/org/bitbiome/classes/BlackJack.java b/src/main/java/org/bitbiome/classes/BlackJack.java index 3af2dc4..dbc3386 100644 --- a/src/main/java/org/bitbiome/classes/BlackJack.java +++ b/src/main/java/org/bitbiome/classes/BlackJack.java @@ -1,4 +1,35 @@ package org.bitbiome.classes; 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; + } + } + }