import { ryw_Event } from "../../FrameWork/Event/EventEnum";
import EventMgr from "../../FrameWork/Event/EventMgr";
import User from "../../FrameWork/User/User";

import DustbinManager from "./DustbinManager";

import ShouLieManager from "./ShouLieManager";
import TaoFenManager from "./TaoFenManager";

import Common5 from "../../Platform/th/Common5";

import QinWangLingManager from "./QinWangLingManager";
import ChaChangManager from "./ChaChangManager";
import XiuXianNongZhuangManager from "./XiuXianNongZhuangManager";
import BaiCaoJiManager from "./BaiCaoJiManager";
import BuyShopManager from "./BuyShopManager";


//物品编号
export enum GOODS_NUMBER{ 
    
}

/**
 * 物品分类
 */
export enum GOODS_NTYPE {
    type_yuanliao, //原料
    type_wupin, //物品
    type_sipu, //食谱
}
/**
 * 物品用途 全部物品可以卖出可地摊交易, 部分可以锻造合成,部分可以女儿衣食住行,部分可以房屋改造
 */
export enum GOODS_USE {
    type_null=0, //无
    type_hecheng=1,//锻造合成原料
    type_yisizhuxing,//女儿衣食住行
    type_fangwugaizao,//房屋改造
    type_xiaochijie,//小吃街
    
}
/**
 * 物品在本地的配置
 */
export interface GoodsLocalProperty{
    goodId:GOODS_NUMBER,
    goodNum:number,

}
/**
 * 物品属性配置
 */
export interface GoodsProperty{
    goodId:GOODS_NUMBER,
    goodName:string,
    descStr:string,
    priceNum:number,
    isCanSale:boolean,
    isCanInBag:boolean,
    ditanLevel:number, //地摊等级
    hechengLevel:number,

}


