コード例 #1
0
ファイル: Game.cs プロジェクト: ViniciusConsultor/mtg-online
 public Game()
 {
     GameState = _gamestate.None;
     TurnState = _turnstate.None;
     GameType = _gametype.None;
     HomeDeck = new MTGDeck();
     AwayDeck = new MTGDeck();
 }
コード例 #2
0
ファイル: Game.cs プロジェクト: ViniciusConsultor/mtg-online
 public Game(MTGClientForm form)
 {
     _form = form;
     GameState = _gamestate.None;
     TurnState = _turnstate.None;
     GameType = _gametype.None;
     HomeDeck = new MTGDeck();
     AwayDeck = new MTGDeck();
 }
コード例 #3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonGameSolitare_Click(object sender, EventArgs e)
        {
            // enable the game tab
            Gaming = true;
            EnableTabPages(false);
            EnableTabPages(true);

            // move tab focus to  the game tab
            tabControl1.SelectTab(4);

            // start the game!
            String DeckName = comboBoxDecks2.SelectedItem.ToString();
            ArrayList Cards = new ArrayList();

            MTGDeck Deck = new MTGDeck();
            Deck.Name = DeckName;

            foreach (Int32 cardnumber in Collection.Decks[DeckName])
            {
                MTGCard card = new MTGCard();
            
                foreach (MTGCard cardInfo in ((MTGCardSet)CardSets[0]).CardSet)
                {
                    if (cardInfo.ID == cardnumber)
                    {
                        card = cardInfo;
                        if (Cards.Contains(card))
                        {
                            // increment the quantity
                            Int32 index = Cards.IndexOf(card);
                            ((MTGCard)Cards[index]).Quantity += 1;
                        }
                        else
                        {
                            Cards.Add(card);
                        }                            
                        break;
                    }
                }
            }

            Deck.Cards = Cards;            

            CurrentGame = new Game(this);
            CurrentGame.AddPlayerDeck(Deck);
            CurrentGame.StartSolitareGame();

            Update();
        }
コード例 #4
0
ファイル: Game.cs プロジェクト: ViniciusConsultor/mtg-online
 public void AddPlayerDeck(MTGDeck deck)
 {
     HomeDeck = deck;
 }