|
@@ -22,7 +22,8 @@ namespace YJMPD_UWP.Model
|
|
|
Picture,
|
|
Picture,
|
|
|
Msg,
|
|
Msg,
|
|
|
GameFound,
|
|
GameFound,
|
|
|
- PlayerJoined
|
|
|
|
|
|
|
+ PlayerJoined,
|
|
|
|
|
+ PlayerRemoved
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public ApiHandler()
|
|
public ApiHandler()
|
|
@@ -44,6 +45,10 @@ namespace YJMPD_UWP.Model
|
|
|
Debug.WriteLine("Played joined");
|
|
Debug.WriteLine("Played joined");
|
|
|
PlayerJoined(o[Command.PlayerJoined.ToString()].ToString());
|
|
PlayerJoined(o[Command.PlayerJoined.ToString()].ToString());
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case Command.PlayerRemoved:
|
|
|
|
|
+ Debug.WriteLine("Played removed");
|
|
|
|
|
+ PlayerRemoved(o[Command.PlayerRemoved.ToString()].ToString());
|
|
|
|
|
+ break;
|
|
|
case Command.Picture:
|
|
case Command.Picture:
|
|
|
if (o["selected"].ToObject<bool>() == true)
|
|
if (o["selected"].ToObject<bool>() == true)
|
|
|
{
|
|
{
|
|
@@ -64,6 +69,12 @@ namespace YJMPD_UWP.Model
|
|
|
App.Game.AddPlayer(username);
|
|
App.Game.AddPlayer(username);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private void PlayerRemoved(string username)
|
|
|
|
|
+ {
|
|
|
|
|
+ //Event will be handled by the game manager
|
|
|
|
|
+ App.Game.RemovePlayer(username);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private void GameFound()
|
|
private void GameFound()
|
|
|
{
|
|
{
|
|
|
throw new NotImplementedException();
|
|
throw new NotImplementedException();
|