//物品配置表
export let BagGoodsConfig = [
    // { goodId: 10001,huoYuan:'', gameType:'', buyNum:1,isCanFreeOut:false, GMGameType:'',goodName: '辣椒炒肉', priceNum: 20000, descStr: '辣椒炒肉' ,gamePro:true},
    // { goodId: 10002, gameType:'', buyNum:1, goodName: '东坡肉', priceNum: 20000, descStr: '东坡肉'  ,gamePro:true},
    // { goodId: 10003, gameType:'', buyNum:1, goodName: '菠萝排骨', priceNum: 20000, descStr: '菠萝排骨'  ,gamePro:true},
    // { goodId: 10004, gameType:'', buyNum:1, goodName: '爆炒灵兽肉', priceNum: 20000, descStr: '爆炒灵兽肉'  ,gamePro:true},
   
    // { goodId: 20001, gameType:'', buyNum:1, goodName: '抹布', priceNum: 20000, descStr: '抹布'  ,gamePro:true},
    // { goodId: 20002, gameType:'', buyNum:1, goodName: '照明灯', priceNum: 20000, descStr: '照明灯'  ,gamePro:true},
    // { goodId: 20003, gameType:'', buyNum:1, goodName: '摊位招牌', priceNum: 20000, descStr: '摊位招牌'  ,gamePro:true},

    { gameType:'',huoYuan:'', isCanFreeOut:true,GMGameType:'ShouLie',buyNum:1,saveNum:1, goodId:1701,descStr:'九阳草',goodName:'九阳草', priceNum:0, gamePro:true},
    { gameType:'',huoYuan:'', isCanFreeOut:true,GMGameType:'ShouLie',buyNum:1,saveNum:1, goodId:1702,descStr:'寒焰花',goodName:'寒焰花', priceNum:0, gamePro:true},
    { gameType:'',huoYuan:'', isCanFreeOut:true,GMGameType:'ShouLie',buyNum:1,saveNum:1, goodId:1703,descStr:'霜心果',goodName:'霜心果', priceNum:0, gamePro:true},

    { gameType:'',huoYuan:'yuchuan', isCanFreeOut:false,GMGameType:'',buyNum:1,saveNum:1, goodId:1704,descStr:'驱魔珠',goodName:'驱魔珠', priceNum:0, gamePro:true},
    { gameType:'',huoYuan:'yuchuan', isCanFreeOut:false,GMGameType:'',buyNum:1,saveNum:1, goodId:1705,descStr:'定心石',goodName:'定心石', priceNum:0, gamePro:true},
    { gameType:'',huoYuan:'yuchuan', isCanFreeOut:false,GMGameType:'',buyNum:1,saveNum:1, goodId:1706,descStr:'麒麟晶',goodName:'麒麟晶', priceNum:0, gamePro:true},
    { gameType:'',huoYuan:'yuchuan', isCanFreeOut:false,GMGameType:'',buyNum:1,saveNum:1, goodId:1707,descStr:'辟邪玉',goodName:'辟邪玉', priceNum:0, gamePro:true},
    { gameType:'',huoYuan:'yuchuan', isCanFreeOut:false,GMGameType:'',buyNum:1,saveNum:1, goodId:1708,descStr:'灵魂锁',goodName:'灵魂锁', priceNum:0, gamePro:true},

    { gameType:'',huoYuan:'', isCanFreeOut:false,GMGameType:'',buyNum:1,saveNum:1, goodId:1722,descStr:'身份卡',goodName:'身份卡', priceNum:0, gamePro:true},
    { gameType:'',huoYuan:'shipu', isCanFreeOut:false,GMGameType:'',buyNum:1,saveNum:1, goodId:1721,descStr:'清炖饕餮蹄',goodName:'清炖饕餮蹄', priceNum:0, gamePro:true},
    
    { gameType:'',huoYuan:'kaikuang', isCanFreeOut:false,GMGameType:'',buyNum:1,saveNum:1, goodId:1711,descStr:'金源石',goodName:'金源石', priceNum:0, gamePro:true},
    { gameType:'',huoYuan:'kaikuang', isCanFreeOut:false,GMGameType:'',buyNum:1,saveNum:1, goodId:1712,descStr:'木源石',goodName:'木源石', priceNum:0, gamePro:true},
    { gameType:'',huoYuan:'kaikuang', isCanFreeOut:false,GMGameType:'',buyNum:1,saveNum:1, goodId:1713,descStr:'水源石',goodName:'水源石', priceNum:0, gamePro:true},
    { gameType:'',huoYuan:'kaikuang', isCanFreeOut:false,GMGameType:'',buyNum:1,saveNum:1, goodId:1714,descStr:'火源石',goodName:'火源石', priceNum:0, gamePro:true},
    { gameType:'',huoYuan:'kaikuang', isCanFreeOut:false,GMGameType:'',buyNum:1,saveNum:1, goodId:1715,descStr:'土源石',goodName:'土源石', priceNum:0, gamePro:true},

    { gameType:'',huoYuan:'ChaoFanLin', isCanFreeOut:true,GMGameType:'',buyNum:1,saveNum:1, goodId:1716,descStr:'青龙鼎',goodName:'青龙鼎', priceNum:0, gamePro:true},
    { gameType:'',huoYuan:'ChaoFanLin', isCanFreeOut:true,GMGameType:'',buyNum:1,saveNum:1, goodId:1717,descStr:'白虎鼎',goodName:'白虎鼎', priceNum:0, gamePro:true},
    { gameType:'',huoYuan:'ChaoFanLin', isCanFreeOut:true,GMGameType:'',buyNum:1,saveNum:1, goodId:1718,descStr:'朱雀鼎',goodName:'朱雀鼎', priceNum:0, gamePro:true},
    { gameType:'',huoYuan:'ChaoFanLin', isCanFreeOut:true,GMGameType:'',buyNum:1,saveNum:1, goodId:1719,descStr:'玄武鼎',goodName:'玄武鼎', priceNum:0, gamePro:true},
    { gameType:'',huoYuan:'ChaoFanLin', isCanFreeOut:true,GMGameType:'',buyNum:1,saveNum:1, goodId:1720,descStr:'麒麟鼎',goodName:'麒麟鼎', priceNum:0, gamePro:true}, 
    
    { gameType:'',huoYuan:'', isCanFreeOut:true,GMGameType:'',buyNum:1,saveNum:1, goodId:1723,descStr:'辣椒炒肉',goodName:'辣椒炒肉', priceNum:0, gamePro:true}, 
    { gameType:'',huoYuan:'', isCanFreeOut:true,GMGameType:'',buyNum:1,saveNum:1, goodId:1724,descStr:'酸溜土豆丝',goodName:'酸溜土豆丝', priceNum:0, gamePro:true}, 
    { gameType:'',huoYuan:'', isCanFreeOut:true,GMGameType:'',buyNum:1,saveNum:1, goodId:1725,descStr:'清炖饕餮蹄',goodName:'清炖饕餮蹄', priceNum:0, gamePro:true}, 
    { gameType:'',huoYuan:'', isCanFreeOut:true,GMGameType:'',buyNum:1,saveNum:1, goodId:1726,descStr:'菠萝排骨',goodName:'菠萝排骨', priceNum:0, gamePro:true}, 

    { gameType: '', isCanFreeOut: true, GMGameType: 'JiuPingHuiShou', buyNum: 0, saveNum: 1, goodId: 3620, descStr: '剁椒', goodName: '剁椒', priceNum: 100, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: 'JiuPingHuiShou', buyNum: 0, saveNum: 1, goodId: 3621, descStr: '料酒', goodName: '料酒', priceNum: 80, gamePro: true },
    { gameType: '', isCanFreeOut: false, GMGameType: 'JiuPingHuiShou', buyNum: 0, saveNum: 1, goodId: 3622, descStr: '鳙鱼', goodName: '鳙鱼', priceNum: 500, gamePro: true },

    { gameType: '', isCanFreeOut: true, GMGameType: 'ShiCaiHuiShou', buyNum: 0, saveNum: 1, goodId: 3630, descStr: '鸡肉', goodName: '鸡肉', priceNum: 100, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: 'ShiCaiHuiShou', buyNum: 0, saveNum: 1, goodId: 3631, descStr: '花生', goodName: '花生', priceNum: 80, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: 'ShiCaiHuiShou', buyNum: 0, saveNum: 1, goodId: 3632, descStr: '花椒', goodName: '花椒', priceNum: 50, gamePro: true },
    { gameType: '', isCanFreeOut: false, GMGameType: 'ShiCaiHuiShou', buyNum: 0, saveNum: 1, goodId: 3633, descStr: '干辣椒', goodName: '干辣椒', priceNum: 50, gamePro: true },

    { gameType: '', isCanFreeOut: true, GMGameType: 'ShiCaiHuiShou', buyNum: 0, saveNum: 1, goodId: 3640, descStr: '甲鱼', goodName: '甲鱼', priceNum: 100, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: 'ShiCaiHuiShou', buyNum: 0, saveNum: 1, goodId: 3641, descStr: '乌鸡', goodName: '乌鸡', priceNum: 80, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: 'ShiCaiHuiShou', buyNum: 0, saveNum: 1, goodId: 3642, descStr: '大枣', goodName: '大枣', priceNum: 50, gamePro: true },
    { gameType: '', isCanFreeOut: false, GMGameType: 'ShiCaiHuiShou', buyNum: 0, saveNum: 1, goodId: 3643, descStr: '枸杞', goodName: '枸杞', priceNum: 50, gamePro: true },
    { gameType: '', isCanFreeOut: false, GMGameType: 'ShiCaiHuiShou', buyNum: 0, saveNum: 1, goodId: 3644, descStr: '陈皮', goodName: '陈皮', priceNum: 50, gamePro: true },

    { gameType: '', isCanFreeOut: true, GMGameType: 'ShiCaiHuiShou', buyNum: 0, saveNum: 1, goodId: 3650, descStr: '猪肉', goodName: '猪肉', priceNum: 100, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: 'ShiCaiHuiShou', buyNum: 0, saveNum: 1, goodId: 3651, descStr: '猪蹄筋', goodName: '猪蹄筋', priceNum: 800, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: 'ShiCaiHuiShou', buyNum: 0, saveNum: 1, goodId: 3652, descStr: '火腿', goodName: '火腿', priceNum: 500, gamePro: true },
    { gameType: '', isCanFreeOut: false, GMGameType: 'ShiCaiHuiShou', buyNum: 0, saveNum: 1, goodId: 3653, descStr: '鸭肉', goodName: '鸭肉', priceNum: 50, gamePro: true },
    { gameType: '', isCanFreeOut: false, GMGameType: 'ShiCaiHuiShou', buyNum: 0, saveNum: 1, goodId: 3654, descStr: '干笋', goodName: '干笋', priceNum: 50, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: 'ShiCaiHuiShou', buyNum: 0, saveNum: 1, goodId: 3655, descStr: '粉丝', goodName: '粉丝', priceNum: 50, gamePro: true },

    { gameType: '', isCanFreeOut: true, GMGameType: 'KuaiDiZhan', buyNum: 0, saveNum: 1, goodId: 3660, descStr: '草鱼', goodName: '草鱼', priceNum: 100, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: 'KuaiDiZhan', buyNum: 0, saveNum: 1, goodId: 3661, descStr: '香醋', goodName: '香醋', priceNum: 80, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: 'KuaiDiZhan', buyNum: 0, saveNum: 1, goodId: 3662, descStr: '米酒', goodName: '米酒', priceNum: 50, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: 'KuaiDiZhan', buyNum: 0, saveNum: 1, goodId: 3663, descStr: '辣椒', goodName: '辣椒', priceNum: 50, gamePro: true },
    { gameType: '', isCanFreeOut: false, GMGameType: 'KuaiDiZhan', buyNum: 0, saveNum: 1, goodId: 3664, descStr: '桂皮', goodName: '桂皮', priceNum: 50, gamePro: true },
    { gameType: '', isCanFreeOut: false, GMGameType: 'KuaiDiZhan', buyNum: 0, saveNum: 1, goodId: 3665, descStr: '女儿红', goodName: '女儿红', priceNum: 50, gamePro: true },
    { gameType: '', isCanFreeOut: false, GMGameType: 'KuaiDiZhan', buyNum: 0, saveNum: 1, goodId: 3666, descStr: '酱油', goodName: '酱油', priceNum: 50, gamePro: true },

    { gameType: '', isCanFreeOut: true, GMGameType: 'ShiCaiHuiShou', buyNum: 0, saveNum: 1, goodId: 3670, descStr: '干香菇', goodName: '干香菇', priceNum: 1000, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: 'ShiCaiHuiShou', buyNum: 0, saveNum: 1, goodId: 3671, descStr: '鱼唇', goodName: '鱼唇', priceNum: 800, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: 'ShiCaiHuiShou', buyNum: 0, saveNum: 1, goodId: 3672, descStr: '瑶柱', goodName: '瑶柱', priceNum: 500, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: 'ShiCaiHuiShou', buyNum: 0, saveNum: 1, goodId: 3673, descStr: '鲍鱼', goodName: '鲍鱼', priceNum: 500, gamePro: true },
    { gameType: '', isCanFreeOut: false, GMGameType: 'ShiCaiHuiShou', buyNum: 0, saveNum: 1, goodId: 3674, descStr: '河虾', goodName: '河虾', priceNum: 500, gamePro: true },
    { gameType: '', isCanFreeOut: false, GMGameType: 'ShiCaiHuiShou', buyNum: 0, saveNum: 1, goodId: 3675, descStr: '鸽蛋', goodName: '鸽蛋', priceNum: 50, gamePro: true },
    { gameType: '', isCanFreeOut: false, GMGameType: 'ShiCaiHuiShou', buyNum: 0, saveNum: 1, goodId: 3676, descStr: '花胶', goodName: '花胶', priceNum: 50, gamePro: true },
    { gameType: '', isCanFreeOut: false, GMGameType: 'ShiCaiHuiShou', buyNum: 0, saveNum: 1, goodId: 3677, descStr: '鱼翅', goodName: '鱼翅', priceNum: 500, gamePro: true },

    { gameType: '', isCanFreeOut: true, GMGameType: 'RenWu', buyNum: 0, saveNum: 1, goodId: 3680, descStr: '剁椒鱼头', goodName: '剁椒鱼头', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: 'RenWu', buyNum: 0, saveNum: 1, goodId: 3681, descStr: '宫保鸡丁', goodName: '宫保鸡丁', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: 'RenWu', buyNum: 0, saveNum: 1, goodId: 3682, descStr: '霸王别姬', goodName: '霸王别姬', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: 'RenWu', buyNum: 0, saveNum: 1, goodId: 3683, descStr: '徽州一品鲜', goodName: '徽州一品鲜', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: 'RenWu', buyNum: 0, saveNum: 1, goodId: 3684, descStr: '西湖醋鱼', goodName: '西湖醋鱼', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: 'RenWu', buyNum: 0, saveNum: 1, goodId: 3685, descStr: '佛跳墙', goodName: '佛跳墙', priceNum: 0, gamePro: true },

    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3700, descStr: '无广卷', goodName: '无广卷', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3701, descStr: '龙虾', goodName: '龙虾', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3702, descStr: '蟹', goodName: '蟹', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3703, descStr: '海参', goodName: '海参', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3704, descStr: '猪肉', goodName: '猪肉', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3705, descStr: '牛肉', goodName: '牛肉', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3706, descStr: '羊肉', goodName: '羊肉', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3707, descStr: '鸡肉', goodName: '鸡肉', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3708, descStr: '驴肉', goodName: '驴肉', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3709, descStr: '香菇', goodName: '香菇', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3710, descStr: '胡萝卜', goodName: '胡萝卜', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3711, descStr: '木耳', goodName: '木耳', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3712, descStr: '五花肉', goodName: '五花肉', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3713, descStr: '虾仁', goodName: '虾仁', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3714, descStr: '花枝肉', goodName: '花枝肉', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3715, descStr: '红茶', goodName: '红茶', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3716, descStr: '绿茶', goodName: '绿茶', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3717, descStr: '黑茶', goodName: '黑茶', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3718, descStr: '白茶', goodName: '白茶', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3719, descStr: '乌龙茶', goodName: '乌龙茶', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3720, descStr: '黄茶', goodName: '黄茶', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3721, descStr: '铁观音', goodName: '铁观音', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3722, descStr: '玫瑰', goodName: '玫瑰', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3723, descStr: '玉兰', goodName: '玉兰', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3724, descStr: '菊花', goodName: '菊花', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3725, descStr: '桂花', goodName: '桂花', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3726, descStr: '茉莉花', goodName: '茉莉花', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3727, descStr: '百合', goodName: '百合', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3728, descStr: '油菜花', goodName: '油菜花', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3729, descStr: '栀子花', goodName: '栀子花', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3730, descStr: '龙珠(紫)', goodName: '龙珠(紫)', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3731, descStr: '龙珠(青)', goodName: '龙珠(青)', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3732, descStr: '龙珠(蓝)', goodName: '龙珠(蓝)', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3733, descStr: '龙珠(橙)', goodName: '龙珠(橙)', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3734, descStr: '龙珠(绿)', goodName: '龙珠(绿)', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3735, descStr: '龙珠(黄)', goodName: '龙珠(黄)', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3736, descStr: '龙珠(红)', goodName: '龙珠(红)', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3737, descStr: '古钱币', goodName: '古钱币', priceNum: 300000000, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3738, descStr: '钱袋子', goodName: '钱袋子', priceNum: 0, gamePro: true },
    { gameType: '', isCanFreeOut: true, GMGameType: '', buyNum: 0, saveNum: 1, goodId: 3739, descStr: '等级提升', goodName: '等级提升', priceNum: 0, gamePro: true },
]

