Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.tutework.weekFour;
- /**
- * Created by BenElliott on 28/03/15.
- */
- public class Card {
- private int suit;
- private int value;
- private String suits[];
- private String values[];
- // constructor
- public Card(){
- suit=0;
- value=0;
- suits = new String[] {"Clubs","Diamonds","Hearts","Spades"};
- values = new String[] {"Ace","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Jack","Queen","King"};
- }
- // accessor
- public String[] getValues(){
- return values;
- }
- public String[] getSuits(){
- return suits;
- }
- // public int getValue(){
- // return value;
- // }
- // public int getSuit(){
- // return suit;
- // }
- //MUTATOR
- // public boolean setValue(int newValue) {
- // boolean success;
- //
- // if (newValue >= 0 && newValue <= 13 ) {
- // suit = newValue;
- // success = true;
- // } else
- // success = false;
- // return success;
- // }
- //
- // public boolean setSuit(int newSuit) {
- // boolean success;
- //
- // if (newSuit >= 0 && newSuit<= 3) {
- // suit = newSuit;
- // success = true;
- // } else
- // success = false;
- // return success;
- // }
- // public String toString(){
- // String state;
- // state = suit + " of " + value;
- // return state; }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement