Esempio n. 1
0
 /// <summary>
 /// 注册角色
 /// </summary>
 /// <param name="player">角色物品管理器</param>
 public void RegisterPlayer(RookiesGoods_PlayerData player)
 {
     if (PlayersData.ContainsKey(player.PlayerId))
     {
         throw new ArgumentException("以存在角色ID");
     }
     PlayersData.Add(player.PlayerId, player);
 }
Esempio n. 2
0
File: GUI.cs Progetto: tiganov/CAT
 private void AddButton_Click(object sender, RoutedEventArgs e)
 {
     // make sure there is something in the text box, before adding it to the players
     if (PlayerInputBox.Text != "" && PlayersListView.Items.Count < 6)
     {
         PlayersData.Add(PlayerInputBox.Text);
         PlayerInputBox.Text  = "";                // clear the input box
         ErrorText.Visibility = Visibility.Hidden; // hide the error message
     }
 }
Esempio n. 3
0
    public void Load(BitBuffer bitBuffer)
    {
        time = bitBuffer.GetFloat();
        int playerCount = bitBuffer.GetInt();

        for (int i = 0; i < playerCount; i++)
        {
            PlayerData playerData = new PlayerData();
            playerData.Load(bitBuffer);
            PlayersData.Add(playerData);
        }
    }