export let BagGoodsProductConfig = [
    {  goodId:1835, goodName:'真夜明珠',  priceNum:480000, descStr:'真夜明珠' },
    {  goodId:1836, goodName:'假夜明珠',  priceNum:40000, descStr:'假夜明珠' },
    {  goodId:1837, goodName:'真手镯',  priceNum:1500000, descStr:'真手镯' },
    {  goodId:1838, goodName:'假手镯',  priceNum:125000, descStr:'假手镯' },
    {  goodId:1839, goodName:'真红豆',  priceNum:3420000, descStr:'真红豆' },
    {  goodId:1840, goodName:'假红豆',  priceNum:285000, descStr:'假红豆' },
    {  goodId:1841, goodName:'真俑头',  priceNum:4800000, descStr:'真俑头' },
    {  goodId:1842, goodName:'假俑头',  priceNum:400000, descStr:'假俑头' },
	{  goodId:1843, goodName:'真唐三彩',  priceNum:6720000, descStr:'真唐三彩' },
    {  goodId:1844, goodName:'假唐三彩',  priceNum:504000, descStr:'假唐三彩' },
	{  goodId:1845, goodName:'真白菜',  priceNum:17100000, descStr:'真白菜' },
    {  goodId:1846, goodName:'假白菜',  priceNum:1282500, descStr:'假白菜' },
    {  goodId:1847, goodName:'真兵马俑',  priceNum:24000000, descStr:'真兵马俑' },
	{  goodId:1848, goodName:'假兵马俑',  priceNum:1800000, descStr:'假兵马俑' },
    {  goodId:1849, goodName:'真面具',  priceNum:30000000, descStr:'真面具' },
	{  goodId:1850, goodName:'假面具',  priceNum:2250000, descStr:'假面具' },
    {  goodId:1851, goodName:'真金佛',  priceNum:48000000, descStr:'真金佛' },
    {  goodId:1852, goodName:'假金佛',  priceNum:3600000, descStr:'假金佛' },
	{  goodId:1853, goodName:'真青花瓷瓶',  priceNum:50000000, descStr:'真青花瓷瓶' },
    {  goodId:1854, goodName:'假青花瓷瓶',  priceNum:3500000, descStr:'假青花瓷瓶' },
	{  goodId:1855, goodName:'真青花瓷盘',  priceNum:82500000, descStr:'真青花瓷盘' },
    {  goodId:1856, goodName:'假青花瓷盘',  priceNum:5610000, descStr:'假青花瓷盘' },
    {  goodId:1857, goodName:'真陶俑',  priceNum:100000000, descStr:'真陶俑' },
	{  goodId:1858, goodName:'假陶俑',  priceNum:6600000, descStr:'假陶俑' },
    {  goodId:1859, goodName:'真僵尸',  priceNum:140000000, descStr:'真僵尸' },
	{  goodId:1860, goodName:'假僵尸',  priceNum:8960000, descStr:'假僵尸' },
    {  goodId:1861, goodName:'真佛像',  priceNum:160000000, descStr:'真佛像' },
    {  goodId:1862, goodName:'假佛像',  priceNum:9920000, descStr:'假佛像' },
	{  goodId:1863, goodName:'真翡翠',  priceNum:160000000, descStr:'真翡翠' },
    {  goodId:1864, goodName:'假翡翠',  priceNum:12000000, descStr:'假翡翠' },
	{  goodId:1865, goodName:'真琉璃瓶',  priceNum:200000000, descStr:'真琉璃瓶' },
    {  goodId:1866, goodName:'假琉璃瓶',  priceNum:14000000, descStr:'假琉璃瓶' },
    {  goodId:1867, goodName:'真小口罐',  priceNum:240000000, descStr:'真小口罐' },
	{  goodId:1868, goodName:'假小口罐',  priceNum:16800000, descStr:'假小口罐' },
    {  goodId:1869, goodName:'真权杖',  priceNum:210000000, descStr:'真权杖' },
	{  goodId:1870, goodName:'假权杖',  priceNum:17500000, descStr:'假权杖' },
]

