From e64b4516e13adb9ec69c704eaf5286f27280aa38 Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Tue, 3 Mar 2020 10:20:52 +0100 Subject: [PATCH] Legger til en IDeck interface. Closes #22 --- .../fiasko/roborally/objects/IDeck.java | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/main/java/inf112/fiasko/roborally/objects/IDeck.java diff --git a/src/main/java/inf112/fiasko/roborally/objects/IDeck.java b/src/main/java/inf112/fiasko/roborally/objects/IDeck.java new file mode 100644 index 0000000..2b42f0d --- /dev/null +++ b/src/main/java/inf112/fiasko/roborally/objects/IDeck.java @@ -0,0 +1,55 @@ +package inf112.fiasko.roborally.objects; + +import java.util.List; + +/** + * Describes a deck + */ +public interface IDeck { + + /** + * Shuffles the order of the cards in the deck + */ + void shuffle(); + + /** + * Draws one card from the top of another deck + * @param other The deck to draw the card from + */ + void draw(IDeck other); + + /** + * Draws n cards from the top of another deck + * @param other The other deck to draw from + * @param n The number of cards to draw + */ + void draw(IDeck other, int n); + + /** + * Moves all cards in this deck into another deck + * @param other The deck to move this deck's cards into + */ + void emptyInto(IDeck other); + + /** + * Whether this deck is empty + * @return True if this deck is currently empty + */ + boolean isEmpty(); + + /** + * Gets the number of cards currently in this deck + * @return The number of cards in this deck + */ + int size(); + + /** + * Gets a list of all cards in this deck + * + * The list should have the correct order according to the actual order within the deck. As an ICardWithoutSuit is + * immutable, the object reference can be returned directly. + * + * @return A list of all cards in this deck + */ + List, Class>> getCards(); +}