//
//  ADScene.swift
//

/**
 随机壁纸的广告;
 ca-app-pub-4941656534177879/9888331446  下载的激励广告
 ca-app-pub-4941656534177879/5488145330 开屏广告
 ca-app-pub-4941656534177879/2201413111 播放的插屏广告（冷启动后，每个播放列表只展示一次，就是比如第一次点击没出，继续拉取，第二次点击出，第二次没出，第三次出）
 ca-app-pub-4941656534177879/9397376852 搜索广告（每次第一次点击搜索框出广告）
 */

import ADManager
import Foundation

// TODO: !!!

// #if DEBUG
// private let GAD_ID_Launch                   = "ca-app-pub-3940256099942544/5575463023"
// private let GAD_ID_Search_Insert            = "ca-app-pub-3940256099942544/4411468910"
// private let GAD_ID_Play_Insert              = "ca-app-pub-3940256099942544/4411468910"
// private let GAD_ID_Download_Reward          = "ca-app-pub-3940256099942544/1712485313"
// private let GAD_ID_Playlist                 = "ca-app-pub-3940256099942544/4411468910"
// private let GAD_ID_Pause                    = "ca-app-pub-3940256099942544/4411468910"

// #else

//// 开屏广告
private let GAD_ID_Launch = "ca-app-pub-4941656534177879/5488145330"
// 点击搜索时弹出的插屏广告
private let GAD_ID_Search_Insert = "ca-app-pub-4941656534177879/9397376852"
// 播放视频时弹出的插屏广告
private let GAD_ID_Play_Insert = "ca-app-pub-4941656534177879/2201413111"
// 下载视频弹出的激励广告
private let GAD_ID_Download_Reward = "ca-app-pub-4941656534177879/9888331446"
// 歌单
private let GAD_ID_Playlist = "ca-app-pub-4941656534177879/3683573641"
// 暂停
private let GAD_ID_Pause = "ca-app-pub-4941656534177879/7350252261"

// #endif

enum ADScene: CaseIterable, ADSceneProtocol {
    case unknow
    case launch // 开屏

    case searchInsert // 进入搜索，插屏广告
    case playInsert // 第一次进入视频播放，插屏广告
    case downloadReward // 下载视频，激励广告
    case playlist
    case pause

    static var prepareScenes: [ADScene] {
        return [.searchInsert, .playInsert, .downloadReward, .playlist, .pause]
    }

    var adId: String {
        switch self {
        case .launch:
            return GAD_ID_Launch
        case .searchInsert:
            return GAD_ID_Search_Insert
        case .playInsert:
            return GAD_ID_Play_Insert
        case .downloadReward:
            return GAD_ID_Download_Reward
        case .playlist:
            return GAD_ID_Playlist
        case .pause:
            return GAD_ID_Pause
        case .unknow:
            return ""
        }
    }

    var adType: ADType {
        switch self {
        case .launch:
            return .launch
        case .searchInsert, .playInsert, .playlist,.pause:
            return .interstitial
        case .downloadReward:
            return .reward
        case .unknow:
            return .unknow
        }
    }
}