export let fishDataConfigs = [
    { goodId: 4001, goodName: '龙虾', priceNum: 20000000000, descStr: '龙虾' },
    { goodId: 4002, goodName: '小丑鱼', priceNum: 40000000000, descStr: '小丑鱼' },
    { goodId: 4003, goodName: '螃蟹', priceNum: 70000000000, descStr: '螃蟹' },
    { goodId: 4004, goodName: '蚌壳', priceNum: 20000000000, descStr: '蚌壳' },
    { goodId: 4005, goodName: '海星', priceNum: 25000000000, descStr: '海星' },
    { goodId: 4006, goodName: '鳖', priceNum: 60000000000, descStr: '鳖' },
    { goodId: 4007, goodName: '海胆', priceNum: 29000000000, descStr: '海胆' },
    { goodId: 4008, goodName: '海鱼1', priceNum: 20000000000, descStr: '海鱼1' },
    { goodId: 4009, goodName: '海鱼2', priceNum: 50000000000, descStr: '海鱼2' },
    { goodId: 4010, goodName: '海鱼3', priceNum: 20000000000, descStr: '海鱼3' },

    { goodId: 4011, goodName: '电鳗', priceNum: 30000000000, descStr: '电鳗' },
    { goodId: 4012, goodName: '章鱼', priceNum: 90000000000, descStr: '章鱼' },
    { goodId: 4013, goodName: '海鱼4', priceNum: 70000000000, descStr: '海鱼4' },
    { goodId: 4014, goodName: '海鱼5', priceNum: 29000000000, descStr: '海鱼5' },
    
    { goodId: 4015, goodName: '木箱', priceNum: 20000000000, descStr: '木箱' },
    { goodId: 4016, goodName: '木箱', priceNum: 20000000000, descStr: '木箱' },
    
    { goodId: 4017, goodName: '机械鲨鱼', buyNum: 1, saveNum: 1,priceNum: 0, descStr: '机械鲨鱼', isFish: true ,gamePro: true},
    { goodId: 4018, goodName: '七彩水母', buyNum: 1, saveNum: 1,priceNum: 0, descStr: '七彩水母', isFish: true,gamePro: true },
    { goodId: 4019, goodName: '巨头鲲', buyNum: 1, saveNum: 1,priceNum: 0, descStr: '鲲鹏', isFish: true ,gamePro: true},
    { goodId: 4020, goodName: '深海龟王', buyNum: 1, saveNum: 1,priceNum: 0, descStr: '赑屃', isFish: true,gamePro: true },

    { goodId: 4021, goodName: '刺豚',buyNum: 1, saveNum: 1, priceNum: 0, descStr: '刺豚', isFish: true ,gamePro: true},
    { goodId: 4022, goodName: '大黄鱼', buyNum: 1, saveNum: 1,priceNum: 0, descStr: '大黄鱼', isFish: true ,gamePro: true},
    { goodId: 4023, goodName: '长腿虾',buyNum: 1, saveNum: 1, priceNum: 0, descStr: '长腿虾', isFish: true ,gamePro: true},
    { goodId: 4024, goodName: '海参',buyNum: 1, saveNum: 1, priceNum: 0, descStr: '海参', isFish: true,gamePro: true },

    { goodId: 4025, goodName: '烟斗龟',buyNum: 1, saveNum: 1, priceNum: 0, descStr: '烟斗龟', isFish: true ,gamePro: true},
    { goodId: 4026, goodName: '黄金海马',buyNum: 1, saveNum: 1, priceNum: 0, descStr: '黄金海马', isFish: true,gamePro: true },


]

