public void OnLocationChanged(Person person) { this.Dispatcher.Invoke(new Action(delegate() { if(person.Location.HasValue) { Point newPoint = DrawingResources.ConvertFromMetersToDisplayCoordinates(person.Location.Value, MainWindow.SharedCanvas); // PersonEllipse.Width / 2 is to make it so that the point that the PersonControl is drawn at is actually the center of the Ellipse Canvas.SetLeft(this, newPoint.X - (PersonEllipse.Width/2)); Canvas.SetTop(this, newPoint.Y - (PersonEllipse.Height/2)); CoordinatesLabel.Content = string.Format("Location: ({0:0.0},{1:0.0})", person.Location.Value.X, person.Location.Value.Y); } })); }
public void UpdatePositionForPerson(Person person, Vector vector) { Vector updatedPosition = Util.TranslateFromCoordinateSpace(vector, Orientation, new Vector(Location.Value.X, Location.Value.Y)); person.Location = new Point(updatedPosition.X, updatedPosition.Y); }
/// <summary> /// Type comparison of Person's object, at a class level. /// If 2 different Persons have the same identifier, then the Persons are equal. /// </summary> /// <param name="p">Person to compare with</param> /// <returns>True or False after comparing the identifiers</returns> public bool Equals(Person p) { //If the parameter is null, return false if ((System.Object)p == null) { return false; } //Return comparison of the identifiers return (p.Identifier == this.Identifier); }
public void OnOrientationChanged(Person person) { }