示例#1
0
 private void HeroPowerPortret_MouseUp(object sender, MouseEventArgs e)
 {
     if (parent.MyMoveQ)
     {
         if (parent.hero.Parent.TryHeroPower(out var act))
         {
             act();
             center.ReBuild();
         }
     }
     else
     {
         VisualExceptions.NotMyMoveSelection("HeroPower");
     }
 }
        public void SelectMe(ISelectable s)
        {
            if (S1 == null)
            {
                S1 = s;
            }
            else if (S2 == null)
            {
                S2 = s;
            }
            else
            {
                S1 = null; S2 = null;
            }

            if (S1 != null)
            {
                if (S1.MyMoveQ)
                {
                    if (S1 == S2)
                    {
                        S1 = null; S2 = null;
                    }

                    if (S2 != null)
                    {
                        if ((!(S1.GetTarget is ITargetPlayCard)) && S1.MyMoveQ == S2.MyMoveQ)
                        {
                            S1 = s; S2 = null;
                        }
                    }
                }
                else
                {
                    VisualExceptions.NotMyMoveSelection(s.GetTarget.GetType().Name);
                    S1 = null;
                    S2 = null;
                }
            }

            InvokeSelection();
        }