export default class BagManager{


    public static initBagManager(){
 
    }

    //加入背包
    public static addBagList(tab:GoodsLocalProperty){
        User.addBagGoodsList(tab)
        // let list_ = BagGoodsConfig
        // for(let value of list_){
        //     let tab2 = {
        //         goodId:value.goodId,
        //         goodNum:1,
        //     }
        //     User.addBagGoodsList(tab2)
        // }

        EventMgr.emitEvent_custom(ryw_Event.RefreshCurJinHuoDesc)
    }

    //删除背包数据
    public static subBagList(goodId:GOODS_NUMBER, goodIdNum:number = 1){
        User.subBagGoodsList(goodId,goodIdNum)
        EventMgr.emitEvent_custom(ryw_Event.updateBagDate)
    }
    //ditan删除背包数据
    public static subBagDitanList(goodId:GOODS_NUMBER, goodIdNum:number = 1){
        let goodIdNum_ = goodIdNum
        User.subBagGoodsList(goodId, goodIdNum_)
        EventMgr.emitEvent_custom(ryw_Event.updateBagDate, {goodId:goodId})
    }

    //获取全部背包数据
    public static getBagList(){

        let list_ = User.getBagGoodsList()
        let tempBagList = []
        for(let i = 0; i<list_.length;i++){
            
            if(list_[i].goodId != 0){
                tempBagList[tempBagList.length] = list_[i]
            }
        }
        return tempBagList
    }

