C# Class Belot.Player

This is a base class for all players. Custom implementations (Human or Computer players) must derive from this class.
ファイルを表示 Open project: NikolayIT/BelotGameEngine Class Usage Examples

Public Methods

Method Description
AnnounceCombination ( CardCombination combination ) : bool

The player has a combination in his cards.

MakeAnnouncement ( AnnouncementManager manager ) : Announcement

The player makes an announcement (bidding). Player has to ask the manager if desired announcement is valid. Otherwise returning invalid announcement throws exception.

Protected Methods

Method Description
PlayCard ( PlayingManager manager ) : void

The player has to play a card. Player has to ask the manager if desired card is valid. Otherwise returning invalid card throws exception.

Player ( ) : System

Constructor for the class.

Player ( string name ) : System

Constructor for the class. Creates a new player with the specified name.

RaiseCardPlayed ( Card card ) : void

Raises the CardsChanged event

RaiseCardPlaying ( PlayingManager manager ) : void

Raises the CardPlaying event

RaiseCardsChanged ( ) : void

Raises the CardsChanged event

Private Methods

Method Description
SetPosition ( PlayerPosition position ) : void

Method Details

AnnounceCombination() public abstract method

The player has a combination in his cards.
public abstract AnnounceCombination ( CardCombination combination ) : bool
combination CardCombination The combination of cards tha player has
return bool

MakeAnnouncement() public abstract method

The player makes an announcement (bidding). Player has to ask the manager if desired announcement is valid. Otherwise returning invalid announcement throws exception.
public abstract MakeAnnouncement ( AnnouncementManager manager ) : Announcement
manager AnnouncementManager Manager that observes bidding rules
return Announcement

PlayCard() protected abstract method

The player has to play a card. Player has to ask the manager if desired card is valid. Otherwise returning invalid card throws exception.
protected abstract PlayCard ( PlayingManager manager ) : void
manager PlayingManager Manager that observes playing rules
return void

Player() protected method

Constructor for the class.
protected Player ( ) : System
return System

Player() protected method

Constructor for the class. Creates a new player with the specified name.
protected Player ( string name ) : System
name string The name of the player
return System

RaiseCardPlayed() protected method

Raises the CardsChanged event
protected RaiseCardPlayed ( Card card ) : void
card Card
return void

RaiseCardPlaying() protected method

Raises the CardPlaying event
protected RaiseCardPlaying ( PlayingManager manager ) : void
manager PlayingManager
return void

RaiseCardsChanged() protected method

Raises the CardsChanged event
protected RaiseCardsChanged ( ) : void
return void