public void Deinit() { // Environment StaticAirTemperature.Remove(); StaticPressure.Remove(); // Orbit Apoapsis.Remove(); Periapsis.Remove(); TimeToApoapsis.Remove(); // Vessel Altitude.Remove(); AngularVelocity.Remove(); AvailablePosTorque.Remove(); AvailableRCSForce.Remove(); AvailableThrust.Remove(); AvailableTorque.Remove(); Direction.Remove(); DryMass.Remove(); Forward.Remove(); Mass.Remove(); MaxVacuumThrust.Remove(); MomentOfInertia.Remove(); Position.Remove(); Right.Remove(); Thrust.Remove(); Up.Remove(); VacuumSpecificImpulse.Remove(); Velocity.Remove(); }
private void DrawAltitudeScale(float rightScaleLeft, RectangleF screenRect, float middleY, Graphics g) { var middleText = rightScaleLeft + 27; var value = Altitude.ToString(AltitudeFormat); var size = g.MeasureString(value, ScaleFontBig); var normalBrush = new SolidBrush(ScaleNormalColor); g.DrawString(value, ScaleFontBig, normalBrush, middleText - size.Width / 2.0f, middleY - size.Height / 2.0f); var counter = 1; var normalPen = new Pen(ScaleNormalColor); for (float up = middleY - 30, down = middleY + 30; up > screenRect.Top + 20; up -= 25, down += 25, counter++) { var valUp = Altitude + counter * AltitudeStep; var valDown = Altitude - counter * AltitudeStep; var sUp = valUp.ToString(AltitudeFormat); var sDown = valDown.ToString(AltitudeFormat); var sizeUp = g.MeasureString(sUp, ScaleFontSmall); var sizeDown = g.MeasureString(sDown, ScaleFontSmall); g.DrawString(sUp, ScaleFontSmall, normalBrush, middleText - sizeUp.Width / 2.0f + 3, up - sizeUp.Height / 2.0f); g.DrawString(sDown, ScaleFontSmall, normalBrush, middleText - sizeDown.Width / 2.0f + 3, down - sizeDown.Height / 2.0f); g.DrawLine(normalPen, rightScaleLeft + 12, up, rightScaleLeft + 15, up); g.DrawLine(normalPen, rightScaleLeft + 12, down, rightScaleLeft + 15, down); } }
private void DisplayRefresh(object sender, EventArgs e) { double TimeElapse = (DateTime.Now - TimeStart).TotalMilliseconds / 1000; label34.Text = DateTime.Now.ToLongTimeString() + "\r\n" + ChipTime[0].ToString() + "-" + ChipTime[1].ToString() + "-" + ChipTime[2].ToString() + "\r\n" + ChipTime[3].ToString() + ":" + ChipTime[4].ToString() + ":" + ChipTime[5].ToString() + "." + ChipTime[6].ToString() + "\r\n" + TimeElapse.ToString("f3") + "\r\n\r\n" + a[0].ToString("f2") + " g\r\n" + a[1].ToString("f2") + " g\r\n" + a[2].ToString("f2") + " g\r\n\r\n" + w[0].ToString("f2") + " °/s\r\n" + w[1].ToString("f2") + " °/s\r\n" + w[2].ToString("f2") + " °/s\r\n\r\n" + Angle[0].ToString("f2") + " °\r\n" + Angle[1].ToString("f2") + " °\r\n" + Angle[2].ToString("f2") + " °\r\n\r\n" + h[0].ToString("f0") + " mG\r\n" + h[1].ToString("f0") + " mG\r\n" + h[2].ToString("f0") + " mG\r\n\r\n" + Temperature.ToString("f2") + " ℃\r\n" + Pressure.ToString("f0") + " Pa\r\n" + Altitude.ToString("f2") + " m\r\n\r\n" + (Longitude / 10000000).ToString("f0") + "°" + ((double)(Longitude % 10000000) / 1e5).ToString("f5") + "'\r\n" + (Latitude / 10000000).ToString("f0") + "°" + ((double)(Latitude % 10000000) / 1e5).ToString("f5") + "'\r\n" + GPSHeight.ToString("f1") + " m\r\n" + GPSYaw.ToString("f1") + " °\r\n" + GroundVelocity.ToString("f3") + " km/h"; }
private static List <EdgeAggregator> InstantiateToAltitude(Triangle triangle, Perpendicular perp, GroundedClause original) { List <EdgeAggregator> newGrounded = new List <EdgeAggregator>(); // Acquire the side of the triangle containing the intersection point // This point may or may not be directly on the triangle side Segment baseSegment = triangle.GetSegmentWithPointOnOrExtends(perp.intersect); if (baseSegment == null) { return(newGrounded); } // The altitude must pass through the intersection point as well as the opposing vertex Point oppositeVertex = triangle.OtherPoint(baseSegment); Segment altitude = new Segment(perp.intersect, oppositeVertex); // The alitude must alig with the intersection if (!perp.ImpliesRay(altitude)) { return(newGrounded); } // The opposing side must align with the intersection if (!perp.OtherSegment(altitude).IsCollinearWith(baseSegment)) { return(newGrounded); } // // Create the new Altitude object // Altitude newAltitude = new Altitude(triangle, altitude); // For hypergraph List <GroundedClause> antecedent = new List <GroundedClause>(); antecedent.Add(triangle); antecedent.Add(original); newGrounded.Add(new EdgeAggregator(antecedent, newAltitude, annotation)); // // Check if this induces a second altitude for a right triangle (although we don't know this is a strengthened triangle) // The intersection must be on the vertex of the triangle if (triangle.HasPoint(perp.intersect)) { Angle possRightAngle = new Angle(triangle.OtherPoint(new Segment(perp.intersect, oppositeVertex)), perp.intersect, oppositeVertex); if (triangle.HasAngle(possRightAngle)) { Altitude secondAltitude = new Altitude(triangle, new Segment(perp.intersect, oppositeVertex)); newGrounded.Add(new EdgeAggregator(antecedent, secondAltitude, annotation)); } } return(newGrounded); }
/// <summary> /// Create a new abstract shape. /// </summary> /// <param name="Id">The Id of the shape.</param> /// <param name="Latitude">The latitude of the shape center.</param> /// <param name="Longitude">The longitude of the shape center.</param> /// <param name="Altitude">The altitude of the shape center.</param> /// <param name="GeoWidth">The geographical width of the shape center.</param> /// <param name="GeoHeight">The geographical height of the shape center.</param> public AShape(String[] Geometries, Latitude Latitude, Longitude Longitude, Altitude Altitude, Latitude Latitude2, Longitude Longitude2, Color StrokeColor, Double StrokeThickness, Color FillColor) { this.Id = Id; this.Latitude = Latitude; this.Longitude = Longitude; this.Altitude = Altitude; this.Latitude2 = Latitude2; this.Longitude2 = Longitude2; var PathGeometry16 = PathGeometry.Parse(Geometries[8]); var GD16 = new GeometryDrawing(new SolidColorBrush(FillColor), new Pen(new SolidColorBrush(StrokeColor), StrokeThickness), PathGeometry16); var DrawingGroup = new DrawingGroup(); DrawingGroup.Children.Add(GD16); this.Fill = new DrawingBrush() { Drawing = DrawingGroup, //Viewport = new Rect(0, 0, 1, 1), TileMode = TileMode.None, Stretch = Stretch.UniformToFill }; Bounds = DrawingGroup.Bounds; var w = Bounds.Width; var h = Bounds.Height; }
/// <summary> /// Returns height from altitude object /// </summary> /// <param name="altitude">altitude object</param> /// <returns>height value</returns> private static double HeightFromAltitude(Altitude altitude) { switch (altitude.Type) { case AltitudeType.GND: return(0.0); case AltitudeType.Unlimited: return(UnlimitedAltitudeHeightInMeter); case AltitudeType.Textual: return(UnlimitedAltitudeHeightInMeter); case AltitudeType.AMSL: case AltitudeType.AGL: return(altitude.Value * Constants.FactorFeetToMeter); case AltitudeType.FlightLevel: return(altitude.Value * 100.0 * Constants.FactorFeetToMeter); default: Debug.Assert(false, "invalid altitude type"); break; } return(0.0); }
public SquadStaticData( string name, int productionCost, SquadMovementType movementType, Altitude altitude, int movementPointsDefault, int fuelDefault, int visionDefault, int minRangeDefault, int maxRangeDefault, int ammoDefault, List <Ability> abilities) //TODO: expand this { this.name = name; this.productionCost = productionCost; this.movementType = movementType; this.altitude = altitude; this.movementPointsDefault = movementPointsDefault; this.fuelDefault = fuelDefault; this.visionDefault = visionDefault; this.minRangeDefault = minRangeDefault; this.maxRangeDefault = maxRangeDefault; this.ammoDefault = ammoDefault; this.abilities = abilities; }
private void GoToLatLong_Load(object sender, System.EventArgs e) { Dictionary <string, DataSet> datasets = DataSetManager.GetDataSets(); foreach (DataSet d in datasets.Values) { if (d.Sky == sky) { this.DataSetList.Items.Add(d); } } this.DataSetList.SelectedIndex = lastSelectedDatasetIndex; this.Categorys.SelectedIndex = lastSelectedIndexCatagorys; this.txtLat.Text = Latitude.ToString(); this.txtLong.Text = Longitude.ToString(); this.txtName.Text = LocationName; this.txtAltitude.Text = Altitude.ToString(); if (sky) { this.lblLatitude.Text = Language.GetLocalizedText(262, "Declination"); this.lblLongitude.Text = Language.GetLocalizedText(263, "Right Ascension"); } this.txtLat.Text = Coordinates.FormatDMS(Latitude); this.txtLong.Text = Coordinates.FormatDMS(Longitude); if (Earth3d.MainWindow.CurrentImageSet.DataSetType == ImageSetType.Earth) { FromEarthView.Visible = true; } }
public override int GetHashCode() { return(Duration.GetHashCode() ^ Altitude.GetHashCode() ^ Pitch.GetHashCode() ^ HeadingStep.GetHashCode()); }
private void InitializeModules() { modules = new List <IInfoModule>(); peri = new Periapsis("Periapsis", currentVessel); apo = new Apoapsis("Apoapsis", currentVessel); sma = new SemiMajorAxis("Semi-Major Axis", currentVessel); ecc = new Eccentricity("Eccentricity", currentVessel); inc = new Inclination("Inclination", currentVessel); alt = new Altitude("Current Altitude", currentVessel); vel = new Velocity("Current Speed", currentVessel); acc = new Acceleration("Current Acceleration", currentVessel); peri.IsVisible = PTGUI_Settings.Instance.showPeriapsis; apo.IsVisible = PTGUI_Settings.Instance.showApoapsis; sma.IsVisible = PTGUI_Settings.Instance.showSMA; ecc.IsVisible = PTGUI_Settings.Instance.showApoapsis; inc.IsVisible = PTGUI_Settings.Instance.showInclination; alt.IsVisible = PTGUI_Settings.Instance.showAltitude; vel.IsVisible = PTGUI_Settings.Instance.showVelocity; acc.IsVisible = PTGUI_Settings.Instance.showAcceleration; modules.Add(peri); modules.Add(apo); modules.Add(sma); modules.Add(ecc); modules.Add(inc); modules.Add(alt); modules.Add(vel); modules.Add(acc); }
public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("Lokalizacja stacji: " + City + " " + "\n"); sb.Append(Math.Abs(Latitude)); if (Latitude >= 0) { sb.AppendLine("°N"); } else { sb.AppendLine("°S"); } sb.Append(Math.Abs(Longitude)); if (Longitude >= 0) { sb.AppendLine("°E"); } else { sb.AppendLine("°W"); } sb.Append("Altitude: "); sb.Append(Altitude.ToString()); sb.AppendLine("m"); return(sb.ToString()); }
/* ---------- Public methods ----------------------------------------------------------/**/ /// <summary> /// Returns a hash code for this instance. /// </summary> /// <returns> /// A hash code for this instance, suitable for use in hashing algorithms and data /// structures like a hash table. /// </returns> /// <remarks> /// The hash code generation process ignores properties <see cref="Checksum1" />, /// <see cref="Checksum2" /> and <see cref="NcomPacket.Checksum3" />, since they are not /// used when testing for equality. /// </remarks> public override int GetHashCode() { int hash = 13; int mul = 7; hash = (hash * mul) + base.GetHashCode(); hash = (hash * mul) + Time.GetHashCode(); hash = (hash * mul) + AccelerationX.GetHashCode(); hash = (hash * mul) + AccelerationY.GetHashCode(); hash = (hash * mul) + AccelerationZ.GetHashCode(); hash = (hash * mul) + AngularRateX.GetHashCode(); hash = (hash * mul) + AngularRateY.GetHashCode(); hash = (hash * mul) + AngularRateZ.GetHashCode(); hash = (hash * mul) + Latitude.GetHashCode(); hash = (hash * mul) + Longitude.GetHashCode(); hash = (hash * mul) + Altitude.GetHashCode(); hash = (hash * mul) + NorthVelocity.GetHashCode(); hash = (hash * mul) + EastVelocity.GetHashCode(); hash = (hash * mul) + DownVelocity.GetHashCode(); hash = (hash * mul) + Heading.GetHashCode(); hash = (hash * mul) + Pitch.GetHashCode(); hash = (hash * mul) + Roll.GetHashCode(); hash = (hash * mul) + (StatusChannel != null ? StatusChannel.GetHashCode() : 0); return(hash); }
public override int GetHashCode() { unchecked { return((Azimuth.GetHashCode() * 397) ^ Altitude.GetHashCode()); } }
/// <inheritdoc /> public bool Equals(StatusEvent other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(Flags == other.Flags && CheckPips(Pips, other.Pips) && FireGroup == other.FireGroup && GuiFocus == other.GuiFocus && Equals(Fuel, other.Fuel) && LegalState == other.LegalState && Cargo == other.Cargo && Latitude.Equals(other.Latitude) && Altitude.Equals(other.Altitude) && Longitude.Equals(other.Longitude) && Heading.Equals(other.Heading) && BodyName == other.BodyName && PlanetRadius.Equals(other.PlanetRadius)); }
public int CompareTo(LatLngPoint other) { if (other is null) { return(-1); } else { var byLat = Latitude.CompareTo(other.Latitude); var byLng = Longitude.CompareTo(other.Longitude); var byAlt = Altitude.CompareTo(other.Altitude); if (byLat == 0 && byLng == 0) { return(byAlt); } else if (byLat == 0) { return(byLng); } else { return(byLat); } } }
public override int GetHashCode() { int hash = 1; if (header_ != null) { hash ^= Header.GetHashCode(); } if (Latitude != 0D) { hash ^= Latitude.GetHashCode(); } if (Longitude != 0D) { hash ^= Longitude.GetHashCode(); } if (Altitude != 0D) { hash ^= Altitude.GetHashCode(); } if (status_ != null) { hash ^= Status.GetHashCode(); } return(hash); }
/// <summary> /// Create a new geographical coordinate or position on a map. /// </summary> /// <param name="Latitude">The Latitude (south to nord).</param> /// <param name="Longitude">The Longitude (parallel to equator).</param> /// <param name="Altitude">The (optional) Altitude.</param> /// <param name="Name">An optional name for this geo location.</param> public AdditionalGeoLocation(Latitude Latitude, Longitude Longitude, Altitude? Altitude = null, I18NString Name = null) { this.Name = Name != null ? Name : new I18NString(); }
/// <summary> /// receive parsed gat /// </summary> /// <param name="altitude"></param> private void OnAltitudeComplete(Altitude altitude) { //TODO //var gl = Renderer.getContext(); //GridSelector.init(gl); altitudeCompleted = true; }
public void ThenTheDensityAltitudeShouldBe(String densityAltitude, String densityAltitudeUnits) { DensityAltitudeApplicationTester densityAltitudeApplicationTester = new DensityAltitudeApplicationTester(browser, application, elevation, temperature, altimeter, dewPoint); Altitude densityAltitudeResult = densityAltitudeApplicationTester.densityAltitudeResult(densityAltitudeUnits); Altitude densityAltitudeExpected = new Altitude(densityAltitude, densityAltitudeUnits); Assert.Equal(densityAltitudeExpected.ToString(), densityAltitudeResult.ToString()); }
/// <summary> /// Returns the hash code for this instance /// </summary> public override int GetHashCode() { var hash = 397 ^ Latitude.GetHashCode(); hash = (hash * 397) ^ Longitude.GetHashCode(); hash = (hash * 397) ^ Altitude.GetValueOrDefault().GetHashCode(); return(hash); }
public override string ToString() { return(base.ToString() + "\n" + "Position:\n" + "\tFormat:\t\t" + (IsOddFormat?"odd":"even") + "\tHas position:\t" + (HasValidPosition? "[Lat=" + CPREncodedLat.ToString("F8") + ",Lon=" + CPREncodedLon.ToString("F8") + "]" :"no") + "\tHas altitude:\t" + (HasValidAltitude? "[Alt=" + Altitude.ToString("F8") + "]" :"no")); }
public TerrainStaticData(string name /*, TODO: icon */, int defense, Altitude altitude, Capturable isCapturable) { this.name = name; //this.icon = icon; this.defense = defense; this.altitude = altitude; this.isCapturable = isCapturable; }
/// <summary> /// Helper function for autoWall() /// </summary> /// <param name="altitude">its altitude why the f**k can't you figure this out yourself</param> /// <returns></returns> private bool isDifferent(Altitude altitude) { if (altitude == Altitude.unassigned) { return(true); } return(altitude != type.gameplayData.altitude ? true : false); }
public static List <EdgeAggregator> InstantiateRight(RightTriangle rt, Altitude altitude, GroundedClause original) { List <EdgeAggregator> newGrounded = new List <EdgeAggregator>(); // The altitude must connect the vertex defining the right angle and the opposite side. if (!altitude.segment.HasPoint(rt.rightAngle.GetVertex())) { return(newGrounded); } // The other point of the altitude must lie on the opposite side of the triangle Point altPointOppRightAngle = altitude.segment.OtherPoint(rt.rightAngle.GetVertex()); Segment oppositeSide = rt.GetOppositeSide(rt.rightAngle); if (!Segment.Between(altPointOppRightAngle, oppositeSide.Point1, oppositeSide.Point2)) { return(newGrounded); } // // Find the two smaller right triangles in the candidate list (which should be in the list at this point) // RightTriangle first = null; RightTriangle second = null; foreach (RightTriangle smallerRT in candRightTriangles) { if (smallerRT.IsDefinedBy(rt, altitude)) { if (first == null) { first = smallerRT; } else { second = smallerRT; break; } } } // CTA: We did not check to see points aligned, but these are the original triangles from the figure GeometricSimilarTriangles gsts1 = new GeometricSimilarTriangles(rt, first); GeometricSimilarTriangles gsts2 = new GeometricSimilarTriangles(rt, second); GeometricSimilarTriangles gsts3 = new GeometricSimilarTriangles(first, second); List <GroundedClause> antecedent = new List <GroundedClause>(); antecedent.Add(original); antecedent.Add(altitude); newGrounded.Add(new EdgeAggregator(antecedent, gsts1, annotation)); newGrounded.Add(new EdgeAggregator(antecedent, gsts2, annotation)); newGrounded.Add(new EdgeAggregator(antecedent, gsts3, annotation)); return(newGrounded); }
// Start is called before the first frame update void Start() { shipState = 0; al = GetComponent <Altitude>(); input = GetComponent <ShipInput>(); physics = GetComponent <ShipPhysics>(); rb = GetComponent <Rigidbody>(); }
public virtual void SaveToXml(System.Xml.XmlTextWriter xmlWriter) { xmlWriter.WriteStartElement("ReferenceFrame"); xmlWriter.WriteAttributeString("Name", Name); xmlWriter.WriteAttributeString("Parent", Parent); xmlWriter.WriteAttributeString("ReferenceFrameType", ReferenceFrameType.ToString()); xmlWriter.WriteAttributeString("Reference", Reference.ToString()); xmlWriter.WriteAttributeString("ParentsRoationalBase", ParentsRoationalBase.ToString()); xmlWriter.WriteAttributeString("MeanRadius", MeanRadius.ToString()); xmlWriter.WriteAttributeString("Oblateness", Oblateness.ToString()); xmlWriter.WriteAttributeString("Heading", Heading.ToString()); xmlWriter.WriteAttributeString("Pitch", Pitch.ToString()); xmlWriter.WriteAttributeString("Roll", Roll.ToString()); xmlWriter.WriteAttributeString("Scale", Scale.ToString()); xmlWriter.WriteAttributeString("Tilt", Tilt.ToString()); xmlWriter.WriteAttributeString("Translation", Translation.ToString()); if (ReferenceFrameType == ReferenceFrameTypes.FixedSherical) { xmlWriter.WriteAttributeString("Lat", Lat.ToString()); xmlWriter.WriteAttributeString("Lng", Lng.ToString()); xmlWriter.WriteAttributeString("Altitude", Altitude.ToString()); } xmlWriter.WriteAttributeString("RotationalPeriod", RotationalPeriod.ToString()); xmlWriter.WriteAttributeString("ZeroRotationDate", ZeroRotationDate.ToString()); xmlWriter.WriteAttributeString("RepresentativeColor", SavedColor.Save(RepresentativeColor)); xmlWriter.WriteAttributeString("ShowAsPoint", ShowAsPoint.ToString()); xmlWriter.WriteAttributeString("ShowOrbitPath", ShowOrbitPath.ToString()); xmlWriter.WriteAttributeString("StationKeeping", StationKeeping.ToString()); if (ReferenceFrameType == ReferenceFrameTypes.Orbital) { xmlWriter.WriteAttributeString("SemiMajorAxis", SemiMajorAxis.ToString()); xmlWriter.WriteAttributeString("SemiMajorAxisScale", this.SemiMajorAxisUnits.ToString()); xmlWriter.WriteAttributeString("Eccentricity", Eccentricity.ToString()); xmlWriter.WriteAttributeString("Inclination", Inclination.ToString()); xmlWriter.WriteAttributeString("ArgumentOfPeriapsis", ArgumentOfPeriapsis.ToString()); xmlWriter.WriteAttributeString("LongitudeOfAscendingNode", LongitudeOfAscendingNode.ToString()); xmlWriter.WriteAttributeString("MeanAnomolyAtEpoch", MeanAnomolyAtEpoch.ToString()); xmlWriter.WriteAttributeString("MeanDailyMotion", MeanDailyMotion.ToString()); xmlWriter.WriteAttributeString("Epoch", Epoch.ToString()); } if (ReferenceFrameType == ReferenceFrameTypes.Trajectory) { xmlWriter.WriteStartElement("Trajectory"); foreach (TrajectorySample sample in Trajectory) { string data = sample.ToString(); xmlWriter.WriteElementString("Sample", data); } xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); }
/// <summary> /// constructor /// </summary> public CityDetailsViewModel() { this.AllCityCategoryItems = new Dictionary <string, List <CityData> >(); this.CityCategoryItemsList = new ObservableCollection <Entity.Models.CityData>(); this.MapCenterPoint = new Altitude(); this.CityCategoryPushpinsList = new ObservableCollection <CityData>(); this.CurrentLocationCoordinates = new Altitude(); this.AllCityItems = new List <CityData>(); }
// // T // |\ // | \ // | \ N <-----------Right Angle // | / \ // |/___\ // U S // // Altitude(Segment(U, N), Triangle(S, U, T)), RightTriangle(S, U, T) -> Similar(RightTriangle(S, U, T), RightTriangle(S, N, U)), // Similar(RightTriangle(S, N, U), RightTriangle(U, N, T)) // Similar(RightTriangle(U, N, T), RightTriangle(S, U, T)) // public static List <EdgeAggregator> Instantiate(GroundedClause c) { annotation.active = EngineUIBridge.JustificationSwitch.ALTITUDE_OF_RIGHT_TRIANGLES_IMPLIES_SIMILAR; List <EdgeAggregator> newGrounded = new List <EdgeAggregator>(); if (!(c is Altitude) && !(c is RightTriangle) && !(c is Strengthened)) { return(newGrounded); } if (c is Strengthened) { Strengthened streng = c as Strengthened; if (!(streng.strengthened is RightTriangle)) { return(newGrounded); } foreach (Altitude altitude in candidateAltitudes) { newGrounded.AddRange(InstantiateRight(streng.strengthened as RightTriangle, altitude, streng)); } candidateStrengthened.Add(streng); } else if (c is RightTriangle) { RightTriangle rt = c as RightTriangle; foreach (Altitude altitude in candidateAltitudes) { newGrounded.AddRange(InstantiateRight(rt, altitude, rt)); } candRightTriangles.Add(rt); } else if (c is Altitude) { Altitude altitude = c as Altitude; foreach (RightTriangle rt in candRightTriangles) { newGrounded.AddRange(InstantiateRight(rt, altitude, rt)); } foreach (Strengthened stren in candidateStrengthened) { newGrounded.AddRange(InstantiateRight(stren.strengthened as RightTriangle, altitude, stren)); } candidateAltitudes.Add(altitude); } return(newGrounded); }
public Esa CreateEsa(Guid id, double altitude, double radius, double latitude, double longitude) { Altitude altitudeVo = new Altitude(altitude); Radius radiusVo = new Radius(radius); Location locationVo = this.locationFactory.CreateLocation(latitude, longitude); Construct constructVo = this.constructFactory.CreateEsaConstruct(radiusVo, locationVo); return(new Esa(id, altitudeVo, radiusVo, locationVo, constructVo, id)); }
/// <summary> /// Create a new abstract shape. /// </summary> /// <param name="Id">The Id of the shape.</param> /// <param name="Latitude">The latitude of the shape center.</param> /// <param name="Longitude">The longitude of the shape center.</param> /// <param name="Altitude">The altitude of the shape center.</param> /// <param name="GeoWidth">The geographical width of the shape center.</param> /// <param name="GeoHeight">The geographical height of the shape center.</param> public AShape(String Id, Latitude Latitude, Longitude Longitude, Altitude Altitude, Latitude Latitude2, Longitude Longitude2) { this.Id = Id; this.Latitude = Latitude; this.Longitude = Longitude; this.Altitude = Altitude; this.Latitude2 = Latitude2; this.Longitude2 = Longitude2; }
public IEnumerator Load(string mapname, Action <string, string, object> callback) { Progress = 0; RSW world = LoadWorld(mapname, callback); Altitude altitude = LoadAltitude(mapname, callback); GND ground = LoadGround(mapname, world, callback); yield return(LoadModels(mapname, world.modelDescriptors, callback)); }
/// <summary> /// Returns a height reference for the given altitude /// </summary> /// <param name="altitude">altitude object</param> /// <returns>height reference value</returns> private static Czml.HeightReference HeightReferenceFromAltitude(Altitude altitude) { return(altitude.Type switch { AltitudeType.GND => Czml.HeightReference.ClampToGround, AltitudeType.Unlimited or AltitudeType.Textual or AltitudeType.AGL => Czml.HeightReference.RelativeToGround, _ => Czml.HeightReference.None, });
/// <summary> /// Determines whether this instance and another specified Location object /// have the same value. /// </summary> /// <param name="other">The Location to compare to this instance.</param> /// <returns> /// true if the value of the value parameter is the same as this instance; /// otherwise, false. /// </returns> public bool Equals(Location other) { if (ReferenceEquals(other, null)) { return(false); } return(Altitude.Equals(other.Altitude) && Latitude.Equals(other.Latitude) && Longitude.Equals(other.Longitude)); }
public GeoBoundingBox(Latitude Latitude, Longitude Longitude, Altitude Altitude, Latitude Latitude2, Longitude Longitude2, Altitude Altitude2) { this.GeoCoordinate1 = new GeoCoordinate(Latitude, Longitude, Altitude); this.Latitude = Latitude; this.Longitude = Longitude; this.Altitude = Altitude; this.GeoCoordinate2 = new GeoCoordinate(Latitude2, Longitude2, Altitude2); this.Latitude2 = Latitude2; this.Longitude2 = Longitude2; this.Altitude2 = Altitude2; this.GeoWidth = GeoCoordinate1.DistanceKM(new GeoCoordinate(GeoCoordinate1.Latitude, GeoCoordinate2.Longitude)); // Longitude West <-> East this.GeoHeight = GeoCoordinate1.DistanceKM(new GeoCoordinate(GeoCoordinate2.Latitude, GeoCoordinate1.Longitude)); // Latitude North <-> South this.GeoAlitude = Altitude2. Value - Altitude. Value; }
//Alters altitudes based on neighbors to create a cleaner terrain public void CorrectAlts() { Altitude alt = localAlt; if(alt == Altitude.Deep && NeighborContainsAlt(Altitude.High)) {alt++;} if(alt == Altitude.Shallow && NeighborContainsAlt(Altitude.High)) {alt++;} if(alt == Altitude.Medium && !NeighborContainsAlt(Altitude.Deep)){ if(Random.Range(0,3) == 0) {alt++;} } if(alt == Altitude.Low && NeighborContainsAlt(Altitude.Low)){ if(Random.Range(0,2) == 0) {alt++;} } if(alt == Altitude.Deep && NeighborContainsAlt(Altitude.Deep)){ if(Random.Range(0,2) == 0) {alt++;} } if(NeighborContainsAlt(Altitude.Deep)){ if(Random.Range(0,3) > 0) {alt--;} } if(alt < 0) {alt = Altitude.Deep;} if(alt >= Altitude.High) {alt = Altitude.High;} localAlt = alt; }
/// <summary> /// Add a map feature of the given dimensions at the given geo coordinate. /// </summary> /// <param name="Id">The unique identification of the feature.</param> /// <param name="Latitude">The latitude of the feature.</param> /// <param name="Longitude">The longitude of the feature.</param> /// <param name="Altitude">The altitude of the feature.</param> /// <param name="Fill">The fill brush of the feature.</param> /// <param name="Stroke">The stroke brush of the feature.</param> /// <param name="StrokeThickness">The thickness of the stroke.</param> public VoronoiFeature AddFeature(String Id, Latitude Latitude, Longitude Longitude, Altitude Altitude, Brush Fill, Brush Stroke, Double StrokeThickness) { return AddFeature(Id, new GeoCoordinate(Latitude, Longitude, Altitude), Fill, Stroke, StrokeThickness); }
/// <summary> /// Add a map feature of the given dimensions at the given geo coordinate. /// </summary> /// <param name="Id">The unique identification of the feature.</param> /// <param name="Latitude">The latitude of the feature.</param> /// <param name="Longitude">The longitude of the feature.</param> /// <param name="Altitude">The altitude of the feature.</param> /// <param name="Width">The longitude of the feature.</param> /// <param name="Height">The longitude of the feature.</param> /// <param name="Fill">The fill brush of the feature.</param> /// <param name="Stroke">The stroke brush of the feature.</param> /// <param name="StrokeThickness">The thickness of the stroke.</param> public Feature AddFeature(String Id, Latitude Latitude, Longitude Longitude, Altitude Altitude, Double Width, Double Height, Brush Fill, Brush Stroke, Double StrokeThickness) { return AddFeature(Id, new GeoCoordinate(Latitude, Longitude, Altitude), Width, Height, Fill, Stroke, StrokeThickness); }
public TerrainStaticData(string name/*, TODO: icon */, int defense, Altitude altitude, Capturable isCapturable) { this.name = name; //this.icon = icon; this.defense = defense; this.altitude = altitude; this.isCapturable = isCapturable; }
/// <summary> /// Helper function for autoWall() /// </summary> /// <param name="altitude">its altitude why the f**k can't you figure this out yourself</param> /// <returns></returns> private bool isDifferent(Altitude altitude) { if ( altitude == Altitude.unassigned ) return true; return altitude != type.gameplayData.altitude ? true : false; }
//checks neighbors for a given altitude public bool NeighborContainsAlt(Altitude alt) { bool traitIsPresent = false; for(int i = 0; i < NeighborList.Count; i++){ if(NeighborList[i] != null){ Hex target = NeighborList[i].GetComponent<Hex>(); if(target.GetAlt() == alt){ traitIsPresent = true; } } } return traitIsPresent; }
//TODO: expand this public SquadStaticData( string name, int productionCost, SquadMovementType movementType, Altitude altitude, int movementPointsDefault, int fuelDefault, int visionDefault, int minRangeDefault, int maxRangeDefault, int ammoDefault, List<Ability> abilities) { this.name = name; this.productionCost = productionCost; this.movementType = movementType; this.altitude = altitude; this.movementPointsDefault = movementPointsDefault; this.fuelDefault = fuelDefault; this.visionDefault = visionDefault; this.minRangeDefault = minRangeDefault; this.maxRangeDefault = maxRangeDefault; this.ammoDefault = ammoDefault; this.abilities = abilities; }
public void SetBaseValues() { baseBiome = localBiome; baseAlt = localAlt; baseClimate = localClimate; baseVeg = localVeg; baseTemp = localTemp; CorrectGeos(); }
public void SetAlt(Altitude alt) { if(alt < 0) {alt = Altitude.Deep;} else if(alt >= Altitude.High) {alt = Altitude.High;} localAlt = alt; }
private Color32 SetHappyColor(Altitude val) { Color32 tempColor = iconControl.GetCritterHappinessColor(player.GetCritter(), this); return tempColor; }
public void DecreaseAlt() { localAlt--; if(localAlt < 0) {localAlt = Altitude.Deep;} else if(localAlt >= Altitude.High) {localAlt = Altitude.High;} }
//Generates altitude randomly public void GenerateAlt() { Altitude alt = (Altitude)Random.Range(0, (int)Altitude.High + 1); if(isBorder){ int OceanChance = Random.Range(0, 3); if(OceanChance == 0) {alt = Altitude.Deep;} } else if(!isBorder){ int altChance = Random.Range(0, 5); if(altChance == 0) {alt++;} } if (gridLocation.y == 2) { alt--; } if (alt < 0) {alt = Altitude.Deep;} if(alt >= Altitude.High) {alt = Altitude.High;} localAlt = alt; }
//randomly generates geography based on altitude and neighboring altitudes public void GenerateGeo() { Geography geo = Geography.Hills; if(localAlt == Altitude.High){ if(!NeighborContainsAlt(Altitude.High)) {geo = (Geography)Random.Range(3, (int)Geography.Mountains + 1);} else {geo = (Geography)Random.Range(2, (int)Geography.Mountains + 1);} } if(localAlt == Altitude.Medium){ if(NeighborContainsAlt(Altitude.High)) {geo = (Geography)Random.Range(3, (int)Geography.Mountains + 1);} else {geo = (Geography)Random.Range(2, (int)Geography.Mountains + 1);} } if(localAlt <= Altitude.Low){ if(NeighborContainsAlt(Altitude.High)) {geo++;} else {geo = (Geography)Random.Range(2, 3);} } if(localAlt == Altitude.Deep){ if(!isBorder && !NeighborContainsAlt(Altitude.Deep)) {localAlt = Altitude.Shallow;} else {geo = Geography.SaltWater;} } if(localAlt == Altitude.Shallow){ if(!NeighborContainsAlt(Altitude.Deep)) { geo = (Geography)Random.Range(1, (int)Geography.Mountains + 1); } else if(NeighborContainsAlt(Altitude.Deep)) { geo = (Geography)Random.Range(0, 2); } else { geo = (Geography)Random.Range(1, (int)Geography.Mountains + 1); } } if(geo < 0){ if(localAlt == Altitude.Deep) {geo = Geography.SaltWater;} else {GenerateGeo();} } if(geo > Geography.Mountains) {geo = Geography.Mountains;} localGeo = geo; }
/// <summary> /// Add a map feature of the given dimensions at the given geo coordinate. /// </summary> /// <param name="Id">The unique identification of the feature.</param> /// <param name="Latitude">The latitude of the feature.</param> /// <param name="Longitude">The longitude of the feature.</param> /// <param name="Altitude">The altitude of the feature.</param> /// <param name="Width">The longitude of the feature.</param> /// <param name="Height">The longitude of the feature.</param> /// <param name="Fill">The fill brush of the feature.</param> /// <param name="Stroke">The stroke brush of the feature.</param> /// <param name="StrokeThickness">The thickness of the stroke.</param> public Feature AddFeature(String Id, Latitude Latitude, Longitude Longitude, Altitude Altitude, Double Width, Double Height, Color Color) { return AddFeature(Id, new GeoCoordinate(Latitude, Longitude, Altitude), Width, Height, Color); }