webidor/src/main/java/cz/xelfi/quoridor/webidor/GameId.java
changeset 131 19e81456eef2
parent 96 2eeaa41236c3
child 164 2949998db4f6
     1.1 --- a/webidor/src/main/java/cz/xelfi/quoridor/webidor/GameId.java	Sat Sep 19 07:58:56 2009 +0200
     1.2 +++ b/webidor/src/main/java/cz/xelfi/quoridor/webidor/GameId.java	Sun Oct 25 14:24:58 2009 +0100
     1.3 @@ -56,6 +56,8 @@
     1.4      private GameStatus status;
     1.5      @XmlID @XmlAttribute
     1.6      private String id;
     1.7 +    @XmlAttribute
     1.8 +    private int comments;
     1.9  
    1.10      GameId() {
    1.11      }
    1.12 @@ -66,17 +68,18 @@
    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
    1.17 +            first, second, d, d, GameStatus.whiteMove, 0
    1.18          );
    1.19      }
    1.20  
    1.21 -    public GameId(String id, String first, String second, Date started, Date last, GameStatus result) {
    1.22 +    public GameId(String id, String first, String second, Date started, Date last, GameStatus result, int comments) {
    1.23          this.white = first;
    1.24          this.black = second;
    1.25          this.id = id;
    1.26          this.started = started.getTime();
    1.27          this.modified = last.getTime();
    1.28          this.status = result;
    1.29 +        this.comments = comments;
    1.30      }
    1.31  
    1.32      public String getId() {
    1.33 @@ -103,6 +106,10 @@
    1.34          return status;
    1.35      }
    1.36  
    1.37 +    public int getComments() {
    1.38 +        return comments;
    1.39 +    }
    1.40 +
    1.41      private static final class NewestFirst implements Comparator<GameId> {
    1.42          public int compare(GameId o1, GameId o2) {
    1.43              if (o1 == o2) {