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


C# Deck.FlipAllCards方法代码示例

本文整理汇总了C#中Deck.FlipAllCards方法的典型用法代码示例。如果您正苦于以下问题:C# Deck.FlipAllCards方法的具体用法?C# Deck.FlipAllCards怎么用?C# Deck.FlipAllCards使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Deck的用法示例。


在下文中一共展示了Deck.FlipAllCards方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: NewGame

        public void NewGame()
        {
            rowDecks = new List<Deck>();
            stackDecks = new List<Deck>();

            gameShape.Game = new Game();

            //Dealer
            dealer = new Deck(1, 13, gameShape.Game);
            dealer.Shuffle(5);
            dealer.FlipAllCards();
            dealer.EnableAllCards(false);
            dealer.MakeAllCardsDragable(false);
            dealer.Enabled = false;
            Dealer.Deck = dealer;
            gameShape.DeckShapes.Add(Dealer);
            Dealer.DeckMouseLeftButtonDown += new MouseButtonEventHandler(Dealer_DeckMouseLeftButtonDown);

            //Ground
            ground = new Deck(gameShape.Game);
            Ground.Deck = ground;
            Ground.UpdateCardShapes();
            gameShape.DeckShapes.Add(Ground);

            //Row Decks
            for (int i = 0; i < 7; i++)
            {
                Deck deck = new Deck(gameShape.Game);
                rowDecks.Add(deck);

                DeckShape deckShape = new DeckShape();
                gameShape.DeckShapes.Add(deckShape);
                deckShape.CardSpacerY = 20;
                deckShape.MaxCardsSpace = 10;
                deckShape.Deck = deck;

                this.LayoutRoot.Children.Add(deckShape);
                Canvas.SetLeft(deckShape, 25 + (i * 85));
                Canvas.SetTop(deckShape, 150);

                dealer.Draw(deck, i + 1);

                deck.TopCard.Visible = true;
                deck.TopCard.Enabled = true;
                deck.TopCard.IsDragable = true;
            }

            //Stack Decks
            for (int i = 0; i < 4; i++)
            {
                Deck deck = new Deck(gameShape.Game);
                stackDecks.Add(deck);

                DeckShape deckShape = new DeckShape();
                gameShape.DeckShapes.Add(deckShape);
                deckShape.CardSpacerY = 1;
                deckShape.MaxCardsSpace = 10;
                deckShape.Deck = deck;

                this.LayoutRoot.Children.Add(deckShape);
                Canvas.SetLeft(deckShape, 280 + (i * 85));
                Canvas.SetTop(deckShape, 24);
            }

            dealer.TopCard.Enabled = true;
            dealer.TopCard.IsDragable = false;
        }
开发者ID:Eric-Guo,项目名称:silverlight-cards-game,代码行数:67,代码来源:Page.xaml.cs


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