KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > poker > data > game > PokerGameDO


1 package poker.data.game;
2
3
4 import java.util.Vector JavaDoc;
5
6 /**
7  *
8  * EnhyDraw!, beta 4, 5/21/99
9  *
10  * Copyright 1999, Larry Wolcot & Daryl Tempesta
11  * ALL rights reserved. Not for commercial use
12  * without written permission from both authors.
13  *
14  * Forgive the lack of docs and CR's in the Data Objects.
15  * I don't have a lot of time for this project, and this
16  * should be easy enough to figure out
17  */

18 public class PokerGameDO implements java.io.Serializable JavaDoc {
19     private int cash = 0;
20     private int playRound = 0;
21     private String JavaDoc id = "";
22     private int bet = 0;
23     private int largestBet = 0;
24     private int smallestBet = 0;
25     private int totalPlayed = 0;
26     private int totalWon = 0;
27     private int defaultBet = 100;
28     private String JavaDoc deck = "deck1";
29     private Vector JavaDoc cardsInHand = new Vector JavaDoc(5);
30     private Vector JavaDoc cardsUsed = new Vector JavaDoc(0);
31     private Vector JavaDoc dropCards = new Vector JavaDoc(0);
32     private String JavaDoc lastError = "";
33     private int version = 0;
34
35    /**
36     * Basic Constructor
37     */

38     public PokerGameDO(String JavaDoc id, int cash){
39     this.id = id;
40     this.cash = cash;
41     String JavaDoc drop = "DROP";
42     for (int i=0; i < 5; i++){
43         dropCards.addElement(drop);
44     }
45     }
46
47     //basic "SET" encapsulation methods for this object.
48
public void setCash(int cash){ this.cash = cash; }
49     public void setVersion(int version){ this.version = version; }
50     public void setPlayRound(int playRound){ this.playRound = playRound; }
51     public void setID(String JavaDoc id){ this.id = id; }
52     public void setBet(int bet){ this.bet = bet; }
53     public void setLargestBet(int large){ this.largestBet = large;}
54     public void setSmallestBet(int small){ this.smallestBet = small;}
55     public void setTotalPlayed(int total){ this.totalPlayed = total;}
56     public void setTotalWon(int total){ this.totalWon = total; }
57     public void setCardsInHand(Vector JavaDoc cih){ this.cardsInHand = cih; }
58     public void setCardsUsed(Vector JavaDoc cu){ this.cardsUsed = cu; }
59     public void setDropCards(Vector JavaDoc dc){ this.dropCards = dc; }
60     public void setDeck(String JavaDoc deck){ this.deck = deck; }
61     public void setDefaultBet(int db){ this.defaultBet = db;}
62     public void setLastError(String JavaDoc le){ this.lastError = le; }
63
64     //basic "GET" encapsulation methods for this object.
65
public int getCash(){ return cash; }
66     public int getVersion(){ return version; }
67     public int getPlayRound(){ return playRound; }
68     public String JavaDoc getLastError(){ return lastError; }
69     public String JavaDoc getID(){ return id; }
70     public int getBet(){ return bet; }
71     public int getLargestBet(){ return largestBet; }
72     public int getSmallestBet(){ return smallestBet; }
73     public int getTotalPlayed(){ return totalPlayed; }
74     public int getTotalWon(){ return totalWon; }
75     public Vector JavaDoc getCardsInHand(){ return cardsInHand; }
76     public Vector JavaDoc getCardsUsed(){ return cardsUsed; }
77     public Vector JavaDoc getDropCards(){ return dropCards; }
78     public int getDefaultBet(){ return defaultBet; }
79     public String JavaDoc getDeck(){ return deck; }
80 }
81
Popular Tags