import { Global } from "../Global";
import {RecConfigs} from "./RecConfigs";

/*
* name;
*/
export class AssetPath
{
    static  res: string = "res/";
    static  resources:string = "resources/";
    // export var configs:string = "configs/";
    static  ui:string = "ui/";
    static  subpacksgeui:string = "character/ui/"
    static  music:string = "music/";
    static  versionrandom:string = "";
    static  prop:string = "prop/"
    static  skinicon:string = "skinicon/"

    static  init():void
    {
        AssetPath.versionrandom = "?v=" + Math.random();
    }

    static  getsound( id:string ):string
    {
        return Global.getUrl( AssetPath.resources + AssetPath.music + id +".mp3" );
    }

    static  getResConfig():string
    {
        return Global.getUrl( AssetPath.resources  + "resConfig.json" );
    }

    static  getConfig( configname:string ):string
    {
        return Global.getUrl( AssetPath.resources  + configname +".bin" );
    }

    static  get3Dscene( name:any ):string
    {
        return Global.getUrl( AssetPath.res + AssetPath.prop + "Conventional/" + name + ".ls" );
    } 

    static  get3DModel( name:any ):string
    {
        return Global.getUrl( AssetPath.res + AssetPath.prop + "Conventional/" + name + ".lh" );
    }

    static  get3DRoleModel( name:any ):string
    {
        return Global.getUrl( AssetPath.res + "character/Conventional/" + name + ".lh" );
    }

    static  getroleicon( id:string ):string
    {
        return Global.getUrl( AssetPath.res  + "skinicon/" + id + ".png" );
    }

    static  getVerisonurl():string
    {
        if( Global.isdebug )
        {
            return Global.getUrl( AssetPath.res + "version.json" ) + AssetPath.versionrandom;
        }
        return Global.getUrl( AssetPath.res + "version" + Global.resconfigVersion + ".json" );
    }

    static  getGameVersion():string
    {
        return Global.getUrl( "gameversion.json" );
    }

    /**获取匹配人物头像icon */
    static pipeiicon (id:string):string{
        return Global.getUrl( AssetPath.res  + "icon/" + id + ".png" );
    }

  
} 