Skip to content

Commit 1be8618

Browse files
committed
Implemented Games enum
1 parent c4502cb commit 1be8618

File tree

1 file changed

+35
-0
lines changed
  • app/src/main/java/com/phikal/regex/Games

1 file changed

+35
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package com.phikal.regex.Games;
2+
3+
import android.content.Context;
4+
5+
import com.phikal.regex.Games.Match.MutMatchGame;
6+
import com.phikal.regex.Games.Match.SimpleMatchGame;
7+
import com.phikal.regex.Games.Match.WordGame;
8+
import com.phikal.regex.Models.Game;
9+
import com.phikal.regex.Models.Progress;
10+
11+
import java.io.IOException;
12+
13+
public enum Games {
14+
15+
SIMPLE_MATCH {
16+
public Game generate(Context ctx, Progress p) {
17+
return new SimpleMatchGame(ctx, p);
18+
}
19+
},
20+
MUTATE_MATCH {
21+
@Override
22+
public Game generate(Context ctx, Progress p) {
23+
return new MutMatchGame(ctx, p);
24+
}
25+
},
26+
WORD_MATCH {
27+
@Override
28+
public Game generate(Context ctx, Progress p) throws IOException {
29+
return new WordGame(ctx, p);
30+
}
31+
};
32+
33+
public abstract Game generate(Context ctx, Progress p)
34+
throws IOException;
35+
}

0 commit comments

Comments
 (0)