    //获取任务道具的背包
    public static getBagTaskProList(){
        let list_ = User.getBagGoodsList()
        let tempBagList = []
        for(let i = 0; i<list_.length;i++){
            let valueData = this.getGoodsProperty(list_[i].goodId)
            if(valueData && valueData.gamePro){
                tempBagList[tempBagList.length] =  list_[i]
            }
        }

        return tempBagList
    }

    //获取非道具的背包
    public static getBagProList(){
        let list_ = User.getBagGoodsList()
        let tempBagList = []
        for(let i = 0; i<list_.length;i++){
            let valueData = this.getGoodsProperty(list_[i].goodId)
            if(valueData && !valueData.gamePro ){
                tempBagList[tempBagList.length] = list_[i]
            }
        }

        return tempBagList
    }

    //获取背包中特定物品数据
    public static getBagGoodConfig(goodId:GOODS_NUMBER){
        let list = this.getBagList()
        for(var i=0;i<list.length;i++){
            if(list[i].goodId == goodId){
                return list[i]
            }
        }
        return null
    }
    //获取背包中特定物品数量
    public static getBagGoodNums(goodId:GOODS_NUMBER){
        let list = this.getBagList()
        let goodsData = null
        for(var i=0;i<list.length;i++){
            if(list[i].goodId == goodId){
                goodsData =  list[i]
            }
        }

        if(goodsData){
            return goodsData.goodNum
        }else{
            return 0
        }
        
    }

