Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hq-config.json 格式重构 #106

Open
Tracked by #101
InfSein opened this issue Jan 3, 2025 · 0 comments
Open
Tracked by #101

hq-config.json 格式重构 #106

InfSein opened this issue Jan 3, 2025 · 0 comments

Comments

@InfSein
Copy link
Owner

InfSein commented Jan 3, 2025

优先级不是很高。总体思路:

  • 将各版本通用的数据抽离出来统一,以减少数据体积
  • 特定结构优化

原结构

export type HqConfigKeys = "7.0" | "7.1" | "7.2" | "7.3" | "7.4" | "7.5"
export interface HqConfigVal {
  available: boolean,
  jobs: {
    // 省略主副手/防具/首饰
    Meal: number[][],
    Medicine: number[][]
  },
  normalGathering: number[],
  reduceGathering: number[][],
  limitedGathering: number[],
  alkahests: number[],
  masterCrafting: number[],
  normalCrafting: number[],
  tradeShops: any[]
}
export HqConfig = (ParsedJson) as Record<HqConfigKeys, HqConfigVal>

新结构

export type HqConfigKeys = "7.0" | "7.1" | "7.2" | "7.3" | "7.4" | "7.5"
export interface HqConfigVal {
  available: boolean,
  jobs: {
    // 省略主副手/防具/首饰
  },
  meals: number[][],
  medicines: number[][],
  reduceGathering: number[][],
  alkahests: number[],
  tradeShops: any[]
}
export interface HqConfigGeneral {
  normalGathering: number[], // 也可以直接删除,已经不需要了
  limitedGathering: number[], // 也可以直接删除,已经不需要了
  masterCrafting: number[],
  normalCrafting: number[],
}
export HqConfig = (ParsedJson) as {
  general: HqConfigGeneral,
  [keys: HqConfigKeys]: HqConfigVal
}
@InfSein InfSein mentioned this issue Jan 3, 2025
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant