예제 #1
0
 /// <summary>
 /// Receives notification that expedition deck was updated
 /// </summary>
 /// <param name="cards">Updated set</param>
 public void OnExpeditionDeckUpdated(List <CardWithCount> cards)
 {
     if (CurrentExpedition.State == "Picking" || CurrentExpedition.State == "Swapping" || CurrentExpedition.State == "Other")
     {
         PlayerActiveDeckWindow.Title = string.Format("Expedition {0}-{1}{2}", CurrentExpedition.NumberOfWins,
                                                      CurrentExpedition.NumberOfLosses, CurrentExpedition.IsEliminationGame ? "*" : "");
         PlayerActiveDeckWindow.SetFullDeck(CurrentExpedition.Cards);
         PlayerActiveDeckWindow.SetCurrentDeck(CurrentExpedition.Cards);
     }
     else if (CurrentPlayState.GameState != "InProgress")
     {
         PlayerActiveDeckWindow.Title = string.Format("No Active Deck");
         PlayerActiveDeckWindow.SetFullDeck(new List <CardWithCount>());
     }
 }
예제 #2
0
 /// <summary>
 /// Receives notification that player deck was set
 /// </summary>
 /// <param name="cards">Deck contents</param>
 /// <param name="name">Deck name</param>
 public void OnPlayerDeckSet(List <CardWithCount> cards, string name)
 {
     if (cards.Count > 0)
     {
         PlayerActiveDeckWindow.Title = name;
         PlayerActiveDeckWindow.SetFullDeck(cards);
         PlayerActiveDeckWindow.SetCurrentDeck(cards);
         PlayerDrawnCardsWindow.SetFullDeck(new List <CardWithCount>());
         PlayerGraveyardWindow.SetFullDeck(new List <CardWithCount>());
         OpponentGraveyardWindow.SetFullDeck(new List <CardWithCount>());
     }
     else
     {
         string title = "No Active Deck";
         PlayerActiveDeckWindow.Title = title;
         PlayerActiveDeckWindow.SetFullDeck(new List <CardWithCount>());
         PlayerDrawnCardsWindow.SetFullDeck(new List <CardWithCount>());
         PlayerGraveyardWindow.SetFullDeck(new List <CardWithCount>());
         OpponentGraveyardWindow.SetFullDeck(new List <CardWithCount>());
     }
 }
예제 #3
0
        private void HighlightCell(Point cellIndex)
        {
            if (HighlightedCell != cellIndex)
            {
                if (HighlightedCell.Y != cellIndex.Y)
                {
                    // Invalidate old row
                    if (HighlightedCell.Y >= 0)
                    {
                        Invalidate(GetCellRectangle(-1, HighlightedCell.Y));
                    }
                    // Invalidate new row
                    if (cellIndex.Y >= 0)
                    {
                        Invalidate(GetCellRectangle(-1, cellIndex.Y));
                    }
                }
                if (PopupDeckWindow.Visible && !PopupDeckWindow.DesktopBounds.Contains(PointToScreen(MousePosition)))
                {
                    PopupDeckWindow.Hide();
                }
                HighlightedCell = cellIndex;
                if (HighlightedCell.X != -1)
                {
                    Rectangle cellRectangle = GameTextRectangles[HighlightedCell.Y + 1][HighlightedCell.X];

                    if (Columns[HighlightedCell.X].Title == "My Deck" || Columns[HighlightedCell.X].Title == "Opponent")
                    {
                        List <CardWithCount> deck = (Columns[HighlightedCell.X].Title == "Opponent") ? Games[HighlightedCell.Y].OpponentDeck : Games[HighlightedCell.Y].MyDeck;

                        if (deck.Count > 0)
                        {
                            PopupDeckWindow.SetFullDeck(deck);
                            Point pos = PointToScreen(new Point(cellRectangle.Right, cellRectangle.Top));
                            PopupDeckWindow.SetBounds(pos.X, pos.Y, 0, 0);
                            Utilities.ShowInactiveTopmost(PopupDeckWindow);
                            PopupDeckWindow.UpdateSize();
                        }
                    }
                }
            }
        }