コード例 #1
0
 public void UpdateFootnote()
 {
     Footnote = LogFormatter.TranslateCardFootnote(_card.Log);
 }
コード例 #2
0
        public virtual void Update()
        {
            if (_card != null)
            {
                if (_uiCard != null && _uiCard.Id == _card.Id)
                {
                    return;
                }
                if (GameEngine.CardSet.Count > _card.Id && _card.Id >= 0)
                {
                    _uiCard = GameEngine.CardSet[_card.Id];
                }
                else
                {
                    _uiCard    = new Card();
                    _uiCard.Id = _card.Id;
                    if (_uiCard.Id == Card.UnknownCardId)
                    {
                        _uiCard.Type = new UnknownCardHandler();
                    }
                    else if (_uiCard.Id == Card.UnknownHeroId)
                    {
                        _uiCard.Type = new UnknownHeroCardHandler();
                    }
                    else if (_uiCard.Id == Card.UnknownRoleId)
                    {
                        _uiCard.Type = new UnknownRoleCardHandler();
                    }
                }

                var heroCard = _uiCard.Type as HeroCardHandler;
                if (heroCard != null)
                {
                    HeroModel = new HeroViewModel(heroCard.Hero);
                }
                else
                {
                    if (HeroModel != null)
                    {
                        HeroModel.Hero = null;
                    }
                    HeroModel = null;
                }

                if (_card.Log != null)
                {
                    Footnote = LogFormatter.TranslateCardFootnote(_card.Log);
                }
            }
            else
            {
                if (_uiCard == null)
                {
                    return;
                }
                _uiCard = null;
            }
            OnPropertyChanged("Id");
            OnPropertyChanged("IsKnownCard");
            OnPropertyChanged("Suit");
            OnPropertyChanged("SuitColor");
            OnPropertyChanged("ActualTypeString");
            OnPropertyChanged("RankString");
            OnPropertyChanged("ColoredRankString");
            OnPropertyChanged("TypeString");
            OnPropertyChanged("Category");
            OnPropertyChanged("AttackRange");
            OnPropertyChanged("HeroModel");
        }