public ResultShipSpecs(BattleInfo battleInfo) { Specs = battleInfo.Result?.Friend.Main.Where(s => s.NowHp > 0).Select(ship => ship.Spec).ToArray() ?? new ShipSpec[0]; Names = new NameChecker(Specs); Types = Specs.Select(spec => spec.ShipType).ToArray(); Classes = Specs.Select(spec => spec.ShipClass).ToArray(); Flagship = Specs.FirstOrDefault(); FlagshipType = Types.FirstOrDefault(); }
public IEnumerable <SpecTestCase> GetSpecTestCases() { return(Specs.Select(spec => new SpecTestCase(this, spec)).ToList()); }