Exemplo n.º 1
0
 @Override
 protected Tracker clone() {
   Tracker ret = (Tracker) super.clone();
   ret.values = new java.util.HashSet<Integer>(this.values);
   ret.unmodifiable = java.util.Collections.unmodifiableSet(ret.values);
   return ret;
 }
Exemplo n.º 2
0
 @SuppressWarnings("unchecked")
 @Override
 public Tracker clone() {
   Tracker ret = (Tracker) super.clone();
   ret.thisTurn = (java.util.HashMap<Integer, Integer>) this.thisTurn.clone();
   ret.previousTurn = (java.util.HashMap<Integer, Integer>) this.previousTurn.clone();
   ret.unmodifiable = java.util.Collections.unmodifiableMap(ret.previousTurn);
   return ret;
 }
Exemplo n.º 3
0
    @Override
    public Set evaluate(GameState state, Identified thisObject) {
      Tracker tracker = state.getTracker(Tracker.class);

      // if "a player" cast two or more spells this turn -- a single value
      // in the map must be >= 2
      for (int spellCount : tracker.getValue(state).values())
        if (spellCount >= 2) return NonEmpty.set;
      return Empty.set;
    }
Exemplo n.º 4
0
 @Override
 public Set evaluate(GameState state, Identified thisObject) {
   Tracker tracker = state.getTracker(Tracker.class);
   if (tracker.getValue(state).isEmpty()) return NonEmpty.set;
   return Empty.set;
 }