当前位置: 首页>>代码示例>>C#>>正文


C# Gui.CardsEventArgs类代码示例

本文整理汇总了C#中Octgn.Play.Gui.CardsEventArgs的典型用法代码示例。如果您正苦于以下问题:C# CardsEventArgs类的具体用法?C# CardsEventArgs怎么用?C# CardsEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CardsEventArgs类属于Octgn.Play.Gui命名空间,在下文中一共展示了CardsEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnCardOver

 protected virtual void OnCardOver(object sender, CardsEventArgs e)
 {
     e.Handled = e.CanDrop = true;
     e.Handler = this;
     switch (group.Visibility)
     {
         case GroupVisibility.Nobody:
             e.FaceUp = false;
             break;
         case GroupVisibility.Everybody:
             e.FaceUp = true;
             break;
         case GroupVisibility.Owner:
             e.FaceUp = group.Owner == Player.LocalPlayer;
             break;
         case GroupVisibility.Undefined:
             if (e.ClickedCard.Group != group)
                 e.FaceUp = null;
             else
                 e.FaceUp = e.ClickedCard.FaceUp;
             break;
         case GroupVisibility.Custom:
             e.FaceUp = group.Viewers.Contains(Player.LocalPlayer);
             break;
         default:
             throw new NotImplementedException("Unknown visibility : " + group.Visibility);
     }
 }
开发者ID:LordNat,项目名称:OCTGN,代码行数:28,代码来源:GroupControl.cs

示例2: OnCardOver

        protected override void OnCardOver(object sender, CardsEventArgs e)
        {
            base.OnCardOver(sender, e);
			for(var i = 0;i<e.Cards.Length;i++)
            {
                e.CardSizes[i] = new Size(cardsCtrl.ActualWidth, cardsCtrl.ActualHeight);
                if (cardsCtrl.ActualWidth > cardsCtrl.ActualHeight)
                {
                    e.CardSizes[i] = new Size(e.Cards[i].RealWidth*cardsCtrl.ActualHeight/e.Cards[i].RealHeight, cardsCtrl.ActualHeight);
                }
                else
                {
                    e.CardSizes[i] = new Size(cardsCtrl.ActualWidth, e.Cards[i].RealHeight * cardsCtrl.ActualWidth / e.Cards[i].RealWidth);
                }
            }

            if (bottomZone.Visibility != Visibility.Visible)
            {
                bottomZone.Visibility = Visibility.Visible;
                Anim.From = 0;
                Anim.To = 0.4;
                bottomZone.BeginAnimation(OpacityProperty, Anim);
                Anim.From = null;
            }
            else
            {
                Anim.To = 0.4;
                bottomZone.BeginAnimation(OpacityProperty, Anim);
            }
        }
开发者ID:Keterr,项目名称:OCTGN,代码行数:30,代码来源:PileControl.xaml.cs

示例3: OnCardDropped

 protected override void OnCardDropped(object sender, CardsEventArgs e)
 {
     e.Handled = e.CanDrop = true;
     if (group.TryToManipulate())
         foreach (Card c in e.Cards)
             c.MoveTo(group, e.FaceUp != null && e.FaceUp.Value, 0);
 }
开发者ID:haslo,项目名称:OCTGN,代码行数:7,代码来源:PileControl.xaml.cs

示例4: OnCardOver

 protected override void OnCardOver(object sender, CardsEventArgs e)
 {
     base.OnCardOver(sender, e);
     e.CardSize =
         new Size(
             100*Program.GameEngine.Definition.CardWidth/Program.GameEngine.Definition.CardHeight, 100);
     _fanPanel.DisplayInsertIndicator(e.ClickedCard, _fanPanel.GetIndexFromPoint(Mouse.GetPosition(_fanPanel)));
 }
开发者ID:sbarnabas,项目名称:OCTGN,代码行数:8,代码来源:HandControl.xaml.cs

