public void PrepareButtonsState()
 {
     if (!DataStatic.ImAttacker)
     {
         DataStatic.FreezeButtons(form: _form, withExceptionControls: _form.ProtectedControls.ToArray());
         _form.SetTurnMsg(DataStatic.Enemy);
     }
     else
     {
         _form.SetTurnMsg(DataStatic.Me);
     }
 }
Ejemplo n.º 2
0
        private async Task ExecuteTurnAsync(Button selectedButton, Player currPlayer, MainBackground boardForm)
        {
            var opposedPlayer = currPlayer == DataStatic.Me ? DataStatic.Enemy : DataStatic.Me;

            boardForm.SetTurnMsg(opposedPlayer);

            SetControlsStatus(selectedButton, currPlayer);

            if (currPlayer == DataStatic.Me)
            {
                await _socketConnection.SendAsync(selectedButton);
            }

            _judge.Move(currPlayer, selectedButton);
        }