#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>

// Stub implementation for simulator
typedef struct mach_header_64 MachHeader;

@protocol UnityFrameworkListener<NSObject>
@optional
- (void)unityDidUnload:(NSNotification*)notification;
- (void)unityDidQuit:(NSNotification*)notification;
@end

@interface UnityAppController : NSObject
@end

@implementation UnityAppController
@end

@interface UnityFramework : NSObject
@end

@implementation UnityFramework

+ (instancetype)getInstance {
    static UnityFramework *instance = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        instance = [[self alloc] init];
    });
    return instance;
}

- (id)appController {
    return nil;
}

- (UITextField*)keyboardTextField {
    return nil;
}

- (void)setDataBundleId:(const char*)bundleId {
    // Stub
}

- (void)runUIApplicationMainWithArgc:(int)argc argv:(char*[])argv {
    // Stub
}

- (void)runEmbeddedWithArgc:(int)argc argv:(char*[])argv appLaunchOpts:(NSDictionary*)appLaunchOpts {
    // Stub - 模拟器不运行 Unity
    NSLog(@"UnityFramework: Simulator stub - Unity not available");
}

- (void)unloadApplication {
    // Stub
}

- (void)quitApplication:(int)exitCode {
    // Stub
}

- (void)registerFrameworkListener:(id)obj {
    // Stub
}

- (void)unregisterFrameworkListener:(id)obj {
    // Stub
}

- (void)showUnityWindow {
    // Stub
}

- (void)pause:(bool)pause {
    // Stub
}

- (void)setAbsoluteURL:(const char *)url {
    // Stub
}

- (void)setExecuteHeader:(const MachHeader*)header {
    // Stub
}

- (void)sendMessageToGOWithName:(const char*)goName functionName:(const char*)name message:(const char*)msg {
    // Stub
}

@end

// Export version symbols
double UnityFrameworkVersionNumber = 1.0;
const unsigned char UnityFrameworkVersionString[] = "1.0";
