private static int GetGarbageLine(TetrisEventArgs e) { int cnt = 0; if (e.LineClearCount >= 4) { cnt += 4; } else if (e.LineClearCount >= 3) { cnt += 2; } else if (e.LineClearCount >= 2) { cnt += 1; } if (e.Combo >= 6) { cnt += 3; } else if (e.Combo >= 4) { cnt += 2; } else if (e.Combo >= 2) { cnt += 1; } return(cnt); }
private async void SendBlockToPlayer(object sender, TetrisEventArgs e) { if (Players.Count <= 1) { return; } Tetris tetris = sender as Tetris; int garbageLine = GetGarbageLine(e); foreach (Tetris player in Players) { if (player.PlayerId != tetris?.PlayerId) { await Task.Run(() => player.SetGarbageLine(garbageLine)); } } }
//テトリスのステータスが変更したとき private void OnUpdateStatus(TetrisEventArgs eventargs) { // }