au.edu.mq.itec802.cardGame.blackjack
Class BlackjackAbstractPlayer

java.lang.Object
  extended by au.edu.mq.itec802.cardGame.blackjack.BlackjackAbstractPlayer
All Implemented Interfaces:
Player
Direct Known Subclasses:
BlackjackHouse, BlackjackPlayer

public abstract class BlackjackAbstractPlayer
extends java.lang.Object
implements Player

The Class BlackjackAbstractPlayer.

Version:
$Id: BlackjackAbstractPlayer.java 20/03/2011 jumbo$
Author:
Tomas Krajca

Constructor Summary
BlackjackAbstractPlayer()
           
 
Method Summary
 void emptyHand()
          Empty hand -- empties player's hand.
abstract  int getAmount()
          Gets the amount.
 int getBet()
          Gets the bet.
abstract  int getInitAmount()
          Gets the init amount.
abstract  int getNumber()
          Gets the player's number.
 int getScore()
          Gets the score.
 boolean isHouse()
          Checks if is house.
 void loses()
          Player loses.
abstract  void play(BlackjackPack pack)
          Simulates a playing player.
 void setBet(int bet)
          Sets the bet.
 void wins(int bet)
          Player wins -- his amount is raised.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface au.edu.mq.itec802.cardGame.Player
play
 

Constructor Detail

BlackjackAbstractPlayer

public BlackjackAbstractPlayer()
Method Detail

play

public abstract void play(BlackjackPack pack)
Simulates a playing player.

Parameters:
pack - of cards to play with

getScore

public final int getScore()
Gets the score.

Returns:
player's score

isHouse

public boolean isHouse()
Checks if is house.

Returns:
true, if is house

wins

public void wins(int bet)
Player wins -- his amount is raised.

Parameters:
bet - the bet this player has won on another player

loses

public void loses()
Player loses. His bet is subtracted from his amount.


getAmount

public abstract int getAmount()
Gets the amount.

Returns:
the current player's amount

getInitAmount

public abstract int getInitAmount()
Gets the init amount.

Returns:
the player's initial amount

getBet

public final int getBet()
Gets the bet.

Returns:
the bet

setBet

public final void setBet(int bet)
Sets the bet.

Parameters:
bet - the new bet

getNumber

public abstract int getNumber()
Gets the player's number.

Returns:
the player's number

emptyHand

public final void emptyHand()
Empty hand -- empties player's hand.