示例5: OnCardOver

        protected override void OnCardOver(object sender, CardsEventArgs e)
        {
            base.OnCardOver(sender, e);
			for(var i = 0;i<e.Cards.Length;i++)
            {
                e.CardSizes[i] = new Size(e.Cards[i].RealWidth * 30 / e.Cards[i].RealHeight, 30);
            }
            //e.CardSize = new Size(30*group.Def.Width/group.Def.Height, 30);
        }
开发者ID:rexperalta,项目名称:OCTGN,代码行数:9,代码来源:PileCollapsedControl.xaml.cs

示例6: OnCardOver

 protected override void OnCardOver(object sender, CardsEventArgs e)
 {
     base.OnCardOver(sender, e);
     for(var i = 0;i<e.Cards.Length;i++)
     {
         e.CardSizes[i] = new Size(e.Cards[i].Size.Width * 100 / e.Cards[i].Size.Height, 100);
     }
     //e.CardSize = new Size(100 * Program.GameEngine.Definition.DefaultSize.Width / Program.GameEngine.Definition.DefaultSize.Height, 100);
     _fanPanel.DisplayInsertIndicator(e.ClickedCard, _fanPanel.GetIndexFromPoint(Mouse.GetPosition(_fanPanel)));
 }
开发者ID:digitalalchemy,项目名称:OCTGN,代码行数:10,代码来源:HandControl.xaml.cs

示例7: OnCardDropped

 protected override void OnCardDropped(object sender, CardsEventArgs e)
 {
     e.Handled = e.CanDrop = true;
     if (group.CanManipulate())
     {
         var cards = e.Cards.ToArray();
         Card.MoveCardsTo(group, cards, 
             Enumerable.Repeat(e.FaceUp ?? false,cards.Length).ToArray()
             ,Enumerable.Repeat(0,cards.Length).ToArray(),false);
     }
     //foreach (Card c in e.Cards)
     //    c.MoveTo(group, e.FaceUp != null && e.FaceUp.Value, 0, false);
 }
开发者ID:Keterr,项目名称:OCTGN,代码行数:13,代码来源:AdhocPileControl.xaml.cs

示例8: OnCardDropped

 protected override void OnCardDropped(object sender, CardsEventArgs e)
 {
     e.Handled = e.CanDrop = true;
      if (group.TryToManipulate())
      {
     int idx = fanPanel.GetIndexFromPoint(Mouse.GetPosition(fanPanel));
     foreach (Card c in e.Cards)
     {
       bool doNotIncrement = (c.Group == group && group.GetCardIndex(c) < idx);
       c.MoveTo(group, e.FaceUp.Value, idx);
       if (!doNotIncrement) idx++;
     }
      }
 }
开发者ID:kellyelton,项目名称:octgnwlobby,代码行数:14,代码来源:HandControl.xaml.cs

示例9: OnCardDropped

 protected override void OnCardDropped(object sender, CardsEventArgs e)
 {
     e.Handled = e.CanDrop = true;
     if ([email protected]()) return;
     int idx = _fanPanel.GetIndexFromPoint(Mouse.GetPosition(_fanPanel));
     foreach (Card c in e.Cards)
     {
         bool doNotIncrement = (c.Group == @group && @group.GetCardIndex(c) < idx);
         c.MoveTo(@group, e.FaceUp != null && e.FaceUp.Value, idx,false);
         // Fix: some cards (notably copies like token) may be deleted when they change group
         // in those case we should increment idx, otherwise an IndexOutOfRange exception may occur
         if (c.Group != @group)
             doNotIncrement = true;
         if (!doNotIncrement) idx++;
     }
 }
开发者ID:sbarnabas,项目名称:OCTGN,代码行数:16,代码来源:HandControl.xaml.cs

