desktop/desktop-sample/src/main/java/cz/xelfi/quoridor/desktop/sample/ShowGames.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Mon, 13 Sep 2010 16:27:07 +0200
branchdesktop
changeset 260 8ebffb5aa10e
child 268 13fe01081e23
permissions -rw-r--r--
Shows all current games
     1 /*
     2  * To change this template, choose Tools | Templates
     3  * and open the template in the editor.
     4  */
     5 package cz.xelfi.quoridor.desktop.sample;
     6 
     7 import cz.xelfi.quoridor.webidor.GameId;
     8 import java.awt.event.ActionEvent;
     9 import java.awt.event.ActionListener;
    10 
    11 public final class ShowGames implements ActionListener {
    12 
    13     @Override
    14     public void actionPerformed(ActionEvent e) {
    15         for (GameId gameId : Quoridor.getDefault().listGames()) {
    16             KukTopComponent tc = new KukTopComponent();
    17             tc.setGameId(gameId.getId());
    18             tc.setName(gameId.getWhite() + "/" + gameId.getBlack());
    19             tc.open();
    20         }
    21     }
    22 }