    public static getGoodsDesc(goodsId:GOODS_NUMBER):any{

        
        let value = this.getGoodsProperty(goodsId)
        if(value && value.descStr){
            return value
        }else{
            return ''
        }

        
    }

    public static getIconValue(list_, goodsId){
        for(let value of list_){
            if(value.goodId == goodsId){
                return value
            }
        }
        return null
    }
    //获取物品属性
    public static getGoodsProperty(goodsId:GOODS_NUMBER):any{

        let list_ = null
        let vaule = null


        if(goodsId>= 1200 && goodsId<=1299){
     
            list_ = ShouLieManager.getCurGoodList()
            vaule = this.getIconValue(list_, goodsId)
            if(vaule){
                return vaule
            }
        }




        if(goodsId>= 1100 && goodsId<=1199){
            list_ = DustbinManager.getCurGoodList()
            vaule = this.getIconValue(list_, goodsId)
            if(vaule){
                return vaule
            }
        }
        if(goodsId>= 1600 && goodsId<=1630){
            list_ = TaoFenManager.getCurGoodList()
            vaule = this.getIconValue(list_, goodsId)
            if(vaule){
                return vaule
            }
        }

        if(goodsId>= 2101 && goodsId<=2120){
            list_ = QinWangLingManager.getManagerConfigs()
            vaule = this.getIconValue(list_, goodsId)
            if(vaule){
                return vaule
            }
        }
        
        if(goodsId>= 2001 && goodsId<=2012){ 
            list_ = ChaChangManager.getManagerConfigs()
            vaule = this.getIconValue(list_, goodsId)
            if(vaule){
                return vaule
            }
        }

        if(goodsId>= 1501 && goodsId<=1524){
            list_ = XiuXianNongZhuangManager.getManagerConfigs()
            vaule = this.getIconValue(list_, goodsId)
            if(vaule){
                return vaule
            }
        }
        
        if(goodsId>= 1401 && goodsId<=1420){ 
            list_ = BaiCaoJiManager.getManagerConfigs()
            vaule = this.getIconValue(list_, goodsId)
            if(vaule){
                return vaule
            }
        }

        if(goodsId>= 1421 && goodsId<=1423){ 
            list_ = BaiCaoJiManager.getGuShuManagerConfigs()
            vaule = this.getIconValue(list_, goodsId)
            if(vaule){
                return vaule
            }
        }

        if (goodsId >= 3101 && goodsId <= 3199) {
            list_ = BuyShopManager.getManagerConfigs()
            vaule = this.getIconValue(list_, goodsId)
            if (vaule) {
                return vaule
            }
        }


        //菜单物品
        list_ = Common5.caiPuConfigs
        vaule = this.getIconValue(list_, goodsId)
        if(vaule){
            return vaule
        }

        //古董物品
        list_ = BagGoodsProductConfig
        vaule = this.getIconValue(list_, goodsId)
        if(vaule){
            return vaule
        }

        //剧情道具物品
        list_ = BagGoodsConfig
        for(let value of list_){
            if(value.goodId == goodsId){
                return value
            }
        }
    
        list_ = fishDataConfigs
        for(let value of list_){
            if(value.goodId == goodsId){
                return value
            }
        }
    

        return null
    }

