org.ninm.games.cardgames.belot
Class StateAdapter

java.lang.Object
  |
  +--org.ninm.games.cardgames.belot.StateAdapter
All Implemented Interfaces:
State
Direct Known Subclasses:
BiddingState, DealingState, PlayingState, StartState

public abstract class StateAdapter
extends java.lang.Object
implements State

A utility class which can be used to adapt the State interfaces

Version:
1.0
Author:
Nikolay

Field Summary
protected  BelotEngine m_belotEngine
           
 
Constructor Summary
StateAdapter(BelotEngine engine)
          Constructor for StateAdapter.
 
Method Summary
 boolean announceTrick(BelotTrick trick)
          tells the engine that a particular player wishes to anounce a trick
 boolean bidMade(BelotBid bid)
          indicates a bid has been made by a particluar player
 java.util.Set getAllowedBids()
          returs the allowed bids the current player can make
 java.util.Set getAllowedCards()
          returns the allowed cards that the current player can play
 java.util.Set getAllowedTricks()
          returns the allowed tricks that the current player can announce
 boolean playCard(Card card)
          indicates a card has been played by a particular player
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ninm.games.cardgames.belot.State
start
 

Field Detail

m_belotEngine

protected final BelotEngine m_belotEngine
Constructor Detail

StateAdapter

public StateAdapter(BelotEngine engine)
Constructor for StateAdapter.

Parameters:
engine - a reference to the belot engine
Method Detail

playCard

public boolean playCard(Card card)
Description copied from interface: State
indicates a card has been played by a particular player

Specified by:
playCard in interface State
Parameters:
card - the card being played
Returns:
true if the card was played succesfully

bidMade

public boolean bidMade(BelotBid bid)
Description copied from interface: State
indicates a bid has been made by a particluar player

Specified by:
bidMade in interface State
Parameters:
bid - the bid being made
Returns:
true if the bid was made successfully

announceTrick

public boolean announceTrick(BelotTrick trick)
Description copied from interface: State
tells the engine that a particular player wishes to anounce a trick

Specified by:
announceTrick in interface State
Parameters:
trick - the trick
Returns:
true if the trick was announced successfully

getAllowedBids

public java.util.Set getAllowedBids()
Description copied from interface: State
returs the allowed bids the current player can make

Specified by:
getAllowedBids in interface State
Returns:
List a list of bids

getAllowedCards

public java.util.Set getAllowedCards()
Description copied from interface: State
returns the allowed cards that the current player can play

Specified by:
getAllowedCards in interface State
Returns:
List the array of allowed cards for the player

getAllowedTricks

public java.util.Set getAllowedTricks()
Description copied from interface: State
returns the allowed tricks that the current player can announce

Specified by:
getAllowedTricks in interface State
Returns:
List the array of allowed tricks for the current player

SourceForge.net Logo