Example #1
0
 public void PlayerQuitGame(string player, int gameId)
 {
     Dispatcher.CurrentDispatcher.InvokeAsync(() =>
     {
         GameFrame gameFrame = findGameFrame(gameId);
         ClientGame cg       = findGame(gameId);
         gameFrame.RemovePlayer(player);
         cg.RemovePlayer(player);
     });
 }
Example #2
0
 public void RemovePlayer(int gameID, string username)
 {
     Dispatcher.CurrentDispatcher.InvokeAsync(() =>
     {
         GameFrame gameFrame = findGameFrame(gameID);
         gameFrame.RemovePlayer(username);
         ClientGame game = findGame(gameID);
         foreach (ClientUserProfile prof in game.players)
         {
             if (prof.username.Equals(username))
             {
                 game.players.Remove(prof);
             }
         }
     });
 }