From 19ebc13c024defb13c68e4111673f963df01dfa5 Mon Sep 17 00:00:00 2001 From: Jacek Kowalski <Jacek@jacekk.info> Date: Sun, 16 Aug 2015 22:18:49 +0000 Subject: [PATCH] Add SVG icon file --- app/src/main/java/net/jacekk/bridge/BridgeInput.java | 50 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 47 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/net/jacekk/bridge/BridgeInput.java b/app/src/main/java/net/jacekk/bridge/BridgeInput.java index e47323d..baf18a2 100644 --- a/app/src/main/java/net/jacekk/bridge/BridgeInput.java +++ b/app/src/main/java/net/jacekk/bridge/BridgeInput.java @@ -1,7 +1,51 @@ package net.jacekk.bridge; -/** - * Created by jacek on 18.01.15. - */ 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(); + } } -- Gitblit v1.9.1