1
mirror of https://github.com/thepeacockproject/Peacock synced 2024-11-22 22:12:45 +01:00

Switch challenges to GameVersions array

This commit is contained in:
AnthonyFuller 2024-04-03 15:48:31 +01:00
parent 54785cadb8
commit f6e882f9ca
62 changed files with 76 additions and 75 deletions

View File

@ -825,7 +825,6 @@ export class Controller {
/**
* Get all global challenges and register a simplified version of them.
* @param gameVersion A GameVersion object representing the version of the game.
*
*/
private registerGlobalChallenges(gameVersion: GameVersion) {
const regGlobalChallenges: RegistryChallenge[] = getVersionedConfig<
@ -856,7 +855,7 @@ export class Controller {
],
meta: {
Location: "GLOBAL",
GameVersion: gameVersion,
GameVersions: [gameVersion],
},
})
}
@ -914,20 +913,22 @@ export class Controller {
}
private _handleChallengeResources(data: ChallengePackage): void {
for (const group of data.groups) {
this.challengeService.registerGroup(
group,
data.meta.Location,
data.meta.GameVersion,
)
for (const challenge of group.Challenges) {
this.challengeService.registerChallenge(
challenge,
group.CategoryId,
for (const version of data.meta.GameVersions) {
for (const group of data.groups) {
this.challengeService.registerGroup(
group,
data.meta.Location,
data.meta.GameVersion,
version,
)
for (const challenge of group.Challenges) {
this.challengeService.registerChallenge(
challenge,
group.CategoryId,
data.meta.Location,
version,
)
}
}
}
}

View File

@ -80,7 +80,7 @@ export interface ChallengePackage {
* The parent location.
*/
Location: string
GameVersion: GameVersion
GameVersions: GameVersion[]
}
}

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_ROCKY",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "GLOBAL_ARCADE_CHALLENGES",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_BANGKOK",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_BANGKOK",
"GameVersion": "h2"
"GameVersions": ["h2"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_BANGKOK",
"GameVersion": "h1"
"GameVersions": ["h1"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_EDGY",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_TRAPPED",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_WET",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_COLORADO",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_COLORADO",
"GameVersion": "h2"
"GameVersions": ["h2"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_COLORADO",
"GameVersion": "h1"
"GameVersions": ["h1"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_ANCESTRAL",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_GOLDEN",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_ICA_FACILITY",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_ICA_FACILITY",
"GameVersion": "h2"
"GameVersions": ["h2"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_ICA_FACILITY",
"GameVersion": "h1"
"GameVersions": ["h1"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "GLOBAL_FEATURED_CHALLENGES",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "GLOBAL_FEATURED_CHALLENGES",
"GameVersion": "h2"
"GameVersions": ["h2"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "GLOBAL_CLASSIC_CHALLENGES",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "GLOBAL_ELUSIVES_CHALLENGES",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "GLOBAL_ESCALATION_CHALLENGES",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "GLOBAL_CLASSIC_CHALLENGES",
"GameVersion": "h2"
"GameVersions": ["h2"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "GLOBAL_ESCALATION_CHALLENGES",
"GameVersion": "h2"
"GameVersions": ["h2"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "GLOBAL_ESCALATION_CHALLENGES",
"GameVersion": "h1"
"GameVersions": ["h1"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_OPULENT",
"GameVersion": "h2"
"GameVersions": ["h2"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_OPULENT",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_NEWZEALAND",
"GameVersion": "h2"
"GameVersions": ["h2"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_NEWZEALAND",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_HOKKAIDO",
"GameVersion": "h2"
"GameVersions": ["h2"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_HOKKAIDO",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_HOKKAIDO",
"GameVersion": "h1"
"GameVersions": ["h1"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_MARRAKECH",
"GameVersion": "h2"
"GameVersions": ["h2"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_MARRAKECH",
"GameVersion": "h1"
"GameVersions": ["h1"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_MARRAKECH",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_ELEGANT",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_MIAMI",
"GameVersion": "h2"
"GameVersions": ["h2"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_MIAMI",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_MUMBAI",
"GameVersion": "h2"
"GameVersions": ["h2"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_MUMBAI",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_GREEDY",
"GameVersion": "h2"
"GameVersions": ["h2"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_GREEDY",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_PARIS",
"GameVersion": "h2"
"GameVersions": ["h2"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_PARIS",
"GameVersion": "h1"
"GameVersions": ["h1"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_PARIS",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_COLOMBIA",
"GameVersion": "h2"
"GameVersions": ["h2"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_COLOMBIA",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_COASTALTOWN",
"GameVersion": "h2"
"GameVersions": ["h2"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_COASTALTOWN",
"GameVersion": "h1"
"GameVersions": ["h1"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_COASTALTOWN",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_NORTHSEA",
"GameVersion": "h2"
"GameVersions": ["h2"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_NORTHSEA",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_AUSTRIA",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_CAGED",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_AUSTRIA",
"GameVersion": "h2"
"GameVersions": ["h2"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_CAGED",
"GameVersion": "h2"
"GameVersions": ["h2"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_SALTY",
"GameVersion": "h2"
"GameVersions": ["h2"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_SALTY",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_SNUG",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_NORTHAMERICA",
"GameVersion": "h2"
"GameVersions": ["h2"]
},
"groups": [
{

View File

@ -1,7 +1,7 @@
{
"meta": {
"Location": "LOCATION_PARENT_NORTHAMERICA",
"GameVersion": "h3"
"GameVersions": ["h3"]
},
"groups": [
{