public BodyScanPlanet(XScanClass scan, SystemBody sysbody, int sysbodyid, int id = 0) : base(scan, sysbody, sysbodyid, id)
        {
            XScanPlanet pscan = scan.Planet;

            PlanetClassId    = pscan.PlanetClassId;
            MassEM           = pscan.MassEM;
            SurfaceGravity   = pscan.SurfaceGravity;
            VolcanismId      = pscan.VolcanismId == 0 ? (byte?)null : pscan.VolcanismId;
            VolcanismMinor   = pscan.VolcanismMinor;
            VolcanismMajor   = pscan.VolcanismMajor;
            IsLandable       = pscan.HasLandable ? pscan.IsLandable : (bool?)null;
            HasComposition   = pscan.HasComposition;
            CompositionMetal = pscan.CompositionMetal;
            CompositionRock  = pscan.CompositionRock;
            CompositionIce   = pscan.CompositionIce;

            if (pscan.HasAtmosphere)
            {
                Atmosphere = new BodyScanAtmosphere(scan.Atmosphere, id);
            }

            if (pscan.HasMaterials)
            {
                Materials = new BodyScanMaterials(scan.Materials, id);
            }
        }
        public override List <CompareResult> GetDifferingProps(XScanClass scandata, List <CompareResult> diffs)
        {
            XModels.XScanPlanet pscan = scandata.Planet;
            base.GetDifferingProps(scandata, diffs);
            CompareResult.AddIfUnequal(diffs, this, "PlanetClassId", this.PlanetClassId, pscan.PlanetClassId);
            CompareResult.AddIfUnequal(diffs, this, "MassEM", this.MassEM, pscan.MassEM);
            CompareResult.AddIfUnequal(diffs, this, "SurfaceGravity", this.SurfaceGravity, pscan.SurfaceGravity);
            if (this.HasComposition && pscan.HasComposition)
            {
                CompareResult.AddIfUnequal(diffs, this, "CompositionMetal", this.CompositionMetal, pscan.CompositionMetal);
                CompareResult.AddIfUnequal(diffs, this, "CompositionRock", this.CompositionRock, pscan.CompositionRock);
                CompareResult.AddIfUnequal(diffs, this, "CompositionIce", this.CompositionIce, pscan.CompositionIce);
            }
            if (this.VolcanismId != null && pscan.VolcanismId != 0)
            {
                CompareResult.AddIfUnequal(diffs, this, "VolcanismId", this.VolcanismId, pscan.VolcanismId);
                CompareResult.AddIfUnequal(diffs, this, "VolcanismMajor", this.VolcanismMajor, pscan.VolcanismMajor);
                CompareResult.AddIfUnequal(diffs, this, "VolcanismMinor", this.VolcanismMinor, pscan.VolcanismMinor);
            }
            CompareResult.AddIfUnequal(diffs, this, "IsLandable", this.IsLandable, pscan.HasLandable ? (bool?)pscan.IsLandable : null);
            if (this.Atmosphere != null && pscan.HasAtmosphere)
            {
                this.Atmosphere.GetDifferingProps(scandata.Atmosphere, diffs, this);
            }
            if (this.Materials != null && pscan.HasMaterials)
            {
                this.Materials.GetDifferingProps(scandata.Materials, diffs, this);
            }

            return(diffs);
        }
Exemplo n.º 3
0
        public override List <CompareResult> GetDifferingProps(XScanClass scandata, List <CompareResult> diffs)
        {
            XModels.XScanStar sscan = scandata.Star;
            base.GetDifferingProps(scandata, diffs);
            CompareResult.AddIfUnequal(diffs, this, "AbsoluteMagnitude", this.AbsoluteMagnitude, sscan.AbsoluteMagnitude);
            CompareResult.AddIfUnequal(diffs, this, "StellarMass", this.StellarMass, sscan.StellarMass);
            CompareResult.AddIfUnequal(diffs, this, "Age_MY", this.Age_MY, sscan.Age_MY);
            CompareResult.AddIfUnequal(diffs, this, "StarTypeId", this.StarTypeId, sscan.StarTypeId);
            CompareResult.AddIfUnequal(diffs, this, "LuminosityId", this.LuminosityId, sscan.LuminosityId == 0 ? null : (byte?)sscan.LuminosityId);

            return(diffs);
        }