source: protocol/src/main/java/geniusweb/protocol/tournament/allpermutationslearn/AllPermutationsLearnState.java@ 52

Last change on this file since 52 was 52, checked in by ruud, 14 months ago

Fixed small issues in domaineditor.

File size: 1.3 KB
Line 
1package geniusweb.protocol.tournament.allpermutationslearn;
2
3import java.util.ArrayList;
4import java.util.List;
5
6import com.fasterxml.jackson.annotation.JsonCreator;
7import com.fasterxml.jackson.annotation.JsonProperty;
8
9import geniusweb.protocol.session.SessionResult;
10import geniusweb.protocol.tournament.allpermutations.AllPermutationsSettings;
11import geniusweb.protocol.tournament.allpermutations.AllPermutationsState;
12
13/**
14 * A non-parallel simple implementation of all-permutations
15 */
16public class AllPermutationsLearnState extends AllPermutationsState {
17
18 @JsonCreator
19 public AllPermutationsLearnState(
20 @JsonProperty("toursettings") AllPermutationsSettings toursettings,
21 @JsonProperty("results") List<SessionResult> results) {
22 super(toursettings, results);
23 }
24
25 /**
26 *
27 * @param result the next {@link SessionResult}
28 * @return new state
29 * @throws IllegalArgumentException if the result participants are not
30 * matching the expected participants
31 */
32 @Override
33 public AllPermutationsLearnState with(List<SessionResult> result) {
34 ArrayList<SessionResult> newresults = new ArrayList<>(results);
35 newresults.addAll(result);
36 return new AllPermutationsLearnState(
37 (AllPermutationsLearnSettings) toursettings, newresults);
38 }
39
40}
Note: See TracBrowser for help on using the repository browser.