//------------------------------------------------------------------------------
//工具生成，请勿修改。
//配置文件名称：npc.xlsx。
//------------------------------------------------------------------------------
export default class NpcCFG
{
	public id:number;//角色id
	public name:string;//角色资源名
	public speed:number;//角色前进移动速度(米/秒)
	public frontjump:any;//前跳加速度
	public leftjump:any;//左跳加速度
	public rightjump:any;//右跳加速度
	public upclimb:number;//爬升速度
	public slideclimb:any;//斜着爬楼速度
	public jump_left:number;//向左跳跃权重
	public jump_right:number;//向右跳权重
	public start_ahead:number;//直跳权重
	public distance:number;//npc超过玩家距离停止
	public gravity:number;//重力加速度
	public static dict:any = {};
	public static vec:Array<NpcCFG> = [];
	public static initCfg(str:string):void
	{
		var i:number=0;
		var arr:Array<string> = str.split("\n");
		var i:number=0;
		for(i = 0; i < arr.length; i++)
		{
			var singleStr:string = arr[i];
			var singleArr:Array<string> = singleStr.split("&");
			if(NpcCFG.dict[singleArr[0]])continue;
			var item:NpcCFG= new NpcCFG();
			item.id= Number(singleArr[0]);
			item.name=singleArr[1];
			item.speed= Number(singleArr[2]);
			item.frontjump= JSON.parse(singleArr[3]);
			item.leftjump= JSON.parse(singleArr[4]);
			item.rightjump= JSON.parse(singleArr[5]);
			item.upclimb= Number(singleArr[6]);
			item.slideclimb= JSON.parse(singleArr[7]);
			item.jump_left= Number(singleArr[8]);
			item.jump_right= Number(singleArr[9]);
			item.start_ahead= Number(singleArr[10]);
			item.distance= Number(singleArr[11]);
			item.gravity= Number(singleArr[12]);
			NpcCFG.dict[item.id]=item;
			NpcCFG.vec.push(item);
		}
	}

}