static async Task <int> ShowUnitTable(IKTRulesContext db, Model unit) { Console.WriteLine($"\n== {unit.NameEn} =="); var table = new ConsoleTables.ConsoleTable("Name", "M", "WS", "BS", "S", "T", "W", "A", "Ld", "Sv", "Max"); foreach (var profile in unit.ModelProfiles) { table.AddRow( profile.NameEn, profile.Movement.ToString() + '"', profile.WeaponSkill.ToString() + '+', profile.BallisticSkill.ToString() + '+', profile.Strength, profile.Toughness, profile.Wounds, profile.Attacks, profile.Leadership, profile.Save.ToString() + '+', profile.MaximumNumber > 0 ? profile.MaximumNumber.ToString() : "-" ); } table.Configure(o => o.EnableCount = false); table.Write(); var weapons = unit.ModelWeapons.Select(w => w.Weapon.NameEn); Console.WriteLine($"This model is armed with: {string.Join(", ", weapons)}"); /* WARGEAR OPTIONS */ if (unit.WarGearOptions.Count > 0 || unit.ModelProfiles.Any(mp => mp.WarGearOptions.Count > 0)) { Console.WriteLine("\n=== Wargear Options ==="); foreach (var option in unit.WarGearOptions) { PrintWarGearOption(db, option); } foreach (var modelProfile in unit.ModelProfiles) { if (modelProfile.WarGearOptions.Count == 0) { continue; } Console.WriteLine($" - {modelProfile.NameEn}"); foreach (var option in modelProfile.WarGearOptions) { PrintWarGearOption(db, option); } } } /* ABILITIES */ Console.WriteLine("\n=== Abilities ==="); // faction abilities foreach (var ability in db.Factions.Where(f => f.Id == unit.FactionId).Include(f => f.Abilities).First().Abilities) { Console.WriteLine($"*{ability.NameEn}*: {ability.DescriptionEn}"); } // model abilities foreach (var ability in unit.Abilities) { Console.WriteLine($"*{ability.NameEn}*: {ability.DescriptionEn}"); } // model profile abilities foreach (var modelProfile in unit.ModelProfiles) { if (modelProfile.Abilities.Count == 0) { continue; } Console.WriteLine($" - {modelProfile.NameEn}"); foreach (var ability in modelProfile.Abilities) { Console.WriteLine($"*{ability.NameEn}*: {ability.DescriptionEn}"); } } /* PSYKER */ var psykers = unit.ModelProfiles.Where(mp => mp.NumberOfKnownPsychics > 0 || mp.NumberOfPsychicsManifestationPerRound > 0 || mp.NumberOfPsychicsDenialPerRound > 0); if (psykers.Count() > 0) { Console.WriteLine("\n=== Psyker ==="); foreach (var mp in psykers) { Console.WriteLine($"{mp.NameEn}: Cast {mp.NumberOfPsychicsManifestationPerRound}, Deny {mp.NumberOfPsychicsDenialPerRound}, Know {mp.NumberOfKnownPsychics}"); foreach (var psychic in mp.Psychics) { Console.WriteLine($" - {psychic.NameEn}"); } // TODO: psybolt? Or like, does everyone know that? } } /* SPECIALISTS */ Console.WriteLine("\n=== Specialists ==="); foreach (var mp in unit.ModelProfiles) { Console.WriteLine($"{mp.NameEn}: {string.Join(", ", mp.Specialists.Select(s => s.Specialist.NameEn))}"); } /* KEYWORDS */ Console.WriteLine("\n=== Keywords ==="); Console.WriteLine(unit.KeywordsEn); return(0); }