示例10: OnCardOver

        protected override void OnCardOver(object sender, CardsEventArgs e)
        {
            base.OnCardOver(sender, e);
             e.CardSize = new Size(cardsCtrl.ActualWidth, cardsCtrl.ActualHeight);

             if (bottomZone.Visibility != Visibility.Visible)
             {
            bottomZone.Visibility = Visibility.Visible;
            anim.From = 0; anim.To = 0.4;
            bottomZone.BeginAnimation(OpacityProperty, anim);
            anim.From = null;
             }
             else
             {
            anim.To = 0.4;
            bottomZone.BeginAnimation(OpacityProperty, anim);
             }
        }
开发者ID:kellyelton,项目名称:octgnwlobby,代码行数:18,代码来源:PileControl.xaml.cs

示例11: OnCardOut

 protected override void OnCardOut(object sender, CardsEventArgs e)
 {
     bottomZone.Visibility = Visibility.Collapsed;
 }
开发者ID:Keterr,项目名称:OCTGN,代码行数:4,代码来源:PileControl.xaml.cs

示例12: OnCardDroppedBottom

 private void OnCardDroppedBottom(object sender, CardsEventArgs e)
 {
     e.Handled = e.CanDrop = true;
     //if (group.TryToManipulate())
     //    foreach (Card c in e.Cards)
     //        c.MoveTo(group, e.FaceUp != null && e.FaceUp.Value, group.Count,false);
     if (group.CanManipulate())
     {
         var cards = e.Cards.ToArray();
         Card.MoveCardsTo(group, cards, 
             Enumerable.Repeat(e.FaceUp ?? false,cards.Length).ToArray()
             ,Enumerable.Range(group.Count,cards.Length).ToArray(),false);
     }
 }
开发者ID:Keterr,项目名称:OCTGN,代码行数:14,代码来源:PileControl.xaml.cs

示例13: OnCardOverBottom

 private void OnCardOverBottom(object sender, CardsEventArgs e)
 {
     OnCardOver(sender, e);
     Anim.To = 0.8;
     bottomZone.BeginAnimation(OpacityProperty, Anim);
 }
开发者ID:Keterr,项目名称:OCTGN,代码行数:6,代码来源:PileControl.xaml.cs

示例14: OnCardDropped

 protected virtual void OnCardDropped(object sender, CardsEventArgs e)
 {
     // The method cannot be abstract, because abstract classes can't be named in XAML (e.g. TableControl.xaml)
     throw new NotImplementedException("OnCardDropped must be overriden");
 }
开发者ID:jonbonne,项目名称:OCTGN,代码行数:5,代码来源:GroupControl.cs

示例15: OnCardDropped

        protected override void OnCardDropped(object sender, CardsEventArgs e)
        {
            // Drop is forbidden when not ordered by position
            if (SortByName)
            {
                e.Handled = true;
                e.CanDrop = false;
                return;
            }

            // When the list is restricted to some cards only,
            // one cannot drop cards from outside this list
            if (RestrictDrop && !e.Cards.All(c => Cards.Contains(c)))
            {
                e.Handled = true;
                e.CanDrop = false;
                return;
            }

            StopDragScroll();
            e.Handled = e.CanDrop = true;
            if ([email protected]()) return;
            int idx = _wrapPanel.GetIndexFromPoint(Mouse.GetPosition(_wrapPanel));

            // When the list is restricted, real index may be different from index in the GUI
            if (RestrictDrop)
            {
                Card c = null;
                bool after = false;
                if (idx < _view.Count)
                    c = (Card) _view.GetItemAt(idx);
                else if (_view.Count > 0)
                {
                    c = (Card) _view.GetItemAt(_view.Count - 1);
                    after = true;
                }

                if (c != null) idx = @group.Cards.IndexOf(c) + (after ? 1 : 0);
            }

            foreach (Card c in e.Cards)
            {
                // Fix the target index if the card is already in the group at a lower index
                if (c.Group == @group && c.GetIndex() < idx) --idx;
                c.MoveTo(@group, e.FaceUp != null && e.FaceUp.Value, idx++);
            }
        }
开发者ID:0M3G4,项目名称:OCTGN,代码行数:47,代码来源:CardListControl.xaml.cs


注:本文中的Octgn.Play.Gui.CardsEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。