import { _decorator, Component, Node } from 'cc'; import { item_type, shop_item_type } from '../constant'; const { ccclass, property } = _decorator; @ccclass('ItemDataConfig') export default class ItemDataConfig { private static _instance: ItemDataConfig | null = null; public static get Instance() { if (ItemDataConfig._instance === null){ ItemDataConfig._instance = new ItemDataConfig(); ItemDataConfig._instance.initItem() } return ItemDataConfig._instance; } public getItemById(id:string):itemData{ return ItemDataConfig.Instance.item_config.get(id) } public getShopQipanList():any[]{ let tempArray = [] // for (let index = 1; index <= 19; ) { // var count = (index+1) > 19? 1:2; // let array = [] // for (let j = 0; j < count; j++) { // array.push(ItemDataConfig.Instance.getItemById((2000+index).toString())) // index++ // } // tempArray.push(array) // } for (let index = 1; index <= 1;index++ ) { let array = [] array.push(ItemDataConfig.Instance.getItemById((2000+index).toString())) tempArray.push(array) } return tempArray } public getShopYuanBaoList():itemData[]{ let array = [] for (let j = 1; j <= 7; j++) { array.push(ItemDataConfig.Instance.getItemById((j).toString())) } return array } public getShopQiHunList():itemData[]{ let array = [] for (let j = 1; j <= 7; j++) { array.push(ItemDataConfig.Instance.getItemById((10+j).toString())) } return array } public getShopTongQianList():itemData[]{ let array = [] for (let j = 1; j <= 7; j++) { array.push(ItemDataConfig.Instance.getItemById((20+j).toString())) } return array } public getShopQiZiList():itemData[]{ let array = [] for (let j = 1; j <= 6; j++) { array.push(ItemDataConfig.Instance.getItemById((3000+j).toString())) } return array } public getShopTouXiangKuangList():itemData[]{ let array = [] for (let j = 1; j <= 1; j++) { array.push(ItemDataConfig.Instance.getItemById((4000+j).toString())) } return array } public getShopJiShiQiList():itemData[]{ let array = [] for (let j = 1; j <= 1; j++) { array.push(ItemDataConfig.Instance.getItemById((5000+j).toString())) } return array } public getShopQiPaoList():itemData[]{ let array = [] for (let j = 1; j <= 1; j++) { array.push(ItemDataConfig.Instance.getItemById((6000+j).toString())) } return array } public getShopDaoJuList():itemData[]{ let tempArray = [] let shop_item_1 = ItemDataConfig.Instance.getItemById("1001") shop_item_1.num = 10; tempArray.push(shop_item_1) let shop_item_2 = ItemDataConfig.Instance.getItemById("1002") shop_item_2.num = 1; tempArray.push(shop_item_2) let shop_item_3 = ItemDataConfig.Instance.getItemById("1003") shop_item_3.num = 1; tempArray.push(shop_item_3) let shop_item_4 = ItemDataConfig.Instance.getItemById("1004") shop_item_4.num = 2; tempArray.push(shop_item_4) let shop_item_5 = ItemDataConfig.Instance.getItemById("1005") shop_item_5.num = 2; tempArray.push(shop_item_5) let shop_item_6 = ItemDataConfig.Instance.getItemById("1006") shop_item_6.num = 2; tempArray.push(shop_item_6) return tempArray; } public item_config = new Map(); initItem(){ let _1001 = new itemData() _1001.id = "1001"; _1001.name = "体力卡"; _1001.sell = "1万" _1001.type = shop_item_type.ti_li_ka _1001.item_type = item_type.dao_ju ItemDataConfig.Instance.item_config.set(_1001.id,_1001) let _1002 = new itemData() _1002.id = "1002"; _1002.name = "复活卡"; _1002.sell = "1万" _1002.type = shop_item_type.fu_huo_ka _1002.item_type = item_type.dao_ju ItemDataConfig.Instance.item_config.set(_1002.id,_1002) let _1003 = new itemData() _1003.id = "1003"; _1003.name = "提示卡"; _1003.sell = "1万" _1003.type = shop_item_type.ti_shi_ka _1003.item_type = item_type.dao_ju ItemDataConfig.Instance.item_config.set(_1003.id,_1003) let _1004 = new itemData() _1004.id = "1004"; _1004.name = "悔棋卡"; _1004.sell = "1万" _1004.type = shop_item_type.hui_qi_ka _1004.item_type = item_type.dao_ju ItemDataConfig.Instance.item_config.set(_1004.id,_1004) let _1005 = new itemData() _1005.id = "1005"; _1005.name = "分析卡"; _1005.sell = "1万" _1005.type = shop_item_type.fen_xi_ka _1005.item_type = item_type.dao_ju ItemDataConfig.Instance.item_config.set(_1005.id,_1005) let _1006 = new itemData() _1006.id = "1006"; _1006.name = "算力卡"; _1006.sell = "1万" _1006.type = shop_item_type.suan_li_ka _1006.item_type = item_type.dao_ju ItemDataConfig.Instance.item_config.set(_1006.id,_1006) //棋盘 let _2000 = new itemData() _2000.id = "2000"; _2000.name = "经典木棋盘"; _2000.sell = "100" _2000.item_type = item_type.qi_pan ItemDataConfig.Instance.item_config.set(_2000.id,_2000) let _2001 = new itemData() _2001.id = "2001"; _2001.name = "卯兔添福"; _2001.sell = "100" _2001.item_type = item_type.qi_pan ItemDataConfig.Instance.item_config.set(_2001.id,_2001) let _2002 = new itemData() _2002.id = "2002"; _2002.name = "大闹天空"; _2002.sell = "200" _2002.item_type = item_type.qi_pan ItemDataConfig.Instance.item_config.set(_2002.id,_2002) let _2003 = new itemData() _2003.id = "2003"; _2003.name = "壁画故梦"; _2003.sell = "200" _2003.item_type = item_type.qi_pan ItemDataConfig.Instance.item_config.set(_2003.id,_2003) let _2004 = new itemData() _2004.id = "2004"; _2004.name = "桃花源记"; _2004.sell = "250" _2004.item_type = item_type.qi_pan ItemDataConfig.Instance.item_config.set(_2004.id,_2004) let _2005 = new itemData() _2005.id = "2005"; _2005.name = "君临天下"; _2005.sell = "250" _2005.item_type = item_type.qi_pan ItemDataConfig.Instance.item_config.set(_2005.id,_2005) let _2006 = new itemData() _2006.id = "2006"; _2006.name = "金虎贺岁"; _2006.sell = "250" _2006.item_type = item_type.qi_pan ItemDataConfig.Instance.item_config.set(_2006.id,_2006) let _2007 = new itemData() _2007.id = "2007"; _2007.name = "天女下凡"; _2007.sell = "250" _2007.item_type = item_type.qi_pan ItemDataConfig.Instance.item_config.set(_2007.id,_2007) let _2008 = new itemData() _2008.id = "2008"; _2008.name = "清幽茶道"; _2008.sell = "250" _2008.item_type = item_type.qi_pan ItemDataConfig.Instance.item_config.set(_2008.id,_2008) let _2009 = new itemData() _2009.id = "2009"; _2009.name = "凤舞九天"; _2009.sell = "250" _2009.item_type = item_type.qi_pan ItemDataConfig.Instance.item_config.set(_2009.id,_2009) let _2010 = new itemData() _2010.id = "2010"; _2010.name = "闲云野鹤"; _2010.sell = "250" _2010.item_type = item_type.qi_pan ItemDataConfig.Instance.item_config.set(_2010.id,_2010) let _2011 = new itemData() _2011.id = "2011"; _2011.name = "一鸣惊人"; _2011.sell = "250" _2011.item_type = item_type.qi_pan ItemDataConfig.Instance.item_config.set(_2011.id,_2011) let _2012 = new itemData() _2012.id = "2012"; _2012.name = "叱诧风云"; _2012.sell = "250" _2012.item_type = item_type.qi_pan ItemDataConfig.Instance.item_config.set(_2012.id,_2012) let _2013 = new itemData() _2013.id = "2013"; _2013.name = "鸿门宴"; _2013.sell = "250" _2013.item_type = item_type.qi_pan ItemDataConfig.Instance.item_config.set(_2013.id,_2013) let _2014 = new itemData() _2014.id = "2014"; _2014.name = "打破山河"; _2014.sell = "250" _2014.item_type = item_type.qi_pan ItemDataConfig.Instance.item_config.set(_2014.id,_2014) let _2015 = new itemData() _2015.id = "2015"; _2015.name = "金牛降世"; _2015.sell = "250" _2015.item_type = item_type.qi_pan ItemDataConfig.Instance.item_config.set(_2015.id,_2015) let _2016 = new itemData() _2016.id = "2016"; _2016.name = "汕海绘卷"; _2016.sell = "250" _2016.item_type = item_type.qi_pan ItemDataConfig.Instance.item_config.set(_2016.id,_2016) let _2017 = new itemData() _2017.id = "2017"; _2017.name = "扭转乾坤"; _2017.sell = "250" _2017.item_type = item_type.qi_pan ItemDataConfig.Instance.item_config.set(_2017.id,_2017) let _2018 = new itemData() _2018.id = "2018"; _2018.name = "皓月无痕"; _2018.sell = "250" _2018.item_type = item_type.qi_pan ItemDataConfig.Instance.item_config.set(_2018.id,_2018) let _2019 = new itemData() _2019.id = "2019"; _2019.name = "天地无极"; _2019.sell = "250" _2019.item_type = item_type.qi_pan ItemDataConfig.Instance.item_config.set(_2019.id,_2019) //棋子 let _3000 = new itemData() _3000.id = "3000"; _3000.name = "经典木棋子"; _3000.sell = "1000" _3000.item_type = item_type.qi_zi ItemDataConfig.Instance.item_config.set(_3000.id,_3000) let _3001 = new itemData() _3001.id = "3001"; _3001.name = "马中赤兔"; _3001.sell = "1000" _3001.item_type = item_type.qi_zi ItemDataConfig.Instance.item_config.set(_3001.id,_3001) let _3002 = new itemData() _3002.id = "3002"; _3002.name = "东海明珠"; _3002.sell = "1000" _3002.item_type = item_type.qi_zi ItemDataConfig.Instance.item_config.set(_3002.id,_3002) let _3003 = new itemData() _3003.id = "3003"; _3003.name = "三国战鼓"; _3003.sell = "1000" _3003.item_type = item_type.qi_zi ItemDataConfig.Instance.item_config.set(_3003.id,_3003) let _3004 = new itemData() _3004.id = "3004"; _3004.name = "千年桃木"; _3004.sell = "1000" _3004.item_type = item_type.qi_zi ItemDataConfig.Instance.item_config.set(_3004.id,_3004) let _3005 = new itemData() _3005.id = "3005"; _3005.name = "枯木逢春"; _3005.sell = "1000" _3005.item_type = item_type.qi_zi ItemDataConfig.Instance.item_config.set(_3005.id,_3005) let _3006 = new itemData() _3006.id = "3006"; _3006.name = "楚汉双雄"; _3006.sell = "1000" _3006.item_type = item_type.qi_zi ItemDataConfig.Instance.item_config.set(_3006.id,_3006) //头像框 let _4000 = new itemData() _4000.id = "4000"; _4000.name = "默认头像框"; _4000.sell = "1000" _4000.des = "默认头像框,快去解锁其他头像框吧" _4000.item_type = item_type.tou_xiang_kuang ItemDataConfig.Instance.item_config.set(_4000.id,_4000) let _4001 = new itemData() _4001.id = "4001"; _4001.name = "大展宏图"; _4001.sell = "1000" _4001.des = "通过卯兔迎新春夺宝获取" _4001.item_type = item_type.tou_xiang_kuang ItemDataConfig.Instance.item_config.set(_4001.id,_4001) let _4002 = new itemData() _4002.id = "4002"; _4002.name = "齐天大圣"; _4002.sell = "1000" _4002.des = "通过大闹天空夺宝获取" _4002.item_type = item_type.tou_xiang_kuang ItemDataConfig.Instance.item_config.set(_4002.id,_4002) let _4003 = new itemData() _4003.id = "4003"; _4003.name = "隐士高人"; _4003.sell = "1000" _4003.des = "通过桃花源记活动获取" _4003.item_type = item_type.tou_xiang_kuang ItemDataConfig.Instance.item_config.set(_4003.id,_4003) let _4004 = new itemData() _4004.id = "4004"; _4004.name = "玄武至尊"; _4004.sell = "1000" _4004.des = "通过决战九州获取" _4004.item_type = item_type.tou_xiang_kuang ItemDataConfig.Instance.item_config.set(_4004.id,_4004) let _4005 = new itemData() _4005.id = "4005"; _4005.name = "玄武主宰"; _4005.sell = "1000" _4005.des = "通过武林大会获取" _4005.item_type = item_type.tou_xiang_kuang ItemDataConfig.Instance.item_config.set(_4005.id,_4005) let _4006 = new itemData() _4006.id = "4006"; _4006.name = "飞龙承运"; _4006.sell = "1000" _4006.des = "传说中四爪为蟒-五爪天子,四爪诸侯..." _4006.item_type = item_type.tou_xiang_kuang ItemDataConfig.Instance.item_config.set(_4006.id,_4006) //计时器 let _5000 = new itemData() _5000.id = "5000"; _5000.name = "默认计时器"; _5000.sell = "1000" _5000.des = "默认计时器,快去解锁其他计时器吧" _5000.item_type = item_type.ji_shi_qi ItemDataConfig.Instance.item_config.set(_5000.id,_5000) let _5001 = new itemData() _5001.id = "5001"; _5001.name = "如意金箍棒"; _5001.sell = "1000" _5001.des = "通过大闹天空活动获取" _5001.item_type = item_type.ji_shi_qi ItemDataConfig.Instance.item_config.set(_5001.id,_5001) let _5002 = new itemData() _5002.id = "5002"; _5002.name = "桃园花镜"; _5002.sell = "活动限定" _5002.des = "通过大闹天空活动获取" _5002.item_type = item_type.ji_shi_qi ItemDataConfig.Instance.item_config.set(_5002.id,_5002) let _5003 = new itemData() _5003.id = "5003"; _5003.name = "四面楚歌"; _5003.sell = "活动限定" _5003.des = "通过大闹天空活动获取" _5003.item_type = item_type.ji_shi_qi ItemDataConfig.Instance.item_config.set(_5003.id,_5003) let _5004 = new itemData() _5004.id = "5004"; _5004.name = "清凉一夏"; _5004.sell = "活动限定" _5004.des = "通过大话西游活动获取" _5004.item_type = item_type.ji_shi_qi ItemDataConfig.Instance.item_config.set(_5004.id,_5004) let _5005 = new itemData() _5005.id = "5005"; _5005.name = "千年应龙"; _5005.sell = "活动限定" _5005.des = "通过山海经活动获取" _5005.item_type = item_type.ji_shi_qi ItemDataConfig.Instance.item_config.set(_5005.id,_5005) //气泡 let _6000 = new itemData() _6000.id = "6000"; _6000.name = "默认气泡"; _6000.sell = "活动限定" _6000.des = "默认气泡,快去解锁其他聊天气泡吧" _6000.item_type = item_type.qi_pao ItemDataConfig.Instance.item_config.set(_6000.id,_6000) let _6001 = new itemData() _6001.id = "6001"; _6001.name = "蟠桃宴"; _6001.sell = "活动限定" _6001.des = "通过大闹天空活动获取" _6001.item_type = item_type.qi_pao ItemDataConfig.Instance.item_config.set(_6001.id,_6001) let _6002 = new itemData() _6002.id = "6002"; _6002.name = "项羽舞剑"; _6002.sell = "活动限定" _6002.des = "通过鸿门宴活动获取" _6002.item_type = item_type.qi_pao ItemDataConfig.Instance.item_config.set(_6002.id,_6002) let _6003 = new itemData() _6003.id = "6003"; _6003.name = "北冥鲲鹏"; _6003.sell = "活动限定" _6003.des = "通过山海经活动获取" _6003.item_type = item_type.qi_pao ItemDataConfig.Instance.item_config.set(_6003.id,_6003) //元宝 let _1 = new itemData() _1.id = "1"; _1.name = "元宝"; _1.sell = "¥6" _1.des = "x60" _1.item_type = item_type.yuan_bao ItemDataConfig.Instance.item_config.set(_1.id,_1) let _2 = new itemData() _2.id = "2"; _2.name = "元宝"; _2.sell = "¥18" _2.des = "x180" _2.item_type = item_type.yuan_bao ItemDataConfig.Instance.item_config.set(_2.id,_2) let _3 = new itemData() _3.id = "3"; _3.name = "元宝"; _3.sell = "¥30" _3.des = "x300" _3.item_type = item_type.yuan_bao ItemDataConfig.Instance.item_config.set(_3.id,_3) let _4 = new itemData() _4.id = "4"; _4.name = "元宝"; _4.sell = "¥68" _4.des = "x680" _4.item_type = item_type.yuan_bao ItemDataConfig.Instance.item_config.set(_4.id,_4) let _5 = new itemData() _5.id = "5"; _5.name = "元宝"; _5.sell = "¥128" _5.des = "x1280" _5.item_type = item_type.yuan_bao ItemDataConfig.Instance.item_config.set(_5.id,_5) let _6 = new itemData() _6.id = "6"; _6.name = "元宝"; _6.sell = "¥298" _6.des = "x2980" _6.item_type = item_type.yuan_bao ItemDataConfig.Instance.item_config.set(_6.id,_6) let _7 = new itemData() _7.id = "7"; _7.name = "元宝"; _7.sell = "¥648" _7.des = "x6480" _7.item_type = item_type.yuan_bao ItemDataConfig.Instance.item_config.set(_7.id,_7) //棋魂 let _11 = new itemData() _11.id = "11"; _11.name = "棋魂"; _11.sell = "60" _11.des = "x6万" _11.item_type = item_type.qi_hun ItemDataConfig.Instance.item_config.set(_11.id,_11) let _12 = new itemData() _12.id = "12"; _12.name = "棋魂"; _12.sell = "180" _12.des = "x18万" _12.item_type = item_type.qi_hun ItemDataConfig.Instance.item_config.set(_12.id,_12) let _13 = new itemData() _13.id = "13"; _13.name = "棋魂"; _13.sell = "300" _13.des = "x30万" _13.item_type = item_type.qi_hun ItemDataConfig.Instance.item_config.set(_13.id,_13) let _14 = new itemData() _14.id = "14"; _14.name = "棋魂"; _14.sell = "680" _14.des = "x68万" _14.item_type = item_type.qi_hun ItemDataConfig.Instance.item_config.set(_14.id,_14) let _15 = new itemData() _15.id = "15"; _15.name = "棋魂"; _15.sell = "1280" _15.des = "x128万" _15.item_type = item_type.qi_hun ItemDataConfig.Instance.item_config.set(_15.id,_15) let _16 = new itemData() _16.id = "16"; _16.name = "棋魂"; _16.sell = "2980" _16.des = "x298万" _16.item_type = item_type.qi_hun ItemDataConfig.Instance.item_config.set(_16.id,_16) let _17 = new itemData() _17.id = "17"; _17.name = "棋魂"; _17.sell = "6480" _17.des = "x648万" _17.item_type = item_type.qi_hun ItemDataConfig.Instance.item_config.set(_17.id,_17) //铜钱 let _21 = new itemData() _21.id = "21"; _21.name = "铜钱"; _21.sell = "60" _21.des = "x6万" _21.item_type = item_type.tong_qian ItemDataConfig.Instance.item_config.set(_21.id,_21) let _22 = new itemData() _22.id = "22"; _22.name = "铜钱"; _22.sell = "180" _22.des = "x18万" _22.item_type = item_type.tong_qian ItemDataConfig.Instance.item_config.set(_22.id,_22) let _23 = new itemData() _23.id = "23"; _23.name = "铜钱"; _23.sell = "300" _23.des = "x30万" _23.item_type = item_type.tong_qian ItemDataConfig.Instance.item_config.set(_23.id,_23) let _24 = new itemData() _24.id = "24"; _24.name = "铜钱"; _24.sell = "680" _24.des = "x68万" _24.item_type = item_type.tong_qian ItemDataConfig.Instance.item_config.set(_24.id,_24) let _25 = new itemData() _25.id = "25"; _25.name = "铜钱"; _25.sell = "1280" _25.des = "x128万" _25.item_type = item_type.tong_qian ItemDataConfig.Instance.item_config.set(_25.id,_25) let _26 = new itemData() _26.id = "26"; _26.name = "铜钱"; _26.sell = "2980" _26.des = "x298万" _26.item_type = item_type.tong_qian ItemDataConfig.Instance.item_config.set(_26.id,_26) let _27 = new itemData() _27.id = "27"; _27.name = "铜钱"; _27.sell = "6480" _27.des = "x648万" _27.item_type = item_type.tong_qian ItemDataConfig.Instance.item_config.set(_27.id,_27) } } export class itemData{ public name:string=""; public url:string =""; public type:number= 0; public item_type:number= 0; public sell:string=""; public des:string=""; public id:string=""; public num:number=0; }