C# Class Belot.PlayingManager

A manager that observes playing rules.
显示文件 Open project: NikolayIT/BelotGameEngine Class Usage Examples

Private Properties

Property Type Description
Add void
CheckBelotForValidColor void
CheckForBelotCombination void
DetermineCurrentHandWinner Player
GetBiggestCard Card
GetBiggestCard Card
GetLastHand Hand
GetPlayingColor CardColor
GetTrumpColor CardColor
HasBigger bool
HasPlayingColor bool
IsBigger bool
PlayingManager System

Public Methods

Method Description
GetBiggestCard ( ) : Card

Gets the current biggest card in hand. Null if hand is empty

GetPartner ( Player askingPlayer ) : Player

Gets the partner of the a player

GetPlayerWhoPlayedCard ( Card card ) : Player

Gets the player who played a given card

IsValid ( Player player, Card card ) : bool

If card played by this player is valid according to game rules

Private Methods

Method Description
Add ( Player player, Card card ) : void
CheckBelotForValidColor ( Player player, Card playedCard, CardsCollection foundCards ) : void
CheckForBelotCombination ( Player player, Card playedCard ) : void
DetermineCurrentHandWinner ( ) : Player
GetBiggestCard ( Hand currentHand ) : Card
GetBiggestCard ( Hand currentHand, CardColor trumpColor ) : Card
GetLastHand ( ) : Hand
GetPlayingColor ( Hand currentHand ) : CardColor
GetTrumpColor ( ) : CardColor
HasBigger ( Card biggestCard, CardsCollection cards, CardColor wantedColor ) : bool
HasPlayingColor ( CardColor color, CardsCollection cards ) : bool
IsBigger ( Card card, Card biggestCard ) : bool
PlayingManager ( Announcement current, BelotGame game, CardsCollection _allCards ) : System

Constructor for the class

Method Details

GetBiggestCard() public method

Gets the current biggest card in hand. Null if hand is empty
public GetBiggestCard ( ) : Card
return Card

GetPartner() public method

Gets the partner of the a player
public GetPartner ( Player askingPlayer ) : Player
askingPlayer Player
return Player

GetPlayerWhoPlayedCard() public method

Gets the player who played a given card
public GetPlayerWhoPlayedCard ( Card card ) : Player
card Card the card to check for
return Player

IsValid() public method

If card played by this player is valid according to game rules
public IsValid ( Player player, Card card ) : bool
player Player
card Card
return bool