123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- export default class BuildingModel {
- /**@type {number} */
- goldUnit = 0;
-
- /**@type {number} */
- hasNext = 0;
- /**@type {number} */
- roomId = 0;
- /**@type {number} */
- level = 0;
- /**@type {string} */
- name = "";
- /**@type {number} */
- // nextRate = 0;
- /**@type {string} */
- nextUpGold = "0";
- /**@type {number} */
- // nextGold = 0;
- /**@type {number} */
- rate = 0;
- /**@type {number} */
- jobId = 0;
- /**@type {string} */
- unlockScore = "0";
- /**@type {number} */
- isUnlocked = 0;
- /**@type {number} */
- coinCount = 0;
- /**@type {number} */
- gold = 0;
- /**@type {string} */
- gold1 = "0";
- /**@type {string} */
- gold2 = "0";
- /**@type {string} */
- gold3 = "0";
- /**@type {string} */
- gold4 = "0";
- /**@type {number} */
- buildingLevel = 0;
- /**@type {number} */
- maxLevel = 0;
- constructor(data) {
- // this.coinCount = data.coinCount || 0;
- this.goldUnit = data.goldUnit;
- this.gold = data.gold;
- this.hasNext = data.hasNext;
- this.roomId = (data.roomId === undefined) ? data.id : data.roomId;
- this.level = data.level;
- this.name = data.name;
- // this.nextRate = data.nextRate;
- this.nextUpGold = data.nextUpGold;
- // this.nextGold = data.nextGold;
- // this.rate = data.rate;
- // this.jobId = data.jobId;
- this.buildingLevel = data.buildingLevel;
- this.gold1 = data.gold1;
- this.gold2 = data.gold2;
- this.gold3 = data.gold3;
- this.gold4 = data.gold4;
- this.maxLevel = data.maxLevel;
- this.unlockScore = data.unlockScore;
- // if (data.unlockScore && data.unlockScore !== 0) {
- // this.unlockScore = data.unlockScore;
- // this.isUnlocked = 0;
- // } else {
- // this.isUnlocked = 1;
- // }
- }
- isFull() {
- if (this.roomLevel && this.roomLevel == Global.BuildingManager.getLevelCount(this.roomId)) {
- return true;
- } else {
- return false;
- }
- }
- }
|