コード例 #1
0
        public void Addition()
        {
            ChampionStatsInfo champion = new ChampionStatsInfo();

            champion.Armor = 15;
            ItemStatsInfo item = new ItemStatsInfo();

            item.Armor = 22;
            CombinedStatsInfo info = champion + item;

            Assert.IsTrue(info.Stats[0].Armor == 37, string.Format("Armor addition resulted in '{0}' instead of the expected value of '{1}'", info.Stats[0].Armor, 15 + 22));
        }
コード例 #2
0
 private void FireUpdate(string name)
 {
     this.stats = new CombinedStatsInfo();
     if (this.Champion != null)
     {
         this.stats += this.Champion.Stats;
     }
     foreach (ItemInfo item in this.Items.Where(i => i != null))
     {
         this.stats += item.Stats;
     }
     if (this.BuildChanged != null)
     {
         this.BuildChanged(name);
     }
     return;
 }