summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/control/network/IConnectionControl.java
blob: 9307ce0e0e6336ddca90bffed276618efbe630de (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
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
76
77
78
79
80
81
82
83
84
85
86
87
88
package jrummikub.control.network;

import java.awt.Color;
import java.util.UUID;

import jrummikub.control.RoundControl.InvalidTurnInfo;
import jrummikub.model.IRoundState;
import jrummikub.model.ITable;
import jrummikub.util.GameData;
import jrummikub.util.IEvent;
import jrummikub.util.IEvent1;
import jrummikub.util.IEvent2;
import jrummikub.view.LoginError;

interface IConnectionControl {

	public String getNickname();

	public void connect();

	public void disconnect();

	public IEvent getConnectedEvent();

	public IEvent1<LoginError> getConnectionFailedEvent();

	public IEvent1<GameData> getGameOfferEvent();

	public IEvent1<UUID> getGameWithdrawalEvent();

	public IEvent1<String> getGameJoinEvent();

	public IEvent1<String> getGameLeaveEvent();

	public IEvent1<Boolean> getGameJoinAckEvent();

	public IEvent2<String, Color> getChangeColorEvent();

	public IEvent getGameStartEvent();

	public IEvent getRoundStartEvent();

	public IEvent getRedealEvent();

	public IEvent1<IRoundState> getRoundStateUpdateEvent();

	public IEvent1<ITable> getTableUpdateEvent();

	public IEvent2<IRoundState, InvalidTurnInfo> getTurnEndEvent();

	public IEvent getNextPlayerEvent();

	public IEvent getTurnStartEvent();

	public IEvent1<String> getParticipantLeftEvent();

	public void offerGame(GameData data);

	public void withdrawGame();

	public GameData getCurrentGame();

	public void setCurrentGame(GameData game);

	public void joinGame(final GameData game);

	public void leaveGame();

	public void ackJoinGame(final String recipient, final boolean ack);

	public void changeColor(final Color color);

	public void startGame();

	public void startRound();

	public void redeal();

	public void updateRoundState(IRoundState roundState);

	public void updateTable(ITable table);

	public void endTurn(IRoundState state, InvalidTurnInfo invalidTurnInfo);

	public void nextPlayer();

	public void startTurn();
}