forked from CodinGame/ghost-in-the-cell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMultiReferee.java
More file actions
75 lines (45 loc) · 2.25 KB
/
MultiReferee.java
File metadata and controls
75 lines (45 loc) · 2.25 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Properties;
public abstract class MultiReferee {
private final InputStream in;
private final PrintStream out;
private final PrintStream err;
public MultiReferee(InputStream in, PrintStream out, PrintStream err) {
this.in = in;
this.out = out;
this.err = err;
}
protected String translate(String incAction, int i, int id, int id2) {
return incAction;
}
protected String translate(String incAction, int i, int id) {
return translate(incAction, i, id, -1);
}
protected void addToolTip(int id, String bombAction) {
}
protected abstract void initReferee(int playerCount, Properties prop) throws InvalidFormatException;
protected abstract Properties getConfiguration();
protected abstract String[] getInitInputForPlayer(int playerIdx);
protected abstract void prepare(int round);
protected abstract String[] getInputForPlayer(int round, int playerIdx);
protected abstract int getExpectedOutputLineCountForPlayer(int playerIdx);
protected abstract void handlePlayerOutput(int frame, int round, int playerIdx, String[] outputs)
throws WinException, LostException, InvalidInputException;
protected abstract void updateGame(int round) throws GameOverException;
protected abstract void populateMessages(Properties p);
protected abstract String[] getInitDataForView();
protected abstract String[] getFrameDataForView(int round, int frame, boolean keyFrame);
protected abstract String getGameName();
protected abstract String getHeadlineAtGameStartForConsole();
protected abstract int getMinimumPlayerCount();
protected abstract boolean showTooltips();
protected abstract String[] getPlayerActions(int playerIdx, int round);
protected abstract boolean isPlayerDead(int playerIdx);
protected abstract String getDeathReason(int playerIdx);
protected abstract int getScore(int playerIdx);
protected abstract String[] getGameSummary(int round);
protected abstract void setPlayerTimeout(int frame, int round, int playerIdx);
protected abstract int getMaxRoundCount(int playerCount);
protected abstract int getMillisTimeForRound();
}