001: package poker.business;
002:
003: import poker.data.user.*;
004: import poker.data.game.*;
005: import java.util.Vector;
006: import poker.spec.user.PlayerDO;
007: import poker.spec.*;
008:
009: /**
010: *
011: * EnhyDraw!, beta 4, 5/21/99
012: *
013: * Copyright 1999, Larry Wolcot & Daryl Tempesta
014: * ALL rights reserved. Not for commercial use
015: * without written permission from both authors.
016: *
017: * This is the business object that encapsulates the
018: * PlayerDO and PokerGameDO objects.
019: * It really doesn't do much other than that!
020: */
021: public class PokerGameImpl implements PokerGame, java.io.Serializable {
022:
023: private boolean isDirty = false;
024: private PokerGameDO pokerGameDO;
025: private PlayerDO playerDO;
026:
027: /*
028: * Constructor that inits the DO's
029: */
030: public PokerGameImpl() {
031: };
032:
033: public PokerGameImpl(String name, String pw, String id, int cash) {
034: playerDO = new PlayerDOImpl(name, pw);
035: pokerGameDO = new PokerGameDO(id, cash);
036: }
037:
038: /*
039: * Return the PokerGameDO for this object
040: */
041: public PokerGameDO getPokerGameDO() {
042: return pokerGameDO;
043: }
044:
045: /*
046: * return the name from the PlayerDO
047: */
048: public String getName() {
049: return playerDO.getName();
050: }
051:
052: /*
053: * Check to see if this DO has been changed
054: */
055: public boolean getIsDirty() {
056: return this .isDirty;
057: }
058:
059: /*
060: * return the email from the PlayerDO
061: */
062: public String getEmail() {
063: return playerDO.getEmail();
064: }
065:
066: /*
067: * return the password from the PlayerDO
068: */
069: public String getPassword() {
070: return playerDO.getPassword();
071: }
072:
073: /*
074: * return the cash from the pokerGameDO
075: */
076: public int getCash() {
077: return pokerGameDO.getCash();
078: }
079:
080: /*
081: * return the getPlayRound from the pokerGameDO
082: */
083: public int getPlayRound() {
084: return pokerGameDO.getPlayRound();
085: }
086:
087: /*
088: * return the getID from the pokerGameDO
089: */
090: public String getID() {
091: return pokerGameDO.getID();
092: }
093:
094: /*
095: * return the current Bet from the pokerGameDO
096: */
097: public int getBet() {
098: return pokerGameDO.getBet();
099: }
100:
101: /*
102: * return the current version from the pokerGameDO
103: */
104: public int getVersion() {
105: return pokerGameDO.getVersion();
106: }
107:
108: /*
109: * return the largest bet from the pokerGameDO
110: */
111: public int getLargestBet() {
112: return pokerGameDO.getLargestBet();
113: }
114:
115: /*
116: * return the smallest bet from the pokerGameDO
117: */
118: public int getSmallestBet() {
119: return pokerGameDO.getSmallestBet();
120: }
121:
122: /*
123: * return the total games played from the pokerGameDO
124: */
125: public int getTotalPlayed() {
126: return pokerGameDO.getTotalPlayed();
127: }
128:
129: /*
130: * return the total games won from the pokerGameDO
131: */
132: public int getTotalWon() {
133: return pokerGameDO.getTotalWon();
134: }
135:
136: /*
137: * return the Vector of cards in hand from the pokerGameDO
138: */
139: public Vector getCardsInHand() {
140: return pokerGameDO.getCardsInHand();
141: }
142:
143: /*
144: * return the Vector of cards already dealt from the pokerGameDO
145: */
146: public Vector getCardsUsed() {
147: return pokerGameDO.getCardsUsed();
148: }
149:
150: /*
151: * return the default bet from the pokerGameDO
152: */
153: public int getDefaultBet() {
154: return pokerGameDO.getDefaultBet();
155: }
156:
157: /*
158: * return the Vector of cards to drop from the pokerGameDO
159: */
160: public Vector getDropCards() {
161: return pokerGameDO.getDropCards();
162: }
163:
164: /*
165: * return the default deck image name from the pokerGameDO
166: */
167: public String getDeck() {
168: return pokerGameDO.getDeck();
169: }
170:
171: /*
172: * return the last error from the pokerGameDO
173: * not in use, but too paranoid to remove
174: */
175: public String getLastError() {
176: return pokerGameDO.getLastError();
177: }
178:
179: /*
180: * return the PlayerDO from the pokerGameDO
181: * Yeah, I know this ills the encapsulation rules, but hey!
182: * it's only game!
183: */
184: public PlayerDO getPlayer() {
185: return playerDO;
186: }
187:
188: /*
189: * Set the cash in the pokerGameDO
190: */
191: public void setCash(int cash) {
192: this .isDirty = true;
193: pokerGameDO.setCash(cash);
194: }
195:
196: /*
197: * Set the playround in the pokerGameDO
198: */
199: public void setPlayRound(int playRound) {
200: this .isDirty = true;
201: pokerGameDO.setPlayRound(playRound);
202: }
203:
204: /*
205: * Set the last error in the pokerGameDO
206: */
207: public void setLastError(String lastError) {
208: this .isDirty = true;
209: pokerGameDO.setLastError(lastError);
210: }
211:
212: /*
213: * Set the ID in the pokerGameDO
214: */
215: public void setID(String id) {
216: this .isDirty = true;
217: pokerGameDO.setID(id);
218: }
219:
220: /*
221: * Set the name in the playerDO
222: */
223: public void setName(String name) {
224: this .isDirty = true;
225: playerDO.setName(name);
226: }
227:
228: /*
229: * Set the password in the playerDO
230: */
231: public void setPassword(String pw) {
232: this .isDirty = true;
233: playerDO.setPassword(pw);
234: }
235:
236: /*
237: * Set the email in the playerDO
238: */
239: public void setEmail(String email) {
240: this .isDirty = true;
241: playerDO.setEmail(email);
242: }
243:
244: /*
245: * Set the current bet in the pokerGameDO
246: */
247: public void setBet(int bet) {
248: this .isDirty = true;
249: pokerGameDO.setBet(bet);
250: }
251:
252: /*
253: * Set the current version in the pokerGameDO
254: */
255: public void setVersion(int version) {
256: this .isDirty = true;
257: pokerGameDO.setVersion(version);
258: }
259:
260: /*
261: * Set the largest bet placed in the pokerGameDO
262: */
263: public void setLargestBet(int largestBet) {
264: this .isDirty = true;
265: pokerGameDO.setLargestBet(largestBet);
266: }
267:
268: /*
269: * Set the smallest bet in the pokerGameDO
270: */
271: public void setSmallestBet(int smallestBet) {
272: this .isDirty = true;
273: pokerGameDO.setSmallestBet(smallestBet);
274: }
275:
276: /*
277: * Set the total hands played in the pokerGameDO
278: */
279: public void setTotalPlayed(int totalPlayed) {
280: this .isDirty = true;
281: pokerGameDO.setTotalPlayed(totalPlayed);
282: }
283:
284: /*
285: * Set the total hands won in the pokerGameDO
286: */
287: public void setTotalWon(int totalWon) {
288: this .isDirty = true;
289: pokerGameDO.setTotalWon(totalWon);
290: }
291:
292: /*
293: * Set the current cards in hand in the pokerGameDO
294: */
295: public void setCardsInHand(Vector cardsInHand) {
296: pokerGameDO.setCardsInHand(cardsInHand);
297: }
298:
299: /*
300: * Set the cards used in the pokerGameDO
301: */
302: public void setCardsUsed(Vector cardsUsed) {
303: pokerGameDO.setCardsUsed(cardsUsed);
304: }
305:
306: /*
307: * Set the cards to be dropped in the pokerGameDO
308: */
309: public void setDropCards(Vector dropCards) {
310: pokerGameDO.setDropCards(dropCards);
311: }
312:
313: /*
314: * Set the default deck image name in the pokerGameDO
315: */
316: public void setDeck(String deck) {
317: this .isDirty = true;
318: pokerGameDO.setDeck(deck);
319: }
320:
321: /*
322: * Set the default bet in the pokerGameDO
323: */
324: public void setDefaultBet(int defaultBet) {
325: this .isDirty = true;
326: pokerGameDO.setDefaultBet(defaultBet);
327: }
328:
329: }
|