private async Task RecordPath() { float lastRecordedX = mumble.GetX(); float lastRecordedY = mumble.GetY(); float lastRecordedAngle = mumble.GetAngle(); float lastX = lastRecordedX; float lastY = lastRecordedY; float lastAngle = lastRecordedAngle; mapView.Plan.AddRoutePoint(mumble.GetPercentX(), mumble.GetPercentY()); mapView.Invalidate(); while (!shouldStop) { float x = mumble.GetX(); float y = mumble.GetY(); float angle = mumble.GetAngle(); if (ShouldMark(lastRecordedX, lastRecordedY, lastRecordedAngle, lastX, lastY, lastAngle, x, y, angle)) { mapView.Plan.AddRoutePoint(mumble.GetPercentX(), mumble.GetPercentY()); mapView.Invalidate(); lastRecordedX = x; lastRecordedY = y; lastRecordedAngle = angle; } lastX = x; lastY = y; lastAngle = angle; await Task.Delay(100); } }
private void UpdateMap() { mapView.SetPlayerPosition(mumble.GetPercentX(), mumble.GetPercentY(), mumble.GetVx(), mumble.GetVy()); mapView.SetScale(MapEditZoom); mapView.Invalidate(); }