forked from aws-samples/eb-java-scorekeep
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRulesFactory.java
More file actions
31 lines (26 loc) · 868 Bytes
/
RulesFactory.java
File metadata and controls
31 lines (26 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package scorekeep;
import java.util.*;
import java.security.SecureRandom;
import java.math.BigInteger;
public class RulesFactory {
private SecureRandom random = new SecureRandom();
private final HashMap<String, Rules> allRules = new HashMap<String, Rules>(1);
public RulesFactory(){
String id = "TICTACTOE";
String name = "Tic Tac Toe";
String[] categories = { "head to head", "quick" };
Integer[] users = { 2 };
Integer teams = 0;
String[] phases = { "Move" };
String[] moves = { "Roll" };
String initialState = "X ";
Rules tictactoe = new Rules(id, name, categories, users, teams, phases, moves, initialState);
allRules.put(tictactoe.getId(), tictactoe);
}
public Rules getRules(String id) {
return allRules.get(id);
}
public Collection<Rules> getAllRules() {
return allRules.values();
}
}