    public static addGoodListTest(){
        let list_ = BagGoodsConfig
        for(let value of list_){
            let bagConfig = {
                goodId:value.goodId,
                goodNum:1
            }
            BagManager.addBagList(bagConfig)
        }
    }
    // isRentOut
    public static getBagGoodsCanRentOut(){
        
        let daoyeGoodList  = User.getDaoyeGoodList()

        let rentOut = []
        let list = this.getBagList()
        for(var i=0;i<list.length;i++){
            let goodConfig = BagManager.getGoodsProperty(list[i].goodId)
            if(goodConfig && !goodConfig.gamePro){
                //倒爷物品不能摆摊卖出
                let isDaoYeWuPin = false
                for(let j=0;j<daoyeGoodList.length;j++){
                    if(daoyeGoodList[j].goodId == list[i].goodId){
                        isDaoYeWuPin = true
                        break
                    }
                }
                if(!isDaoYeWuPin){
                    rentOut.push(list[i])
                }
            }
        }
        
        return rentOut
        
    }
    public static getBagGoodIdByGoodName(goodName){
        let goodId = 0
        for(let value of BagGoodsProductConfig){
            if(value.goodName ==  goodName){
                goodId = value.goodId
                break
            }
        }
        return goodId
  
    }
    public static getBagGoodsNumByGoodName(goodName){
        let goodId = 0
        for(let value of BagGoodsProductConfig){
            if(value.goodName ==  goodName){
                goodId = value.goodId
                break
            }
        }

        let goodNum = BagManager.getBagGoodNums(goodId)
        return goodNum
  
    }
    public static getJuQingGoodConfig(goodsId){
        for(let value of BagGoodsConfig){
            if(value.goodId == goodsId){
                return value
            }
        }
    }
    

    public static isHaveAllGood(goodArray){
        
        let haveAll = true
        for(let i = 0; i<goodArray.length;i++){
            if(BagManager.getBagGoodNums(goodArray[i])>0){

            }else{
                haveAll = false
                break
            }
        }

        return haveAll
    }
}