#!/usr/bin/env python
# coding:utf-8
import enum
from notification_helper import NotificationHelper
from ipm.wechat_alert import wechat_alert

# 群机器人@配置
at_all = "@all"
at_wangshan = "15175778576"
at_zhouzhuo = "15036516116"
notification_helper = NotificationHelper()
alert = wechat_alert()

class config_pipe_operation(enum.Enum):
    # 更新所有关卡资源表（包含未测试通过课程）
    update_all_levels_google_sheet = 'update_all_levels_google_sheet'
    # 更新关卡验收通过文档和FindObject关卡配置表
    update_acceptance_passed_sheet = 'update_acceptance_passed_sheet'
    # 更新Debug配置表
    update_main_level_db = 'update_main_level_db'
    # 更新国家关卡配置表
    update_main_country_level_db = 'update_main_country_level_db'

class mode(enum.Enum):
    debug = 'debug'
    release = 'release'

class config_type(enum.Enum):
    all_test_level_config = 'all_test_level_config'

# class level_state_enum(enum.Enum):
#     unaccepted_level = 0
#     unpass_level = 1
#     pass_level = 2

cdn = 'https://cdn3-find-object.fungame.cloud'
app_id = 'find-object'
domain_list = [
    'cdn3-find-object.fungame.cloud',
]

thum_bundle_prefix = 'assets_assetraw_uiraw_raw_thum'
level_bundle_prefix = 'assets_assetraw_uiraw_raw_level'
bundle_endfix = '.bundle'

# sheet信息配置
sheet_all_level = 'find_object全关卡资源表'
sheet_acceptance_passed_levels = 'find_object验收通过关卡资源表'
sheet_level_config = 'FindObject.Level.Config'
sheet_ai_localization = 'AI Localization FindObject'

# sheet table信息配置
table_all_levels = 'AllLevels'
table_main_level_type = 'main_level_type'
table_localization_play_type = '_gen_play_type'

# remote config key/group等信息配置
remote_group_level_config = 'level config group'

remote_condition_android = 'android'
remote_condition_ios = 'ios'

remote_key_main_db = 'main_db'

# storage metadata
meta_pass_count = 'pass_count'
level_state = 'level_state'
meta_find_num = 'find_num'
meta_encryption = 'encryption'
meta_spriteatlas = 'spriteatlas'
meta_hash = 'hash'
meta_md5 = 'md5'

# 机器环境配置
class machine_env_config(enum.Enum):
    # 成都MacStudio打包机
    CD_MAC_STUDIO = {
        # differences工程环境路径
        "workspace_path": "/Volumes/Predator/find-object",
        # unity安装路径
        "unity_install_path": "/Applications/Unity/Hub/Editor/2021.3.45f1/Unity.app/Contents/MacOS/Unity",
    }
    Local_Path = {
        "workspace_path": "/Users/a0729/gogs.git",
        "unity_install_path": "/Applications/Unity/Hub/Editor/2021.3.45f1/Unity.app/Contents/MacOS/Unity",
    }

def getArtProjPath(env: machine_env_config):
    return env['workspace_path'] + '/find-object-art'

def getAssetsBuildProjPath(env: machine_env_config):
    return env['workspace_path'] + '/find-object-bundle-builder'

def getUnityProjPath(env: machine_env_config):
    return getAssetsBuildProjPath(env) + '/find-object-bundle-resource'

