1 package shoot_the_moon
;
8 * Dummy AI class that will always bid one higher than the previous bid in
9 * hearts (unless the maximum bid is reached then it will pass) and will always
10 * play it's first legal card in it's hand.
15 public class DummyPlayer
extends Player
{
18 public DummyPlayer( String name
) {
22 protected Bid
decideBid( Bid lastHighestBid
) {
23 if ( lastHighestBid
== null ) {
24 return Bid
.makeNormalBid( 1, Trump
.HEARTS
);
26 if ( lastHighestBid
.isPass() ) {
27 return Bid
.makeNormalBid( 1, Trump
.HEARTS
);
28 } else if ( lastHighestBid
.isNormalBid() ) {
29 int lastBid
= lastHighestBid
.getNumber();
30 if ( lastBid
>= Rules
.getHandSize( this.getSettings() ) ) {
31 return Bid
.makePassBid();
33 return Bid
.makeNormalBid( lastBid
+1, Trump
.HEARTS
);
35 //else the last highest bid was a shoot
37 return Bid
.makePassBid();
42 protected Card
decideCard( List
<Card
> legalCards
) {
43 // System.out.print( this.getPosition() + " has the hand: " );
44 // List<Card> hand = ListFactory.makeList( this.getHand() );
45 // Collections.sort( hand, new CardComparator( this.getCurrentTrump() ) );
47 // for ( Card c: hand ) {
48 // System.out.print( c.toString() + " ");
50 // System.out.print( '\n' );
52 return legalCards
.get( 0 );
56 public String
getName() {
61 protected void processEvent( Event e
) {