コード例 #1
0
 public void UpdatePlayers(string name)
 {
     if (guiActivity.InvokeRequired)
     {
         UpdatePlayerList del = new UpdatePlayerList(UpdatePlayers);
         this.srvPlayerlist.Invoke(del, new object[] { name });
     }
     else
     {
         this.srvPlayerlist.Items.Add(name);
     }
 }
コード例 #2
0
        public void DrawCardFromPlayer(int cardIndex, int playerIndex, int nextPlayerIndex)
        {
            PlayerLost(players[nextPlayerIndex]);

            if (players[playerIndex].lost)
            {
                Debug.WriteLine(players[playerIndex].playerName + " lost the game");
                Lostgame?.Invoke(this, EventArgs.Empty); // her vægger et envent Lostgame
                return;
            }

            players[playerIndex].DrawFromPlayer(players[nextPlayerIndex], cardIndex);
            UpdatePlayerList?.Invoke(this, EventArgs.Empty); // her vægger et envent UpdatePlayerList
        }
コード例 #3
0
ファイル: Manager_Main.cs プロジェクト: CarlosX/DarkEmu
 public void UpdatePlayers(string name)
 {
     if (guiActivity.InvokeRequired)
     {
         UpdatePlayerList del = new UpdatePlayerList(UpdatePlayers);
         this.srvPlayerlist.Invoke(del, new object[] { name });
     }
     else
     {
         this.srvPlayerlist.Items.Add(name);
     }
 }