Games::Euchre::Player

Games::Euchre::Player is a player class for Euchre card game.
Download

Games::Euchre::Player Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Chris Dolan
  • Publisher web site:
  • http://search.cpan.org/~cdolan/

Games::Euchre::Player Tags


Games::Euchre::Player Description

Games::Euchre::Player is a player class for Euchre card game. Games::Euchre::Player is a player class for Euchre card game.The four Player objects are used to interact with the humand and computer players, as well as to keep the state of the players hand, whether he bid and whether he went alone.CLASS METHODSnew GAME NUMBER NAMECreate and initialize a new Euchre player. The number is 1-4.INSTANCE METHODSgetGameReturn the Euchre game instance to which this player belongs.setTeam TEAMRecord the Team instance that this player belongs to.getTeamReturn the Team instance to which this player belongs.setAI AIRecord the AI instance for this player.getAIReturn the AI instance for this player.setAloneIndicate that this player has chosen to go alone in the current hand.setBidIndicate that this player has chosen to choose trump in the current hand.wentAloneReturns a boolean indicating whether this player chose to go alone on a bid.isBidderReturns a boolean indicating whether this player called the trump suit during bidding.getNameReturn this player's namegetNumberReturn this player's number, between 1 and 4getHandReturn the Games::Cards::Hand object representing this player's current hand.getCardsReturn an array of the Games::Cards::Card objects held in the player's hand.resetGameClear all of the state for the current game and get ready for the next one.resetHandClear all of the state for the current hand and get ready for the next one.bid TURNAllow the player to choose trump or pass. Returns one of: H, C, D, S, N, HA, CA, DA, SA, NA, or undef. If the player has an AI instance set, that is invoked. Otherwise a pathetically simple AI decides the bid.pickItUpAllow the player, as dealer, to select which card to trade for the turned up card. This method performs the actual trade. If the player has an AI instance set, that is invoked. Otherwise a pathetically simple AI chooses the card.playCard TRICKAllow the player to select which card to play on the current trick. This method performs the actual play. If the player has an AI instance set, that is invoked. Otherwise a pathetically simple AI chooses the card.isLegalBid TURNNUMBER BIDGiven a bid, return a boolean indicating the validity of that bid. The bid is tested for structure (one of H, C, D, S, N, HA, CA, DA, SA, NA, or undef), tested against the bidding round (only the turned-up card suit can be called in round 1 , and may not be called in round 2), against the game options (hang-the-dealer, no-trump).This is called from the bid() method. Requirements: · Perl


Games::Euchre::Player Related Software