예제 #1
0
        private static Card getCard(MtgLayoutView view, HitInfo hitInfo)
        {
            if (!hitInfo.IsOverImage() && hitInfo.CustomButtonIndex < 0)
            {
                return(null);
            }

            var card = (Card)view.GetRow(hitInfo.RowHandle);

            return(card);
        }
예제 #2
0
        private static bool preload(List <Card> cardsToPreloadImage, MtgLayoutView view, int i)
        {
            if (i < 0 || i >= view.RowCount)
            {
                return(false);
            }

            int handle = view.GetVisibleRowHandle(i);
            var card   = (Card)view.GetRow(handle);

            if (card == null)
            {
                return(false);
            }

            cardsToPreloadImage.Add(card);
            return(true);
        }
예제 #3
0
        public Card GetCard(MtgLayoutView view, int rowHandle)
        {
            if (view == _layoutViewCards)
            {
                return((Card)view.GetRow(rowHandle));
            }

            if (view != _layoutViewDeck)
            {
                throw new ArgumentOutOfRangeException();
            }

            int visibleIndex = view.GetVisibleIndex(rowHandle);

            if (visibleIndex < 0)
            {
                return(null);
            }

            return(_deckEditorModel.GetVisibleCards()[visibleIndex]);
        }