<commit_before>//
//  AppController.cpp
//  ee_x_test
//
//  Created by Zinge on 5/17/17.
//
//

#import "AppController.h"

#import <cocos2d.h>

#import <ee/Core.hpp>

#import "AppDelegate.hpp"
#import "RootViewController.h"

@implementation AppController

@synthesize window;

#pragma mark -
#pragma mark Application lifecycle

// cocos2d application instance
static eetest::AppDelegate s_sharedApplication;

- (BOOL)application:(UIApplication*)application
    didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
    auto app = cocos2d::Application::getInstance();

    // Initialize the GLView attributes.
    app->initGLContextAttrs();
    cocos2d::GLViewImpl::convertAttrs();

    // Override point for customization after application launch.

    // Use RootViewController to manage CCEAGLView
    _viewController = [[[RootViewController alloc] init] autorelease];
    [[self viewController] setExtendedLayoutIncludesOpaqueBars:YES];
    [[self viewController] setEdgesForExtendedLayout:UIRectEdgeAll];

    // Add the view controller's view to the window and display.
    window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    [window setRootViewController:[self viewController]];
    [window makeKeyAndVisible];

    [[UIApplication sharedApplication] setStatusBarHidden:true];

    // IMPORTANT: Setting the GLView should be done after creating the
    // RootViewController
    auto glview = cocos2d::GLViewImpl::createWithEAGLView(
        (__bridge void*)[_viewController view]);
    cocos2d::Director::getInstance()->setOpenGLView(glview);

    EEPluginManager* manager = [EEPluginManager getInstance];
    [manager initializePlugins];
    [manager addPlugin:@"AdMob"];
    [manager addPlugin:@"AppLovin"];
    [manager addPlugin:@"AppsFlyer"];
    [manager addPlugin:@"CampaignReceiver"];
    [manager addPlugin:@"Facebook"];
    [manager addPlugin:@"FacebookAds"];
    [manager addPlugin:@"FirebaseApp"];
    [manager addPlugin:@"FirebaseCrashlytics"];
    [manager addPlugin:@"FirebasePerformance"];
    [manager addPlugin:@"GoogleAnalytics"];
    [manager addPlugin:@"IronSource"];
    [manager addPlugin:@"Notification"];
    [manager addPlugin:@"Play"];
    [manager addPlugin:@"Recorder"];
    [manager addPlugin:@"Tenjin"];
    [manager addPlugin:@"UnityAds"];
    [manager addPlugin:@"Vungle"];

    // run the cocos2d-x game scene
    app->run();

    return YES;
}

- (void)applicationWillResignActive:(UIApplication*)application {
    /*<commit_msg>Fix incorrect plugin name in test project.<commit_after>//
//  AppController.cpp
//  ee_x_test
//
//  Created by Zinge on 5/17/17.
//
//

#import "AppController.h"

#import <cocos2d.h>

#import <ee/Core.hpp>

#import "AppDelegate.hpp"
#import "RootViewController.h"

@implementation AppController

@synthesize window;

#pragma mark -
#pragma mark Application lifecycle

// cocos2d application instance
static eetest::AppDelegate s_sharedApplication;

- (BOOL)application:(UIApplication*)application
    didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
    auto app = cocos2d::Application::getInstance();

    // Initialize the GLView attributes.
    app->initGLContextAttrs();
    cocos2d::GLViewImpl::convertAttrs();

    // Override point for customization after application launch.

    // Use RootViewController to manage CCEAGLView
    _viewController = [[[RootViewController alloc] init] autorelease];
    [[self viewController] setExtendedLayoutIncludesOpaqueBars:YES];
    [[self viewController] setEdgesForExtendedLayout:UIRectEdgeAll];

    // Add the view controller's view to the window and display.
    window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    [window setRootViewController:[self viewController]];
    [window makeKeyAndVisible];

    [[UIApplication sharedApplication] setStatusBarHidden:true];

    // IMPORTANT: Setting the GLView should be done after creating the
    // RootViewController
    auto glview = cocos2d::GLViewImpl::createWithEAGLView(
        (__bridge void*)[_viewController view]);
    cocos2d::Director::getInstance()->setOpenGLView(glview);

    EEPluginManager* manager = [EEPluginManager getInstance];
    [manager initializePlugins];
    [manager addPlugin:@"AdMob"];
    [manager addPlugin:@"AppLovin"];
    [manager addPlugin:@"AppsFlyer"];
    [manager addPlugin:@"CampaignReceiver"];
    [manager addPlugin:@"Facebook"];
    [manager addPlugin:@"FacebookAds"];
    [manager addPlugin:@"FirebaseCore"];
    [manager addPlugin:@"FirebaseCrashlytics"];
    [manager addPlugin:@"FirebasePerformance"];
    [manager addPlugin:@"GoogleAnalytics"];
    [manager addPlugin:@"IronSource"];
    [manager addPlugin:@"Notification"];
    [manager addPlugin:@"Play"];
    [manager addPlugin:@"Recorder"];
    [manager addPlugin:@"Tenjin"];
    [manager addPlugin:@"UnityAds"];
    [manager addPlugin:@"Vungle"];

    // run the cocos2d-x game scene
    app->run();

    return YES;
}

- (void)applicationWillResignActive:(UIApplication*)application {
    /*
{'fraction_non_alphanumeric': 0.12678571428571428, 'fraction_numerical': 0.004761904761904762, 'mean_word_length': 4.767734553775743, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7238327', 'n_tokens_mistral': 1571, 'n_tokens_neox': 1406, 'n_words': 324}