|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.ninm.games.cardgames.common.AbstractEngine | +--org.ninm.games.cardgames.belot.BelotEngine
This class holds the logic of the belot game
Field Summary | |
private int |
m_activePlayer
|
private Belot |
m_belot
|
private BelotBid |
m_belotBid
|
private Team |
m_biddingTeam
|
private int |
m_dealer
|
private DefaultPlayer[] |
m_players
|
private State |
m_state
|
Fields inherited from class org.ninm.games.cardgames.common.AbstractEngine |
|
Constructor Summary | |
BelotEngine(Belot belot)
|
Method Summary | |
boolean |
announceTrick(Player player,
Trick trick)
this implementation just checks weather the player making the anouncement is the currant player and weather the trick is one of the allowed tricks. |
boolean |
bidMade(Player player,
Bid bid)
this implementation just checks weather the player making the anouncement is the currant player and weather the trick is one of the allowed tricks. |
private void |
dealCard(DefaultPlayer player,
Card card)
|
(package private) void |
dealCards(int numberOfCards)
|
Player |
getActivePlayer()
returns the player whos turn it is |
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 |
(package private) BelotBid |
getBelotBid()
Returns the belotBid. |
Team |
getBiddingTeam()
Returns the biddingTeam. |
(package private) DefaultTeam |
getOposition(Team team)
|
(package private) java.util.List |
getPlayers()
|
(package private) DefaultScore |
getScore()
|
(package private) State |
getState()
|
private int |
next(int player)
|
(package private) void |
nextDealer()
sets the active dealer to be the next player in an anti-clockwise fashion |
(package private) void |
nextPlayer()
sets the active player to be the next player in an anti-clockwise fashion |
boolean |
playCard(Player player,
Card card)
This implementation just checks weather the player is the currante player and weather the card is one of the allowed cards. |
(package private) void |
returnCardsToDeck()
returns all the cards to the deck |
(package private) void |
setActivePlayer(Player player)
|
(package private) void |
setBelotBid(BelotBid belotBid)
Sets the belotBid. |
void |
setBiddingTeam(Team biddingTeam)
Sets the biddingTeam. |
(package private) void |
setDealerToActivePlayer()
|
(package private) void |
setState(State state)
|
void |
start()
|
Methods inherited from class org.ninm.games.cardgames.common.AbstractEngine |
addBonusListener, addDealerListener, fireBonusReceived, fireCardDelt, isAllowedBid, isAllowedCard, isAllowedTrick, isCurrantPlayer |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private final Belot m_belot
private final DefaultPlayer[] m_players
private BelotBid m_belotBid
private State m_state
private Team m_biddingTeam
private int m_activePlayer
private int m_dealer
Constructor Detail |
public BelotEngine(Belot belot)
Method Detail |
public Player getActivePlayer()
Engine
public java.util.Set getAllowedCards()
Engine
public java.util.Set getAllowedTricks()
Engine
public java.util.Set getAllowedBids()
Engine
public boolean playCard(Player player, Card card)
AbstractEngine
playCard
in interface Engine
playCard
in class AbstractEngine
player
- the player playing the cardcard
- the card being player
public boolean announceTrick(Player player, Trick trick)
AbstractEngine
announceTrick
in interface Engine
announceTrick
in class AbstractEngine
player
- the player announcing the tricktrick
- the trick being announced
public boolean bidMade(Player player, Bid bid)
AbstractEngine
bidMade
in interface Engine
bidMade
in class AbstractEngine
player
- the player making the bidbid
- the bid being made
java.util.List getPlayers()
private void dealCard(DefaultPlayer player, Card card)
void dealCards(int numberOfCards)
void returnCardsToDeck()
void setState(State state)
State getState()
void nextPlayer()
private int next(int player)
void setDealerToActivePlayer()
void nextDealer()
public void start()
public Team getBiddingTeam()
public void setBiddingTeam(Team biddingTeam)
biddingTeam
- The biddingTeam to setBelotBid getBelotBid()
void setBelotBid(BelotBid belotBid)
belotBid
- The belotBid to setDefaultScore getScore()
void setActivePlayer(Player player)
DefaultTeam getOposition(Team team)
|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |