blob: 3c897087ed59a12d86c36b565cb0c10ff7a48418 (
plain)
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
|
package jrummikub.control.turn;
import jrummikub.model.GameSettings;
import jrummikub.model.IHand;
import jrummikub.model.IPlayer;
import jrummikub.model.ITable;
import jrummikub.util.Event;
import jrummikub.util.IEvent;
import jrummikub.view.IView;
/**
* Abstract base class for TurnControls
*/
public abstract class AbstractTurnControl implements ITurnControl {
protected Event endOfTurnEvent = new Event();
protected Event redealEvent = new Event();
protected GameSettings settings;
protected IPlayer player;
protected IHand hand;
protected ITable table;
protected IView view;
protected boolean inspectOnly;
protected boolean mayRedeal;
@Override
public IEvent getEndOfTurnEvent() {
return endOfTurnEvent;
}
@Override
public Event getRedealEvent() {
return redealEvent;
}
@Override
public void setup(GameSettings settings, IPlayer player, ITable table,
IView view, boolean inspectOnly, boolean mayRedeal) {
this.settings = settings;
this.player = player;
this.hand = player.getHand();
this.table = table;
this.view = view;
this.inspectOnly = inspectOnly;
this.mayRedeal = mayRedeal;
}
}
|