123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- class GameModel{
- constructor(){
- console.log('GameModel初始化');
- this.token = null;
- this.phone = null;
- this.updateSign = null;
- this.idVerified = 0;
- this.guestTimeout = false;
- this.regTime = 0;
- this.userInfo = null;
- this.player = null;
- this.resList = [];
- this.taskList = {};
- this.mailList = null;
- this.cannonList = {};
- this.heroList = {};
- this.realm = null; //矩阵
- this.chapter = {}; //闯关进度数据
- this.equip = {}; //装备
- this.equipAttributes = null; //--当前穿戴装备的所有属性总和
- this.StatuAttribute = null; //境界属性总和
- this.matrixAttribute = null; //矩阵属性
- this.notifyList = {};
- this.systemNotifyList = {};
- this.gameScene = null;
- this.inGame = false;
- this.inGameChangeAccount = false;
- this.fishList = {};
- this.realBulletHit = null;
- this.bulletHitList = null;
- this.bulletList = null;
- this.gamePlayers = null;
- this.connonConfig = null;
- this.redpackConfig = null;
- this.roomType = 0;
- this.selfSeat = 0;
- this.redBonus = 0;
- this.goldBonus = 0;
- this.pool1 = 0;
- this.pool3 = 0;
- this.pool4 = 0;
- this.pool5 = 0;
- this.quitFromTorpedoGame = false;
- this.lotteryCache = 0;
- this.selfBulletID = 1;
- this.skillList = {};
- this.newEquips = {};
- this.statePanelWuDaoNotice = false;
- this.enemyHpList = {};
- this.openSystemList = {};
- this.primaryLimit = [0, 300000];
- this.intermediateLimit = [100000, 3000000];
- this.highLimit = [500000, 999999999999999999999];
- this.shareBindInfo = {}; //分享绑定信息
- this.PassTaskList = {};
- this.EggInfoList = {};
- this.GrowthInfoList = {};
- thisrelationWX = null;
- thiswxType = 0;
- thisNiudanInfoList = {};
- this.chargeNum = 0;
- this.heroskinID = null;
- this.bossdata3 = null;
- this.redBujiOpeb = false;
- this.redFishNextData = null;
- this.noviceTime = 0;
- this.luckyStoneHint = true;
- this.isUseWxPay = null;
- this.specialPlayer = 999;
- this.Yuchao = 0;
- }
- clear(){
- this.token = null;
- this.phone = null;
- this.updateSign = null;
- this.realName = null;
- this.idCardCode = null;
- this.guestTimeOver = false;
- this.userInfo = null;
- this.idVerified = 0;
- this.player = null;
- this.resList = [];
- this.taskList = {};
- this.chapter = {};
- this.equip = {};
- this.mailList = null;
- this.notifyList = {};
- this.systemNotifyList = {};
- this.heroList = {};
- this.selfBulletID = 1;
- this.skillList = {};
- this.equipAttributes = null;
- this.matrixAttribute = null;
- this.newEquips = {};
- this.realm = null;
- this.StatuAttribute = null;
- this.statePanelWuDaoNotice = false;
- this.PassTaskList = {};
- this.GrowthInfoList = {};
- this.relationWX = null;
- this.noviceTime = 0;
- this.luckyStoneHint = true;
- }
- init(){
- this.clear();
- }
- //--任务更新
- updateTask(value){
- for(let key in value){
- let find = false;
- for(let m in this.taskList){
- if(this.taskList[m].ID = value[key].ID){
- this.taskList[m] = value[key];
- find = true;
- break;
- }
- }
- if(!find){
- this.taskList[key] = value[key];
- }
- }
- }
- getItemCountByModel(model){
- for(let i=0; i < this.resList.length; i++){
- if(this.resList[i].Model == model){
- return this.resList[i].Num;
- }
- }
- return 0;
- }
- setItemCountByModel(model, count){
- for(let i=0; i < this.resList.length; i++){
- if(this.resList[i].Model == model){
- this.resList[i].Num = count;
- return;
- }
- }
- this.resList.push({'Model': model, 'Num': count});
- }
- }
- let instance = null;
- GameModel.getInstance = function(){
- if(!instance){
- instance = new GameModel();
- }
- return instance;
- }
- // export default GameModel.getInstance();
- window.GameModel = GameModel.getInstance();
|