package net.jacekk.bridge;
|
|
public class BridgeInput {
|
public enum Suit {
|
MINOR(0), MAJOR(1), NOTRUMP(2);
|
|
public final int tableIndex;
|
|
Suit(int tableIndex) {
|
this.tableIndex = tableIndex;
|
}
|
}
|
|
public enum Contract {
|
NORMAL(1, 0), DOUBLED(2, 1), REDOUBLED(4, 2);
|
|
public final int multiplier;
|
public final int tableIndex;
|
|
Contract(int multiplier, int tableIndex) {
|
this.multiplier = multiplier;
|
this.tableIndex = tableIndex;
|
}
|
}
|
|
public int bid;
|
public Suit suit;
|
public Contract contract;
|
public boolean weVulnerable;
|
public boolean theyVulnerable;
|
public int PC;
|
public int tricks;
|
|
public String toString() {
|
StringBuilder builder = new StringBuilder();
|
builder.append(bid).append(' ').append(suit.name()).append(' ');
|
builder.append(contract.name()).append(' ');
|
|
if (weVulnerable)
|
builder.append('V');
|
else
|
builder.append('N');
|
if (theyVulnerable)
|
builder.append('V');
|
else
|
builder.append('N');
|
builder.append(' ');
|
builder.append(PC).append("PC, tricks: ").append(tricks);
|
return builder.toString();
|
}
|
}
|