示例#1
0
 public CombatActor(string name)
 {
     Name = name;
     DamageCausedStats      = new DamageCausedStats();
     ParryCounts            = new Parry();
     TargetPreferenceCounts = new TargetPreference();
     EvadedCounts           = new Evasion();
 }
示例#2
0
        string BuildDamageStats(DamageCausedStats damageCausedStats)
        {
            var aggregation = damageCausedStats.Attacks.GroupBy(attack => new { attack.Damage, attack.AttackType })
                              .Select(attacks =>
                                      new
            {
                DamageCaused   = attacks.Key.Damage,
                DamageType     = attacks.Key.AttackType,
                AttackStrength =
                    string.Join(", ",
                                attacks.GroupBy(attack => attack.Strength)
                                .Select(
                                    grouping =>
                                    grouping.Key + " x" + grouping.Count()))
            });

            return(string.Join(Environment.NewLine,
                               aggregation.Select(
                                   arg => string.Format("{0}: {1} ({2})", arg.DamageCaused, arg.AttackStrength, arg.DamageType))));
        }