Examples of DeckLayoutBase


Examples of cero.ui.graphical.tools.layout.base.DeckLayoutBase

   */
  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()){
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.