* @param e
* the GameEvent to listen to
*/
public void gameStart(GameEvent e){
Game g = e.getGame();
Player p = g.getPlayers().get(0);
DeckLayoutBase deckLayoutBase = new DeckLayoutBase();
this.setDeckLayout(deckLayoutBase);
if (g instanceof UnoGame) {
UnoGame game = (UnoGame)g;
// create graphical zones need for Uno game
GraphicsZone Talon = new GraphicsZoneColor(game.getZones().get("Talon"));
GraphicsZone Hand = new GraphicsZoneBase(p.getZones().get("Hand"));
Hand.setZoneLayout(new ZoneLayoutOverLapH());
HashMap<Player,GraphicsZone> gZoneIAMap = new HashMap<Player,GraphicsZone>();
int i = 0;
for(Player z : g.getPlayers()){
if(z != p){
gZoneIAMap.put(z,new GraphicsZoneNumber(z.getZones().get("Hand")));
deckLayoutBase.addZone(gZoneIAMap.get(z),new Constraint(Constraint.NORTH,i));
i++;
}
}
// lay down graphical zones
deckLayoutBase.addZone(Talon,new Constraint(Constraint.CENTER,0));
deckLayoutBase.addZone(Hand,new Constraint(Constraint.SOUTH,0));
// add graphical zone to Devint Uno deck
this.add(Talon);
this.add(Hand);;
for(Player z : g.getPlayers()){
if(z != p){
this.add(gZoneIAMap.get(z));
}
}