コード例 #1
0
 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();
 }
コード例 #2
0
        /// <summary>
        /// 从左到右:水泵非驱动端到电机非驱动端为0,1,2,3
        /// </summary>
        private void ClassifySpecsBs()
        {
            BrPoses_Specs = new Spectrum[4][];
            for (int i = 0; i < 4; i++)
            {
                BrPoses_Specs[i] = new Spectrum[3];
            }

            BrPoses_Specs[0][0] = Specs.FirstOrDefault(s => s.Pos.IsPumpOutX);
            BrPoses_Specs[0][1] = Specs.FirstOrDefault(s => s.Pos.IsPumpOutY);
            BrPoses_Specs[0][2] = Specs.FirstOrDefault(s => s.Pos.IsPumpOutZ);

            BrPoses_Specs[1][0] = Specs.FirstOrDefault(s => s.Pos.IsPumpInX);
            BrPoses_Specs[1][1] = Specs.FirstOrDefault(s => s.Pos.IsPumpInY);
            BrPoses_Specs[1][2] = Specs.FirstOrDefault(s => s.Pos.IsPumpInZ);

            BrPoses_Specs[2][0] = Specs.FirstOrDefault(s => s.Pos.IsMotorInX);
            BrPoses_Specs[2][1] = Specs.FirstOrDefault(s => s.Pos.IsMotorInY);
            BrPoses_Specs[2][2] = Specs.FirstOrDefault(s => s.Pos.IsMotorInZ);

            BrPoses_Specs[3][0] = Specs.FirstOrDefault(s => s.Pos.IsMotorOutX);
            BrPoses_Specs[3][1] = Specs.FirstOrDefault(s => s.Pos.IsMotorOutY);
            BrPoses_Specs[3][2] = Specs.FirstOrDefault(s => s.Pos.IsMotorOutZ);
        }