public override void HandlePreSelection(PreBoard preBoard, Hand playerHand, ref InputResult result)
 {
     if (this.strictActiveInputHandler != InputDelegatorHandler.InputType.None)
     {
         this.inputs[(Int32)this.strictActiveInputHandler].HandlePreSelection(preBoard, playerHand, ref result);
     }
     else
     {
         foreach (InputHandler inputHandler in this.inputs)
         {
             inputHandler.HandlePreSelection(preBoard, playerHand, ref result);
         }
     }
 }
Exemple #2
0
 public override void HandlePreSelection(PreBoard preBoard, Hand playerHand, ref InputResult result)
 {
     if (Input.GetMouseButtonUp(0))
     {
         Vector3 worldPoint        = Camera.main.ScreenToWorldPoint(Input.mousePosition);
         Int32   indexByWorldPoint = preBoard.GetIndexByWorldPoint(worldPoint);
         if (indexByWorldPoint >= 0)
         {
             preBoard.SetPreviewCardID(indexByWorldPoint);
         }
         else
         {
             if (preBoard.GetPreviewByWorldPoint(worldPoint))
             {
                 if (playerHand.Count != 5)
                 {
                     QuadMistCard item = preBoard.RemoveSelected();
                     playerHand.Add(item);
                     if (playerHand.Count == 5)
                     {
                         result.Used();
                         return;
                     }
                 }
                 else if (playerHand.Count == 5)
                 {
                     result.Used();
                     return;
                 }
             }
             Int32 lrbyWorldPoint = preBoard.GetLRByWorldPoint(worldPoint);
             if (lrbyWorldPoint == 1)
             {
                 preBoard.NextCard();
             }
             if (lrbyWorldPoint == -1)
             {
                 preBoard.PrevCard();
             }
         }
         Int32 indexByWorldPoint2 = playerHand.GetIndexByWorldPoint(worldPoint);
         if (indexByWorldPoint2 >= 0)
         {
             preBoard.Add(playerHand[indexByWorldPoint2]);
             playerHand.RemoveAt(indexByWorldPoint2);
         }
     }
 }
Exemple #3
0
 public abstract void HandlePreSelection(PreBoard preBoard, Hand hand, ref InputResult result);
Exemple #4
0
 public override void HandlePreSelection(PreBoard preBoard, Hand playerHand, ref InputResult result)
 {
     this.prevPreSelect = this.preSelect;
     if (this.preSelect == -1)
     {
         this.preSelect = 0;
     }
     if (UIManager.Input.GetKey(Control.Down) && this.preSelect % 10 != 9)
     {
         this.preSelect++;
     }
     if (UIManager.Input.GetKey(Control.Up) && this.preSelect % 10 != 0)
     {
         this.preSelect--;
     }
     if (UIManager.Input.GetKey(Control.Right) && this.preSelect / 10 != 9)
     {
         this.preSelect += 10;
     }
     if (UIManager.Input.GetKey(Control.Left) && this.preSelect / 10 != 0)
     {
         this.preSelect -= 10;
     }
     if (this.prevPreSelect != this.preSelect || !this.launched)
     {
         preBoard.SetPreviewCardID(this.preSelect);
         this.launched = true;
     }
     if (UIManager.Input.GetKey(Control.LeftBumper))
     {
         preBoard.PrevCard();
         SoundEffect.Play(QuadMistSoundID.MINI_SE_CARD_MOVE);
     }
     if (UIManager.Input.GetKey(Control.RightBumper))
     {
         preBoard.NextCard();
         SoundEffect.Play(QuadMistSoundID.MINI_SE_CARD_MOVE);
     }
     if (UIManager.Input.GetKey(Control.Confirm))
     {
         if (playerHand.Count != 5 && preBoard.CountSelected() > 0)
         {
             QuadMistCard item = preBoard.RemoveSelected();
             playerHand.Add(item);
             if (playerHand.Count == 5)
             {
                 result.Used();
                 this.launched = false;
                 return;
             }
         }
         else if (playerHand.Count == 5)
         {
             result.Used();
             this.launched = false;
             return;
         }
         if (QuadMistGame.main.CardNameDialogSlider.IsShowCardName)
         {
             QuadMistGame.main.CardNameDialogSlider.ShowCardNameDialog(playerHand);
         }
         else
         {
             QuadMistGame.main.CardNameDialogSlider.HideCardNameDialog(playerHand);
         }
     }
     else if (UIManager.Input.GetKey(Control.Cancel))
     {
         Int32 num = playerHand.Count - 1;
         if (num >= 0)
         {
             preBoard.Add(playerHand[num]);
             playerHand.RemoveAt(num);
         }
         SoundEffect.Play(QuadMistSoundID.MINI_SE_CANCEL);
     }
 }
Exemple #5
0
 public override void HandlePreSelection(PreBoard preBoard, Hand hand, ref InputResult result)
 {
     throw new NotImplementedException();
 }