// Deck.java // This file implements a Deck of Set cards // Written by: Stuart Hansen // Date: January 10, 2002 import java.awt.*; import java.util.*; // The Deck class contains each of the 81 unique Set cards public class Deck { private static final int NUMCARDS = 81; // There are 81 cards in the Set deck private Card deck []; // The array of cards private int top; // the top card in the remaining deck // the constructor initalizes the array and then each // card in the array public Deck () { deck = new Card[NUMCARDS]; top = 0; // We maintain arrays of the properties of each card // By reusing the same properties, we allow == and != to work Color colors[] = {Color.red, new Color(0, 150, 0), new Color(150, 0, 255)}; Shading shadings[] = {Filled.getInstance(), Outlined.getInstance(), Striped.getInstance()}; Symbol symbols[] = {Oval.getInstance(), Diamond.getInstance(), Squiggle.getInstance()}; Location locations[] = {OneLoc.getInstance(), TwoLoc.getInstance(), ThreeLoc.getInstance()}; for (int i=0; i