[ all classes ]
[ it.polimi.ingsw.view.CLI ]
Coverage Summary for Class: GodEffect (it.polimi.ingsw.view.CLI)
Class | Class, % | Method, % | Line, % |
---|---|---|---|
GodEffect | 0% (0/ 1) | 0% (0/ 5) | 0% (0/ 22) |
1 package it.polimi.ingsw.view.CLI;
2
3 /**
4 * God effects map god name to gods'effects
5 */
6 enum GodEffect {
7 APOLLO("Your Move: Your Worker may move into an opponent Worker’s space by forcing their Worker to the space yours just vacated."),
8 ARTEMIS("Your Move: Your Worker may move one additional time, but not back to its initial space."),
9 ATHENA("Opponent’s Turn: If one of your Workers moved up on your last turn, opponent Workers cannot move up this turn."),
10 ATLAS("Your Build: Your Worker may build a dome at any level."),
11 DEMETER("Your Build: Your Worker may build one additional time, but not on the same space."),
12 HEPHAESTUS("Your Build: Your Worker may build one additional block (not dome) on top of your first block."),
13 HERA("Opponent’s Turn: An opponent cannot win by moving into a perimeter space."),
14 MEDUSA("End of Your Turn: If possible, your Workers build in lower neighboring spaces that are occupied by opponent Workers, removing the opponent Workers from the game."),
15 MINOTAUR(
16 "Your Move: Your Worker may move into an opponent Worker’s space, if their Worker can be forced one space straight backwards to an unoccupied space at any level."),
17 PAN("Win Condition: You also win if your Worker moves down two or more levels."),
18 POSEIDON("End of Your Turn: If your unmoved Worker is on the ground level, it may build up to three times."),
19 PROMETHEUS("Your Turn: If your Worker does not move up, it may build both before and after moving."),
20 ZEUS("Your Build: Your Worker may build a block under itself."),
21 TRITON("Your Move: Each time your Worker moves into a perimeter space, it may immediately move again.");
22
23 /**
24 * God Effect
25 */
26 private final String effect;
27
28 /**
29 * GetEffect Constructor
30 *
31 * @param effect God Effect
32 */
33 private GodEffect(String effect) {
34 this.effect = effect;
35 }
36
37 /**
38 * Get god effect
39 *
40 * @return god effect
41 */
42 public String getEffect() {
43 return effect;
44 }
45
46 /**
47 * Convert a god name into a GodEffect, otherwise null is returned
48 *
49 * @param input the str that needed to be converted
50 * @return converted enum element
51 */
52
53 public static GodEffect strConverter(String input) {
54 try {
55 return Enum.valueOf(GodEffect.class, input.toUpperCase());
56 } catch (Exception e) {
57 return null;
58 }
59 }
60 }