public void ParamCtor_TakesNameAndClass() { var r = new ArchetypeRecord("Control", PlayerClass.MAGE); Assert.That(r.Name, Is.EqualTo("Control")); Assert.That(r.Klass, Is.EqualTo(PlayerClass.MAGE)); }
public static IEnumerable <ArchetypeRecord> GetArchetypeStats(List <Game> games) { var stats = new List <ArchetypeRecord>(); var lookup = new Dictionary <string, ArchetypeRecord>(); foreach (var g in games) { // if opponent class is missing skip game if (g.OpponentClass == PlayerClass.ALL) { EndGame.Logger.Info($"Skipping game {g.Id}, no opponent class"); continue; } // create an index for the archetype including class string index = string.Empty; string name = ArchetypeRecord.DefaultName; if (g.Note.HasArchetype) { name = g.Note.Archetype; } else if (!EndGame.Settings.Get(Strings.IncludeUnknown).Bool) { // if we don't want to include unknown archetypes skip game continue; } index = $"{name}.{g.OpponentClass}"; // update an existing record or add a new one if (!lookup.ContainsKey(index)) { lookup[index] = new ArchetypeRecord(name, g.OpponentClass); } lookup[index].Update(g.Result); } if (lookup.Count > 0) { stats.AddRange(lookup.Values.ToList()); } return(stats); }
public void Setup() { record = new ArchetypeRecord(); }