/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (Cavv != null) { hashCode = hashCode * 59 + Cavv.GetHashCode(); } if (CavvAlgorithm != null) { hashCode = hashCode * 59 + CavvAlgorithm.GetHashCode(); } if (Eci != null) { hashCode = hashCode * 59 + Eci.GetHashCode(); } if (ValidationResult != null) { hashCode = hashCode * 59 + ValidationResult.GetHashCode(); } if (Xid != null) { hashCode = hashCode * 59 + Xid.GetHashCode(); } return(hashCode); } }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (CardholderName != null) { hashCode = hashCode * 59 + CardholderName.GetHashCode(); } if (Cryptogram != null) { hashCode = hashCode * 59 + Cryptogram.GetHashCode(); } if (Dpan != null) { hashCode = hashCode * 59 + Dpan.GetHashCode(); } if (Eci != null) { hashCode = hashCode * 59 + Eci.GetHashCode(); } if (ExpiryDate != null) { hashCode = hashCode * 59 + ExpiryDate.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if ThreeDSecureResults instances are equal /// </summary> /// <param name="other">Instance of ThreeDSecureResults to be compared</param> /// <returns>Boolean</returns> public bool Equals(ThreeDSecureResults other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Cavv == other.Cavv || Cavv != null && Cavv.Equals(other.Cavv) ) && ( Eci == other.Eci || Eci != null && Eci.Equals(other.Eci) ) && ( Xid == other.Xid || Xid != null && Xid.Equals(other.Xid) )); }
IEnumerator UpdateSatLocation() { foreach (Satellite sat in sats) { Destroy(transform.FindChild(sat.Name).gameObject); Eci eci = sat.PositionEci(DateTime.UtcNow); TopoTime topo = referencePoint.GetLookAngle(new EciTime(eci, new Julian(DateTime.UtcNow))); // Topocentric to xyz coordinates: a = azimuth, e = elevation, r = range. // x = r * cos(e)sin(a), y = r * cos(e)sin(a), z = r * sin(e) float x = (float)topo.Range * Mathf.Cos((float)topo.ElevationRad) * Mathf.Sin((float)topo.AzimuthRad); float y = (float)topo.Range * Mathf.Cos((float)topo.ElevationRad) * Mathf.Cos((float)topo.AzimuthRad); float z = (float)topo.Range * Mathf.Sin((float)topo.ElevationRad); Vector3 lookVector = new Vector3(x, y, z); GameObject satellite = Instantiate(Prefab); satellite.GetComponent <SatelliteScript>().Setup(sat.Name); satellite.transform.parent = transform; satellite.transform.localPosition = (lookVector / 1000) + new Vector3(0, 0, 6.371f); yield return(null); } }
IEnumerator LoadDebris() { spaceCraft = GameObject.Find("SpaceCraft"); attribute = spaceCraft.GetComponent <attributeDefiner>(); Loading.text = "Downloading Game Debris Data"; yield return(new WaitForSeconds(1)); string jsonURL = @"https://worldwind.arc.nasa.gov/spacebirds/data/TLE.json"; WWW download = new WWW(jsonURL); while (!download.isDone) { Progress.fillAmount = download.progress; float prog = download.progress * 100; ProgressText.text = "" + (int)prog + "%"; yield return(null); } yield return(download); List <Debris> debrisData = JsonConvert.DeserializeObject <List <Debris> >(download.text); Loading.text = "Loading Game Debris."; foreach (var item in debrisData) { if (item.OBJECT_TYPE == "DEBRIS") { Tle tle = new Tle(item.OBJECT_ID, item.TLE_LINE1, item.TLE_LINE2); Satellite sat = new Satellite(tle); List <Eci> coords = new List <Eci>(); Eci eci = sat.PositionEci(900); Vector3 pos = new Vector3((float)eci.Position.X, (float)eci.Position.Y, (float)eci.Position.Z); Debug.Log(pos); float decider = Random.value; if (decider <= 0.33) { DebrisGenerator(bolt, pos); } else if (decider > 0.33 && decider <= 0.66) { DebrisGenerator(nut, pos); } else { DebrisGenerator(sheet, pos); } } } yield return(new WaitForSeconds(1)); LoadingScreen.SetActive(false); attribute.IsLoading = false; }
// ////////////////////////////////////////////////////////////////////////// // // Routine to output position and velocity information of satellite // in orbit described by TLE information. // static void PrintPosVel(Tle tle) { const int Step = 360; Satellite sat = new Satellite(tle); List <Eci> coords = new List <Eci>(); // Calculate position, velocity // mpe = "minutes past epoch" for (int mpe = 0; mpe <= (Step * 4); mpe += Step) { // Get the position of the satellite at time "mpe". // The coordinates are placed into the variable "eci". Eci eci = sat.PositionEci(mpe); // Add the coordinate object to the list coords.Add(eci); } // Print TLE data Console.Write("{0}\n", tle.Name); Console.Write("{0}\n", tle.Line1); Console.Write("{0}\n", tle.Line2); // Header Console.Write("\n TSINCE X Y Z\n\n"); // Iterate over each of the ECI position objects pushed onto the // coordinate list, above, printing the ECI position information // as we go. for (int i = 0; i < coords.Count; i++) { Eci e = coords[i] as Eci; Console.Write("{0,8}.00 {1,16:f8} {2,16:f8} {3,16:f8}\n", i * Step, e.Position.X, e.Position.Y, e.Position.Z); } Console.Write("\n XDOT YDOT ZDOT\n\n"); // Iterate over each of the ECI position objects in the coordinate // list again, but this time print the velocity information. for (int i = 0; i < coords.Count; i++) { Eci e = coords[i] as Eci; Console.Write("{0,24:f8} {1,16:f8} {2,16:f8}\n", e.Velocity.X, e.Velocity.Y, e.Velocity.Z); } }
///Users/segalcodin/Documents/Sat_data_base void Start() { savePath = Application.dataPath + "/Saves"; if (File.Exists(savePath + "/save.binary" + this.transform.name)) { LoadData(); } string appPath = ""; var info = new DirectoryInfo(Application.dataPath); var fileInfo = info.GetFiles(); foreach (var item in fileInfo) { if (item.FullName.Contains(".txt") & !item.FullName.Contains(".meta")) { appPath = item.FullName; } } if (File.Exists(appPath)) { string[] lines = File.ReadAllLines(appPath); for (int i = 0; i < (lines.Length - (lines.Length - nr_sat)) - 2; i += 2) { Vector3 position; Vector3 velocity; Satellite sat = new Satellite(new Tle("SGP4", lines[i], lines[i + 1])); Eci eci = sat.PositionEci(360); position.x = (float)eci.Position.X / 100; position.y = (float)eci.Position.Y / 100; position.z = (float)eci.Position.Z / 100; velocity.x = (float)eci.Velocity.X; velocity.y = (float)eci.Velocity.Y; velocity.z = (float)eci.Velocity.Z; GameObject satilite = Instantiate(Satelatite); satilite.name = "A" + i; satilite.transform.position = position; KeplerOrbitMover body = satilite.GetComponent <KeplerOrbitMover>(); body.AttractorSettings.AttractorObject = Atractor; body.AttractorSettings.AttractorMass = attractorMass; body.CreateNewOrbitFromPositionAndVelocity(body.transform.position, velocity); body.SetAutoCircleOrbit(); body.LockOrbitEditing = true; satilite.transform.parent = this.transform; } StateOfMachine.Instance.SetSate = false; } }
/// <summary> /// Returns true if DecryptedPaymentData instances are equal /// </summary> /// <param name="other">Instance of DecryptedPaymentData to be compared</param> /// <returns>Boolean</returns> public bool Equals(DecryptedPaymentData other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( CardholderName == other.CardholderName || CardholderName != null && CardholderName.Equals(other.CardholderName) ) && ( Cryptogram == other.Cryptogram || Cryptogram != null && Cryptogram.Equals(other.Cryptogram) ) && ( Dpan == other.Dpan || Dpan != null && Dpan.Equals(other.Dpan) ) && ( Eci == other.Eci || Eci != null && Eci.Equals(other.Eci) ) && ( ExpiryDate == other.ExpiryDate || ExpiryDate != null && ExpiryDate.Equals(other.ExpiryDate) )); }
/// <summary> /// Returns true if ExternalCardholderAuthenticationData instances are equal /// </summary> /// <param name="other">Instance of ExternalCardholderAuthenticationData to be compared</param> /// <returns>Boolean</returns> public bool Equals(ExternalCardholderAuthenticationData other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Cavv == other.Cavv || Cavv != null && Cavv.Equals(other.Cavv) ) && ( CavvAlgorithm == other.CavvAlgorithm || CavvAlgorithm != null && CavvAlgorithm.Equals(other.CavvAlgorithm) ) && ( Eci == other.Eci || Eci != null && Eci.Equals(other.Eci) ) && ( ValidationResult == other.ValidationResult || ValidationResult != null && ValidationResult.Equals(other.ValidationResult) ) && ( Xid == other.Xid || Xid != null && Xid.Equals(other.Xid) )); }
public Hashtable ImportFromCeles(string name) { // Imports (and returns as hashtable) specific entry (by name) from Celestrak, using the most recent library Hashtable toReturn = new Hashtable(); string url = _celesUrl + _prevCategory.ToLower() + ".txt"; // Make http request HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Stream resStream = response.GetResponseStream(); // Find matching line and read next two lines (TLEs) StreamReader sr = new StreamReader(resStream); bool found = false; string line = ""; while (!found) { line = sr.ReadLine(); if (line.Trim() == name) { found = true; } } string tle1 = sr.ReadLine(); string tle2 = sr.ReadLine(); // Convert TLEs to COEs Tle tle = new Tle(name, tle1.Trim(), tle2.Trim()); Orbit orbit = new Orbit(tle); double timePastEpoch = 0; Eci eci = orbit.getPosition(timePastEpoch); toReturn.Add("Name", name + " (" + tle1.Substring(2, 4) + ")"); toReturn.Add("Position", "Matrix(6,1,{" + eci.Position.X + ", " + eci.Position.Y + ", " + eci.Position.Z + ", " + eci.Velocity.X + ", " + eci.Velocity.Y + ", " + eci.Velocity.Z + "})"); return(toReturn); }
void Start() { WebRequest request = WebRequest.Create(URL); WebResponse response = request.GetResponse(); Stream dataStream = response.GetResponseStream(); StreamReader reader = new StreamReader(dataStream); while (reader.Peek() > -1) { string name = reader.ReadLine(); string line1 = reader.ReadLine(); string line2 = reader.ReadLine(); Tle tle = new Tle(name, line1, line2); Satellite sat = new Satellite(tle); sats.Add(sat); Eci eci = sat.PositionEci(DateTime.UtcNow); TopoTime topo = referencePoint.GetLookAngle(new EciTime(eci, new Julian(DateTime.UtcNow))); // Topocentric to xyz coordinates: a = azimuth, e = elevation, r = range. // x = r * cos(e)sin(a), y = r * cos(e)sin(a), z = r * sin(e) float x = (float)topo.Range * Mathf.Cos((float)topo.ElevationRad) * Mathf.Sin((float)topo.AzimuthRad); float y = (float)topo.Range * Mathf.Cos((float)topo.ElevationRad) * Mathf.Cos((float)topo.AzimuthRad); float z = (float)topo.Range * Mathf.Sin((float)topo.ElevationRad); Vector3 lookVector = new Vector3(x, y, z); GameObject satellite = Instantiate(Prefab); satellite.GetComponent <SatelliteScript>().Setup(name); satellite.transform.parent = transform; satellite.transform.localPosition = (lookVector / 1000) + new Vector3(0, 0, 6.371f); } InvokeRepeating("StartLocationUpdate", 0, 1.0f); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (Id != null) { hashCode = hashCode * 59 + Id.GetHashCode(); } if (ActionId != null) { hashCode = hashCode * 59 + ActionId.GetHashCode(); } if (Amount != null) { hashCode = hashCode * 59 + Amount.GetHashCode(); } if (Currency != null) { hashCode = hashCode * 59 + Currency.GetHashCode(); } if (Approved != null) { hashCode = hashCode * 59 + Approved.GetHashCode(); } if (Status != null) { hashCode = hashCode * 59 + Status.GetHashCode(); } if (AuthCode != null) { hashCode = hashCode * 59 + AuthCode.GetHashCode(); } if (ResponseCode != null) { hashCode = hashCode * 59 + ResponseCode.GetHashCode(); } if (ResponseSummary != null) { hashCode = hashCode * 59 + ResponseSummary.GetHashCode(); } if (ThreeDS != null) { hashCode = hashCode * 59 + ThreeDS.GetHashCode(); } if (Risk != null) { hashCode = hashCode * 59 + Risk.GetHashCode(); } if (Source != null) { hashCode = hashCode * 59 + Source.GetHashCode(); } if (Customer != null) { hashCode = hashCode * 59 + Customer.GetHashCode(); } if (ProcessedOn != null) { hashCode = hashCode * 59 + ProcessedOn.GetHashCode(); } if (Reference != null) { hashCode = hashCode * 59 + Reference.GetHashCode(); } if (Eci != null) { hashCode = hashCode * 59 + Eci.GetHashCode(); } if (SchemeId != null) { hashCode = hashCode * 59 + SchemeId.GetHashCode(); } if (Links != null) { hashCode = hashCode * 59 + Links.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if PaymentResponse instances are equal /// </summary> /// <param name="other">Instance of PaymentResponse to be compared</param> /// <returns>Boolean</returns> public bool Equals(PaymentResponse other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Id == other.Id || Id != null && Id.Equals(other.Id) ) && ( ActionId == other.ActionId || ActionId != null && ActionId.Equals(other.ActionId) ) && ( Amount == other.Amount || Amount != null && Amount.Equals(other.Amount) ) && ( Currency == other.Currency || Currency != null && Currency.Equals(other.Currency) ) && ( Approved == other.Approved || Approved != null && Approved.Equals(other.Approved) ) && ( Status == other.Status || Status != null && Status.Equals(other.Status) ) && ( AuthCode == other.AuthCode || AuthCode != null && AuthCode.Equals(other.AuthCode) ) && ( ResponseCode == other.ResponseCode || ResponseCode != null && ResponseCode.Equals(other.ResponseCode) ) && ( ResponseSummary == other.ResponseSummary || ResponseSummary != null && ResponseSummary.Equals(other.ResponseSummary) ) && ( ThreeDS == other.ThreeDS || ThreeDS != null && ThreeDS.Equals(other.ThreeDS) ) && ( Risk == other.Risk || Risk != null && Risk.Equals(other.Risk) ) && ( Source == other.Source || Source != null && Source.Equals(other.Source) ) && ( Customer == other.Customer || Customer != null && Customer.Equals(other.Customer) ) && ( ProcessedOn == other.ProcessedOn || ProcessedOn != null && ProcessedOn.Equals(other.ProcessedOn) ) && ( Reference == other.Reference || Reference != null && Reference.Equals(other.Reference) ) && ( Eci == other.Eci || Eci != null && Eci.Equals(other.Eci) ) && ( SchemeId == other.SchemeId || SchemeId != null && SchemeId.Equals(other.SchemeId) ) && ( Links == other.Links || Links != null && Links.Equals(other.Links) )); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (Id != null) { hashCode = hashCode * 59 + Id.GetHashCode(); } if (RequestedOn != null) { hashCode = hashCode * 59 + RequestedOn.GetHashCode(); } if (Source != null) { hashCode = hashCode * 59 + Source.GetHashCode(); } if (Destination != null) { hashCode = hashCode * 59 + Destination.GetHashCode(); } if (Amount != null) { hashCode = hashCode * 59 + Amount.GetHashCode(); } if (Currency != null) { hashCode = hashCode * 59 + Currency.GetHashCode(); } if (PaymentType != null) { hashCode = hashCode * 59 + PaymentType.GetHashCode(); } if (Reference != null) { hashCode = hashCode * 59 + Reference.GetHashCode(); } if (Description != null) { hashCode = hashCode * 59 + Description.GetHashCode(); } if (Approved != null) { hashCode = hashCode * 59 + Approved.GetHashCode(); } if (Status != null) { hashCode = hashCode * 59 + Status.GetHashCode(); } if (ThreeDS != null) { hashCode = hashCode * 59 + ThreeDS.GetHashCode(); } if (Risk != null) { hashCode = hashCode * 59 + Risk.GetHashCode(); } if (Customer != null) { hashCode = hashCode * 59 + Customer.GetHashCode(); } if (BillingDescriptor != null) { hashCode = hashCode * 59 + BillingDescriptor.GetHashCode(); } if (Shipping != null) { hashCode = hashCode * 59 + Shipping.GetHashCode(); } if (PaymentIp != null) { hashCode = hashCode * 59 + PaymentIp.GetHashCode(); } if (Eci != null) { hashCode = hashCode * 59 + Eci.GetHashCode(); } if (SchemeId != null) { hashCode = hashCode * 59 + SchemeId.GetHashCode(); } if (Links != null) { hashCode = hashCode * 59 + Links.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if Payment instances are equal /// </summary> /// <param name="other">Instance of Payment to be compared</param> /// <returns>Boolean</returns> public bool Equals(PaymentDetails other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Id == other.Id || Id != null && Id.Equals(other.Id) ) && ( RequestedOn == other.RequestedOn || RequestedOn != null && RequestedOn.Equals(other.RequestedOn) ) && ( Source == other.Source || Source != null && Source.Equals(other.Source) ) && ( Destination == other.Destination || Destination != null && Destination.Equals(other.Destination) ) && ( Amount == other.Amount || Amount != null && Amount.Equals(other.Amount) ) && ( Currency == other.Currency || Currency != null && Currency.Equals(other.Currency) ) && ( PaymentType == other.PaymentType || PaymentType != null && PaymentType.Equals(other.PaymentType) ) && ( Reference == other.Reference || Reference != null && Reference.Equals(other.Reference) ) && ( Description == other.Description || Description != null && Description.Equals(other.Description) ) && ( Approved == other.Approved || Approved != null && Approved.Equals(other.Approved) ) && ( Status == other.Status || Status != null && Status.Equals(other.Status) ) && ( ThreeDS == other.ThreeDS || ThreeDS != null && ThreeDS.Equals(other.ThreeDS) ) && ( Risk == other.Risk || Risk != null && Risk.Equals(other.Risk) ) && ( Customer == other.Customer || Customer != null && Customer.Equals(other.Customer) ) && ( BillingDescriptor == other.BillingDescriptor || BillingDescriptor != null && BillingDescriptor.Equals(other.BillingDescriptor) ) && ( Shipping == other.Shipping || Shipping != null && Shipping.Equals(other.Shipping) ) && ( PaymentIp == other.PaymentIp || PaymentIp != null && PaymentIp.Equals(other.PaymentIp) ) && ( Eci == other.Eci || Eci != null && Eci.Equals(other.Eci) ) && ( SchemeId == other.SchemeId || SchemeId != null && SchemeId.Equals(other.SchemeId) ) && ( Links == other.Links || Links != null && Links.Equals(other.Links) )); }