[ all classes ]
[ it.polimi.ingsw.model ]
Coverage Summary for Class: GodHera (it.polimi.ingsw.model)
Class | Class, % | Method, % | Line, % |
---|---|---|---|
GodHera | 100% (1/ 1) | 100% (2/ 2) | 100% (6/ 6) |
1 package it.polimi.ingsw.model;
2
3 class GodHera extends GodDecorator {
4
5 /**
6 * God Hera's class
7 * @param godPower God's power
8 */
9 public GodHera(GodInterface godPower) {
10 super(godPower);
11 }
12
13 /**
14 * Get event
15 * @param events event to be updated
16 * @param map board situation at the moment
17 * @param actions action of the event
18 */
19 @Override
20 public void getEvent(Event[] events, Cell[][] map, Action[][][] actions) {
21
22 if ((events[0].equals(Event.MOVE) && !godPower.getName().equals(godPower.getCurrentPlayer())) && (godPower.getPositionWorker()[0] == 0 || godPower.getPositionWorker()[0] == 4 || godPower.getPositionWorker()[1] == 0 || godPower.getPositionWorker()[1] == 4) && !godPower.getPlayerStatus().equals(StatusPlayer.LOSE)) {
23 godPower.setStatusPlayer(StatusPlayer.GAMING);
24 godPower.setLastGod(God.HERA);
25 }
26 }
27 }