webidor/src/main/java/cz/xelfi/quoridor/webidor/GameId.java
branchstrict-games-access
changeset 164 2949998db4f6
parent 131 19e81456eef2
     1.1 --- a/webidor/src/main/java/cz/xelfi/quoridor/webidor/GameId.java	Sun Oct 25 14:24:58 2009 +0100
     1.2 +++ b/webidor/src/main/java/cz/xelfi/quoridor/webidor/GameId.java	Tue Dec 08 18:47:49 2009 +0100
     1.3 @@ -58,6 +58,8 @@
     1.4      private String id;
     1.5      @XmlAttribute
     1.6      private int comments;
     1.7 +    @XmlAttribute
     1.8 +    private boolean finished;
     1.9  
    1.10      GameId() {
    1.11      }
    1.12 @@ -68,11 +70,15 @@
    1.13      private GameId(String first, String second, Date d) {
    1.14          this(
    1.15              UUID.randomUUID().toString(),
    1.16 -            first, second, d, d, GameStatus.whiteMove, 0
    1.17 +            first, second, d, d, GameStatus.whiteMove, 0, false
    1.18          );
    1.19      }
    1.20  
    1.21 -    public GameId(String id, String first, String second, Date started, Date last, GameStatus result, int comments) {
    1.22 +    public GameId(
    1.23 +        String id, String first, String second,
    1.24 +        Date started, Date last, GameStatus result,
    1.25 +        int comments, boolean finished
    1.26 +    ) {
    1.27          this.white = first;
    1.28          this.black = second;
    1.29          this.id = id;
    1.30 @@ -80,6 +86,7 @@
    1.31          this.modified = last.getTime();
    1.32          this.status = result;
    1.33          this.comments = comments;
    1.34 +        this.finished = finished;
    1.35      }
    1.36  
    1.37      public String getId() {
    1.38 @@ -110,6 +117,10 @@
    1.39          return comments;
    1.40      }
    1.41  
    1.42 +    public boolean isFinished() {
    1.43 +        return finished;
    1.44 +    }
    1.45 +
    1.46      private static final class NewestFirst implements Comparator<GameId> {
    1.47          public int compare(GameId o1, GameId o2) {
    1.48              if (o1 == o2) {