示例#1
0
 /// <summary>
 /// Gestiona los clicks del ratón del usuario.
 /// </summary>
 /// <returns>Devuelve un objeto tipo Screen según las acciones del usuario.</returns>
 public Screen Click()
 {
     if (ActualData.Turn == Name)
     {
         if (BtnPass.isHover(Mouse.GetState().X, Mouse.GetState().Y) && ServerWaiting)
         {
             skipTurn();
         }
         if (BtnPlay.isHover(Mouse.GetState().X, Mouse.GetState().Y) && SelectedCard != -1 && ServerWaiting)
         {
             sendCard();
         }
     }
     if (BtnNextCard.isHover(Mouse.GetState().X, Mouse.GetState().Y))
     {
         moveCards(true);
     }
     if (BtnPreviousCard.isHover(Mouse.GetState().X, Mouse.GetState().Y))
     {
         moveCards(false);
     }
     foreach (Boton btn in BtnCards)
     {
         if (btn.isHover(Mouse.GetState().X, Mouse.GetState().Y))
         {
             Game.effects[MainGame.eSounds.click].Play();
             SelectedCard      = BtnCards.IndexOf(btn);
             BtnSelectedCard.X = btn.X - Column / 10;
             BtnSelectedCard.Y = (btn.Y + btn.Height / 2) - BtnSelectedCard.Height / 2;
         }
     }
     return(this);
 }
示例#2
0
 public new void SetFocus()
 {
     BtnPass.Select();
     BtnPass.Focus();
 }