[ADD] added buttons reenabled when leaving
This commit is contained in:
@@ -8,7 +8,7 @@ using static SharedClientServer.JSONConvert;
|
||||
|
||||
namespace Client
|
||||
{
|
||||
public delegate void OnLobbyCreated(int id);
|
||||
public delegate void LobbyCallback(int id);
|
||||
class Client : ObservableObject
|
||||
{
|
||||
private TcpClient tcpClient;
|
||||
@@ -23,7 +23,8 @@ namespace Client
|
||||
public Callback OnLobbiesListReceived;
|
||||
public Callback OnLobbyJoinSuccess;
|
||||
public Callback OnLobbiesReceivedAndWaitingForHost;
|
||||
public OnLobbyCreated OnLobbyCreated;
|
||||
public LobbyCallback OnLobbyCreated;
|
||||
public LobbyCallback OnLobbyLeave;
|
||||
public Lobby[] Lobbies { get; set; }
|
||||
|
||||
public Client(string username)
|
||||
@@ -118,6 +119,10 @@ namespace Client
|
||||
case LobbyIdentifier.JOIN_SUCCESS:
|
||||
OnLobbyJoinSuccess?.Invoke();
|
||||
break;
|
||||
case LobbyIdentifier.LEAVE:
|
||||
int lobbyLeaveID = JSONConvert.GetLobbyID(payload);
|
||||
OnLobbyLeave?.Invoke(lobbyLeaveID);
|
||||
break;
|
||||
}
|
||||
//TODO fill lobby with the data received
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user