|
|
@@ -26,7 +26,7 @@ export class GameData {
|
|
|
/** 功能开启 */
|
|
|
public funOpenData: string[] = [];
|
|
|
|
|
|
- public gameData: PlayerProp = null;
|
|
|
+ public playerProp: PlayerProp = null;
|
|
|
/** 标志位:刷新主界面货币 */
|
|
|
public init_coin: boolean = false;
|
|
|
|
|
|
@@ -131,7 +131,7 @@ export class GameData {
|
|
|
// if (response.errcode != 0) {
|
|
|
// return;
|
|
|
// }
|
|
|
- // this.gameData.userTuCaoInfo = response.data.userWelFareTaskInfo;
|
|
|
+ // this.playerProp.userTuCaoInfo = response.data.userWelFareTaskInfo;
|
|
|
// mk.console.logSingle("welFare/getUserWelFareTaskInfo", response.data);
|
|
|
gData.guideData.init();
|
|
|
gData.guideWeakData.init();
|
|
|
@@ -154,33 +154,33 @@ export class GameData {
|
|
|
* 初始化玩家数据
|
|
|
*/
|
|
|
private initPlayerProp(res_data) {
|
|
|
- this.gameData = new PlayerProp();
|
|
|
- this.gameData.cashIndex = res_data.cashIndex;
|
|
|
- this.gameData.gameUserData = res_data.gameUserData;
|
|
|
- this.gameData.isSignInToday = res_data.isSignInToday;
|
|
|
- this.gameData.isWithdrawable = res_data.isWithdrawable;
|
|
|
- this.gameData.lastTime = res_data.lastTime;
|
|
|
- this.gameData.loginDays = res_data.loginDays;
|
|
|
- this.gameData.newPlayer = res_data.newPlayer;
|
|
|
- this.gameData.initPiggyBank(res_data.piggyBank);
|
|
|
- this.gameData.piggyBankCashTimes = res_data.piggyBankCashTimes;
|
|
|
- this.gameData.redMoney = res_data.redMoney == null ? 0 : res_data.redMoney;
|
|
|
- this.gameData.signInDay = res_data.signInDay;
|
|
|
- this.gameData.totalPiggyBankCashTimes = res_data.totalPiggyBankCashTimes;
|
|
|
- this.gameData.turntableTimes = res_data.turntableTimes;
|
|
|
- this.gameData.versioncfg = res_data.versioncfg;
|
|
|
- this.gameData.isFirstRedMoney = res_data.isFirstRedMoney;
|
|
|
+ this.playerProp = new PlayerProp();
|
|
|
+ this.playerProp.cashIndex = res_data.cashIndex;
|
|
|
+ this.playerProp.gameUserData = res_data.gameUserData;
|
|
|
+ this.playerProp.isSignInToday = res_data.isSignInToday;
|
|
|
+ this.playerProp.isWithdrawable = res_data.isWithdrawable;
|
|
|
+ this.playerProp.lastTime = res_data.lastTime;
|
|
|
+ this.playerProp.loginDays = res_data.loginDays;
|
|
|
+ this.playerProp.newPlayer = res_data.newPlayer;
|
|
|
+ this.playerProp.initPiggyBank(res_data.piggyBank);
|
|
|
+ this.playerProp.piggyBankCashTimes = res_data.piggyBankCashTimes;
|
|
|
+ this.playerProp.redMoney = res_data.redMoney == null ? 0 : res_data.redMoney;
|
|
|
+ this.playerProp.signInDay = res_data.signInDay;
|
|
|
+ this.playerProp.totalPiggyBankCashTimes = res_data.totalPiggyBankCashTimes;
|
|
|
+ this.playerProp.turntableTimes = res_data.turntableTimes;
|
|
|
+ this.playerProp.versioncfg = res_data.versioncfg;
|
|
|
+ this.playerProp.isFirstRedMoney = res_data.isFirstRedMoney;
|
|
|
gData.adData.watchNumToday = res_data.dayVideoTimesForRedMoney == null ? 0 : res_data.dayVideoTimesForRedMoney;
|
|
|
|
|
|
- this.gameData.gradeLevel = res_data.farmLevel
|
|
|
- this.gameData.userTuCaoInfo = res_data.userWelFareTaskInfo;
|
|
|
- this.gameData.farmExpValue = res_data.userExp;
|
|
|
- this.gameData.farmGradeData = res_data.userFarmGrageRewardInfo;
|
|
|
- this.gameData.userNoviceWeFareInfo = res_data.userNoviceWeFareInfo;
|
|
|
- this.gameData.redMoneyCashPayRecordList = res_data.redMoneyCashPayRecordList;
|
|
|
+ this.playerProp.gradeLevel = res_data.farmLevel
|
|
|
+ this.playerProp.userTuCaoInfo = res_data.userWelFareTaskInfo;
|
|
|
+ this.playerProp.farmExpValue = res_data.userExp;
|
|
|
+ this.playerProp.farmGradeData = res_data.userFarmGrageRewardInfo;
|
|
|
+ this.playerProp.userNoviceWeFareInfo = res_data.userNoviceWeFareInfo;
|
|
|
+ this.playerProp.redMoneyCashPayRecordList = res_data.redMoneyCashPayRecordList;
|
|
|
mk.console.logSingle('userNoviceWeFareInfo==>', res_data.userNoviceWeFareInfo);
|
|
|
//mk.console.logSingle('redMoneyCashPayRecordList==>', res_data.redMoneyCashPayRecordList);
|
|
|
- this.gameData.userFarmTaskInfo = res_data.userFarmTaskInfo;
|
|
|
+ this.playerProp.userFarmTaskInfo = res_data.userFarmTaskInfo;
|
|
|
|
|
|
mk.data.setTAUserID(gData.loginData.uin);
|
|
|
|
|
|
@@ -188,7 +188,7 @@ export class GameData {
|
|
|
gData.loginData.isFirstIn = false;
|
|
|
|
|
|
mk.data.setTAEventRegister();
|
|
|
- mk.data.sendDataEvent('ABTest', `触发${this.gameData.groupCode}方案`);
|
|
|
+ mk.data.sendDataEvent('ABTest', `触发${this.playerProp.groupCode}方案`);
|
|
|
|
|
|
//注册时版本号
|
|
|
mk.data.setTAEventUserStr(0, 'regtime_app_id', gData.appData.appVersion);
|
|
|
@@ -488,9 +488,9 @@ export class GameData {
|
|
|
// if (gData.gameData.init_redBagTask) {
|
|
|
// return;
|
|
|
// }
|
|
|
- if (gData.gameData.gameData.userFarmTaskInfo) {
|
|
|
- let com = gData.gameData.gameData.userFarmTaskInfo.completeCount;
|
|
|
- let count = gData.gameData.gameData.userFarmTaskInfo.taskCount;
|
|
|
+ if (this.playerProp.userFarmTaskInfo) {
|
|
|
+ let com = this.playerProp.userFarmTaskInfo.completeCount;
|
|
|
+ let count = this.playerProp.userFarmTaskInfo.taskCount;
|
|
|
|
|
|
if (com >= count)
|
|
|
return;
|
|
|
@@ -503,7 +503,7 @@ export class GameData {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- gData.gameData.gameData.userFarmTaskInfo = response.data.userFarmTaskInfo;
|
|
|
+ this.playerProp.userFarmTaskInfo = response.data.userFarmTaskInfo;
|
|
|
//gData.gameData.init_task = true;
|
|
|
}
|
|
|
|
|
|
@@ -714,7 +714,7 @@ export class GameData {
|
|
|
let id = 30001;
|
|
|
let data = null;
|
|
|
for (var i = 0; i < len1; i++) {
|
|
|
- if (this.gameData.gradeLevel < arr[i].value) {
|
|
|
+ if (this.playerProp.gradeLevel < arr[i].value) {
|
|
|
data = { id: id, state: PastureState.Lock, productID: arr[i].picture, growSpan: 0 };
|
|
|
}
|
|
|
else {
|
|
|
@@ -780,7 +780,7 @@ export class GameData {
|
|
|
for (var i = 0; i < 6; i++) {
|
|
|
tab = this.getTabByConfigID(id);
|
|
|
let arr = this.getProductArrByType(tab);
|
|
|
- if (this.gameData.gradeLevel < arr[0].value) {
|
|
|
+ if (this.playerProp.gradeLevel < arr[0].value) {
|
|
|
data = { id: id, state: FactroyState.Lock, productID: 0, growSpan: 0 };
|
|
|
}
|
|
|
else {
|
|
|
@@ -935,7 +935,7 @@ export class GameData {
|
|
|
needUpdate = false;
|
|
|
for (var i = 0; i < len; i++) {
|
|
|
data = this.getPastureDataMap(id);
|
|
|
- if (data.state == PastureState.Lock && this.gameData.gradeLevel >= configArr[i].value) {
|
|
|
+ if (data.state == PastureState.Lock && this.playerProp.gradeLevel >= configArr[i].value) {
|
|
|
data = { id: id, state: PastureState.Empty, productID: configArr[i].picture, growSpan: 0 };
|
|
|
this.setPastureDataMap(id, data, false);
|
|
|
needUpdate = true;
|
|
|
@@ -953,7 +953,7 @@ export class GameData {
|
|
|
needUpdate = false;
|
|
|
let configID = this.getConfigIDByTab(tab);
|
|
|
data = this.getFactoryDataMap(configID);
|
|
|
- if (data.state == FactroyState.Lock && this.gameData.gradeLevel >= configArr[0].value) {
|
|
|
+ if (data.state == FactroyState.Lock && this.playerProp.gradeLevel >= configArr[0].value) {
|
|
|
data = { id: id, state: FactroyState.Empty, productID: 0, growSpan: 0 };
|
|
|
this.setFactoryDataMap(configID, data, false);
|
|
|
needUpdate = true;
|
|
|
@@ -1065,7 +1065,7 @@ class PlayerProp {
|
|
|
/** 存钱罐存款 */
|
|
|
set piggyBank(value: number) {
|
|
|
if (this._piggyBank === value) return;
|
|
|
- if (gData.gameData.gameData.isWithdrawable && value > 0) return;// 存钱罐可提现状态,不能增加存钱罐金额
|
|
|
+ if (gData.gameData.playerProp.isWithdrawable && value > 0) return;// 存钱罐可提现状态,不能增加存钱罐金额
|
|
|
this._piggyBank = value;
|
|
|
gData.gameData.init_coin = true;
|
|
|
gData.pigbank.init_data = true;
|