"use strict";
|
cc._RF.push(module, 'ac988kj0FFC+q6KUtdZxsUo', 'arena_champion_model');
|
// Scripts/mod/arena/arena_champion_model.js
|
|
"use strict";
|
|
var ArenaEvent = require("arena_event");
|
|
var ArenaConst = require("arena_const");
|
|
var ArenaChampionModel = cc.Class({
|
"extends": BaseClass,
|
ctor: function ctor() {},
|
properties: {},
|
initConfig: function initConfig() {
|
this.base_info = null; // 冠军赛基础信息
|
|
this.role_info = null; // 个人基础信息
|
},
|
updateChampionBaseInfo: function updateChampionBaseInfo(data) {
|
this.base_info = data;
|
gcore.GlobalEvent.fire(ArenaEvent.UpdateChampionBaseInfoEvent, data);
|
},
|
getBaseInfo: function getBaseInfo() {
|
return this.base_info;
|
},
|
setRoleInfo: function setRoleInfo(data) {
|
this.role_info = data;
|
gcore.GlobalEvent.fire(ArenaEvent.UpdateChampionRoleInfoEvent, data);
|
},
|
getRoleInfo: function getRoleInfo(data) {
|
return this.role_info;
|
},
|
// 获取我的比赛状态
|
getMyMatchStatus: function getMyMatchStatus() {
|
if (this.base_info && this.role_info) {
|
if (this.base_info.step == ArenaConst.champion_step.unopened) {
|
return ArenaConst.champion_my_status.unopened;
|
} else if (this.base_info.step == ArenaConst.champion_step.score && this.base_info.step_status == ArenaConst.champion_step_status.unopened) {
|
return ArenaConst.champion_my_status.unopened;
|
} else if (this.role_info.rank === 0) {
|
return ArenaConst.champion_my_status.unjoin;
|
} else {
|
return ArenaConst.champion_my_status.in_match;
|
}
|
}
|
|
return ArenaConst.champion_my_status.unopened;
|
}
|
});
|
|
cc._RF.pop();
|