From f95103221af7cd10cf30c857173e518b4f0b5dfe Mon Sep 17 00:00:00 2001 From: sgoudham Date: Fri, 16 Oct 2020 23:28:01 +0100 Subject: [PATCH] Enums for Suits/Faces --- Personal/Cards/src/Faces.java | 15 +++++++++++++++ Personal/Cards/src/Suits.java | 13 +++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 Personal/Cards/src/Faces.java create mode 100644 Personal/Cards/src/Suits.java diff --git a/Personal/Cards/src/Faces.java b/Personal/Cards/src/Faces.java new file mode 100644 index 0000000..a9787ef --- /dev/null +++ b/Personal/Cards/src/Faces.java @@ -0,0 +1,15 @@ +public enum Faces { + ACE(1), TWO(2), THREE(3), FOUR(4), FIVE(5), SIX(6), SEVEN(7), EIGHT(8), NINE(9), TEN(10), JACK(11), QUEEN(12), + KING(13); + + private int face; + + Faces(int face) { + this.face = face; + } + + public int getFace() { + return face; + } + +} diff --git a/Personal/Cards/src/Suits.java b/Personal/Cards/src/Suits.java new file mode 100644 index 0000000..0b14d8d --- /dev/null +++ b/Personal/Cards/src/Suits.java @@ -0,0 +1,13 @@ +public enum Suits { + SPADES("Spades"), HEARTS("Hearts"), DIAMONDS("Diamonds"), CLUBS("Clubs"); + + private String suit; + + Suits(String suit) { + this.suit = suit; + } + + public String getSuit() { + return suit; + } +}