#pragma once #import "FGPrefix.h" /// Phát mỗi khi trạng thái mô phỏng tuyến thay đổi (bắt đầu/tạm dừng/kết thúc...). extern NSString *const FGRouteSimulationDidChangeNotification; typedef NS_ENUM(NSInteger, FGTransportType) { FGTransportTypeWalking = 0, FGTransportTypeDriving = 1 }; /// Mô phỏng di chuyển dọc theo tuyến đường thật (Apple Maps). /// Ý tưởng lấy từ WrapPin: chọn điểm đến, xem tuyến, rồi "đi bộ" hoặc "lái xe" /// với tốc độ tuỳ chỉnh. Toạ độ được cập nhật liên tục vào hook vị trí. @interface FGRouteSimulator : NSObject + (instancetype)shared; @property (nonatomic, readonly) BOOL isRunning; @property (nonatomic, readonly) BOOL isPaused; @property (nonatomic, readonly) FGTransportType transport; @property (nonatomic, readonly) double speedKPH; @property (nonatomic, readonly) CLLocationDistance totalDistance; @property (nonatomic, readonly) CLLocationDistance remainingDistance; @property (nonatomic, readonly) CLLocationCoordinate2D currentCoordinate; @property (nonatomic, copy) NSString *destinationName; /// Lập tuyến từ `from` tới `to`. `completion` chạy trên main thread. - (void)planFrom:(CLLocationCoordinate2D)from to:(CLLocationCoordinate2D)to transport:(FGTransportType)transport completion:(void (^)(CLLocationDistance distance, NSTimeInterval expectedTravelTime, NSString *errorMessage))completion; /// Bắt đầu chạy tuyến đã lập với tốc độ hiện tại. - (void)start; - (void)pause; - (void)resume; /// Dừng và giữ nguyên vị trí cuối. - (void)stop; /// Dừng và tắt giả lập (trả về vị trí thật của thiết bị). - (void)stopAndRestoreRealLocation; @end