diff --git a/package.json b/package.json index eae1463..cdf1c6b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ba-armory", - "version": "1.3.10", + "version": "1.3.11", "type": "module", "scripts": { "format": "prettier --write ./src", diff --git a/src/app/entities/common.ts b/src/app/entities/common.ts deleted file mode 100644 index 34a9895..0000000 --- a/src/app/entities/common.ts +++ /dev/null @@ -1,47 +0,0 @@ -export interface Common { - regions: Region[]; - changelog: Changelog[]; -} - -export interface Changelog { - date: string; - contents: string[]; -} - -export interface Region { - studentlevel_max: number; - weaponlevel_max: number; - bondlevel_max: number; - gear1_max: number; - gear2_max: number; - gear3_max: number; - campaign_max: number; - events: number[]; - event_701_max: number; - event_701_challenge_max: number; - commission_max: number; - bounty_max: number; - schooldungeon_max: number; - current_gacha: CurrentGacha[]; - current_events: CurrentEvent[]; - current_raid: CurrentRAID[]; -} - -export interface CurrentEvent { - event: number; - start: number; - end: number; -} - -export interface CurrentGacha { - characters: number[]; - start: number; - end: number; -} - -export interface CurrentRAID { - raid: number; - terrain?: string; - start: number; - end: number; -} diff --git a/src/app/entities/config.ts b/src/app/entities/config.ts index 6a04532..842ed95 100644 --- a/src/app/entities/config.ts +++ b/src/app/entities/config.ts @@ -1,15 +1,63 @@ export interface Config { links: Link[]; build: number; + Regions: Region[]; + Changelog: Changelog[]; TypeEffectiveness: TypeEffectiveness; GachaGroups: GachaGroup[]; } +export interface Changelog { + date: string; + contents: string[]; +} + export interface GachaGroup { Id: number; ItemList: Array; } +export interface Region { + Name: string; + StudentMaxLevel: number; + WeaponMaxLevel: number; + BondMaxLevel: number; + EquipmentMaxLevel: number[]; + CampaignMax: number; + CampaignExtra: boolean; + Events: number[]; + Event701Max: number[]; + ChaserMax: number; + BloodMax: number; + FindGiftMax: number; + SchoolDungeonMax: number; + FurnitureSetMax: number; + FurnitureTemplateMax: number; + CurrentGacha: CurrentGacha[]; + CurrentEvents: CurrentEvent[]; + CurrentRaid: CurrentRAID[]; +} + +export interface CurrentEvent { + event: number; + start: number; + end: number; +} + +export interface CurrentGacha { + characters: number[]; + start: number; + end: number; +} + +export interface CurrentRAID { + type: string; + raid: number; + terrain?: string; + start: number; + end: number; +} + export interface TypeEffectiveness { Normal: WeaponType; Explosion: WeaponType; diff --git a/src/app/services/data.service.ts b/src/app/services/data.service.ts index e0ba7b6..16a27a8 100644 --- a/src/app/services/data.service.ts +++ b/src/app/services/data.service.ts @@ -1,7 +1,6 @@ import { plainToClassFromExist, plainToInstance } from 'class-transformer'; import { Injectable } from '@angular/core'; -import { Common } from '../entities/common'; import { Deck, ELIGMA_ID, EQUIPMENT_OFFSET, FURNITURE_OFFSET } from '../entities/deck'; import { ArmorType, BulletType, EquipmentCategory, ItemCategory, Reward, SkillType, StuffCategory, Terrain } from '../entities/enum'; import { Equipment } from '../entities/equipment'; @@ -33,7 +32,6 @@ export class DataService { stages: Stage = new Stage(); config: Config; - common: Common; localization: Localization; i18n: I18N; @@ -76,15 +74,11 @@ export class DataService { setConfig(json: any) { this.config = json; - } - - setCommon(json: any) { - this.common = json; - const region = this.common.regions[this.region]; + const region = this.config.Regions[this.region]; - this.studentLevelMax = region.studentlevel_max; - this.weaponLevelMax = region.weaponlevel_max; + this.studentLevelMax = region.StudentMaxLevel; + this.weaponLevelMax = region.WeaponMaxLevel; } setStudents(json: any[]) { diff --git a/src/app/services/preload.service.ts b/src/app/services/preload.service.ts index bc6d405..4116115 100644 --- a/src/app/services/preload.service.ts +++ b/src/app/services/preload.service.ts @@ -31,7 +31,6 @@ export class PreloadService { const language = this.dataService.language; const configSource = `${environment.CDN_BASE}/data/config.min.json`; - const commonSource = `${environment.CDN_BASE}/data/common.min.json`; const itemsSource = `${environment.CDN_BASE}/data/${language}/items.min.json`; const equipmentsSource = `${environment.CDN_BASE}/data/${language}/equipment.min.json`; const studentsSource = `${environment.CDN_BASE}/data/${language}/students.min.json`; @@ -39,9 +38,8 @@ export class PreloadService { const localizationSource = `${environment.CDN_BASE}/data/${language}/localization.min.json`; const i18nSource = `./assets/i18n/${language}.json`; - const [config, common, items, equipments, students, stages, localization, i18n] = await Promise.all([ + const [config, items, equipments, students, stages, localization, i18n] = await Promise.all([ this.fetchJson(configSource), - this.fetchJson(commonSource), this.fetchJson(itemsSource), this.fetchJson(equipmentsSource), this.fetchJson(studentsSource), @@ -51,7 +49,6 @@ export class PreloadService { ]); this.dataService.setConfig(config); - this.dataService.setCommon(common); this.dataService.setItems(items); this.dataService.setEquipments(equipments); this.dataService.setStudents(students);