public Spades game; // the spades game
public String[] hand; // cards to display
public String[] pile; // played cards to display
+ public String turn; // whos turn it is
+ public String state; // state of the game (turn, bid, etc)
/* GLSurfaceView Methods */
public Cards(Context context)
this.hand = "As Ks Qs Js 10s 9s 8s 7s 6s 5s 4s 3s 2s".split(" ");
this.pile = "Ah Ac Ad".split(" ");
+ this.turn = "";
this.index = new HashMap<String,Integer>(52);
for (int i = 0; i < 52; i++)
break;
}
this.lscroll.smoothScrollTo(0, this.log.getBottom());
+
+ // Update title
+ if (this.cards.turn != null && this.cards.turn != "" &&
+ this.cards.state != null && this.cards.state != "") {
+ this.setTitle("Spades - " + this.cards.turn + "'s " + this.cards.state);
+ }
}
private void onNotify(String text)
this.cards.pile = Spades.getCards(txt, ".*turn! \\((.*)\\)");
this.cards.requestRender();
}
+ if (txt.startsWith("It is")) {
+ this.cards.turn = txt.replaceAll("It is (\\w+)'s (\\w+)!.*", "$1");
+ this.cards.state = txt.replaceAll("It is (\\w+)'s (\\w+)!.*", "$2");
+ this.cards.requestRender();
+ }
+ if (txt.startsWith("^it is your")) {
+ this.cards.turn = msg.to;
+ this.cards.requestRender();
+ }
}
/* UI Callbacks */