活动:删除多余代码
This commit is contained in:
@@ -28,26 +28,8 @@ export class DailyItem {
|
||||
this.taskParam = data.taskParam;
|
||||
this.condition = data.condition;
|
||||
this.reward = data.reward;
|
||||
}
|
||||
|
||||
public heroReward(): CreateHeroParam[] {
|
||||
let rewardArray = [];
|
||||
let rewardData = this.reward.split('|').filter(obj => { return obj && obj != '' });
|
||||
for (let objStr of rewardData) {
|
||||
let reward = parseHeroStrWithType(objStr);
|
||||
rewardArray.push(reward);
|
||||
}
|
||||
return rewardArray.filter(obj => { return obj && obj.type == ACTIVITY_RESOURCES_TYPE.HERO })
|
||||
}
|
||||
|
||||
public goodReward(): RewardInter[] {
|
||||
let rewardArray = [];
|
||||
let rewardData = this.reward.split('|').filter(obj => { return obj && obj != '' });
|
||||
for (let objStr of rewardData) {
|
||||
let reward = parseGoodStrWithType(objStr);
|
||||
rewardArray.push(reward);
|
||||
}
|
||||
return rewardArray.filter(obj => { return obj && obj.type == ACTIVITY_RESOURCES_TYPE.GOODS })
|
||||
this.totalCount = 0;
|
||||
this.receiveRewardCount = 0;
|
||||
}
|
||||
|
||||
public canReceive(): boolean {
|
||||
@@ -55,48 +37,7 @@ export class DailyItem {
|
||||
}
|
||||
|
||||
public isComplete(): boolean {
|
||||
let complete = false;
|
||||
switch (this.taskType) {
|
||||
case TASK_TYPE.ROLE_LV:
|
||||
complete = this.totalCount >= this.condition;
|
||||
break;
|
||||
case TASK_TYPE.GUILD_JOIN:
|
||||
complete = this.totalCount >= this.condition;
|
||||
break;
|
||||
case TASK_TYPE.LOGIN_SUM:
|
||||
complete = this.totalCount >= this.condition;
|
||||
break;
|
||||
case TASK_TYPE.HERO_NUM:
|
||||
complete = this.totalCount >= this.condition;
|
||||
break;
|
||||
case TASK_TYPE.ROLE_TITLE:
|
||||
complete = this.totalCount >= this.condition;
|
||||
break;
|
||||
case TASK_TYPE.GASHA:
|
||||
complete = this.totalCount >= this.condition;
|
||||
break;
|
||||
case TASK_TYPE.EQUIP_STRENGTHEN:
|
||||
complete = this.totalCount >= this.condition;
|
||||
break;
|
||||
case TASK_TYPE.BATTLE_MAIN:
|
||||
complete = this.totalCount >= this.condition;
|
||||
break;
|
||||
case TASK_TYPE.EQUIP_JEWEL_SUM:
|
||||
complete = this.totalCount >= this.condition;
|
||||
break;
|
||||
case TASK_TYPE.GUILD_TRAIN:
|
||||
complete = this.totalCount >= this.condition;
|
||||
break;
|
||||
case TASK_TYPE.ROLE_SCHOOL_PUT_HERO:
|
||||
complete = this.totalCount >= this.condition;
|
||||
break;
|
||||
case TASK_TYPE.GUILD_ACTIVITY:
|
||||
complete = this.totalCount >= this.condition;
|
||||
break;
|
||||
default:
|
||||
complete = false;
|
||||
break;
|
||||
}
|
||||
let complete = this.totalCount >= this.condition;
|
||||
return complete;
|
||||
}
|
||||
}
|
||||
@@ -124,9 +65,6 @@ export class DailyChallengesData extends ActivityBase {
|
||||
if (index != -1) {
|
||||
obj.totalCount = data[index].totalCount ? data[index].totalCount : 0;
|
||||
obj.receiveRewardCount = data[index].receiveRewardCount ? data[index].receiveRewardCount : 0;
|
||||
} else {
|
||||
obj.totalCount = 0;
|
||||
obj.receiveRewardCount = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user