コード例 #1
0
        public PromptCard(CardDatabase cardDatabase)
        {
            InitializeComponent();

            this.cardDatabase = cardDatabase;
            this.Width        = Settings.CARD_WIDTH;
            this.Height       = Settings.CARD_HEIGHT + 20;
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: aeshirey/CAHCore
        private void StartNewGame_Click(object sender, RoutedEventArgs e)
        {
            Decks decksToUse = (Decks)0;

            for (int i = 0; i < Card.NUM_DECKS_AVAILABLE; i++)
            {
                var mi = FileDecks.Items[i] as MenuItem;
                if (mi.IsChecked)
                {
                    var deck = (Decks)mi.Tag;
                    decksToUse |= deck;
                }
            }

            this.selectedCard = null;
            this.cardDatabase = new CardDatabase(decksToUse);
            this.HandOfCards  = Enumerable
                                .Range(0, HandSize)
                                .Select(i => cardDatabase.GetCard(CardType.ResponseWhite))
                                .ToList();

            Utility.DrawHand(canvas, this.HandOfCards);
        }