comp1110-ass2/tests/comp1110/ass2/testdata/AllValidMovesDataLoader.java
2023-03-22 14:26:58 +11:00

25 lines
563 B
Java

package comp1110.ass2.testdata;
import java.util.*;
public class AllValidMovesDataLoader extends DataLoader<Set<String>>{
public AllValidMovesDataLoader(){
super();
}
@Override
protected String getFileName() {
return "generateAllValidMoves";
}
@Override
protected Set<String> processLine(String line) {
line = line.substring(1,line.length()-1);
if(line.length() > 0){
return new HashSet<>(List.of(line.split(", ")));
} else{
return new HashSet<>();
}
}
}