Пример #1
0
        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);
        }
Пример #2
0
        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));
                }
            }
        }
Пример #3
0
 //テトリスのステータスが変更したとき
 private void OnUpdateStatus(TetrisEventArgs eventargs)
 {
     //
 }
Пример #4
0
 //テトリスのステータスが変更したとき
 private void OnUpdateStatus(TetrisEventArgs eventargs)
 {
     //
 }