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

Flatten MapProperty serde representation #52

Closed

Conversation

scottanderson
Copy link
Collaborator

@scottanderson scottanderson commented Jan 20, 2024

Before:

      {
        "type": "MapProperty",
        "key_type": "StrProperty",
        "value_type": "StrProperty",
        "allocation_flags": 0,
        "value": [
          [
            {
              "type": "StrProperty",
              "value": "Story/Campaign/index"
            },
            {
              "type": "StrProperty",
              "value": "c1.m18b.s2"
            }
          ],
          [
            {
              "type": "StrProperty",
              "value": "music"
            },
            {
              "type": "StrProperty",
              "value": "music.lasthope"
            }
          ],
          [
            {
              "type": "StrProperty",
              "value": "preferedEngine"
            },
            {
              "type": "StrProperty",
              "value": "HybridEngine"
            }
          ],
          [
            {
              "type": "StrProperty",
              "value": "Option_settings.a.master"
            },
            {
              "type": "StrProperty",
              "value": "50.0%"
            }
          ],
          [
            {
              "type": "StrProperty",
              "value": "Option_settings.a.music"
            },
            {
              "type": "StrProperty",
              "value": "50.0%"
            }
          ],
          [
            {
              "type": "StrProperty",
              "value": "Option_settings.g.terrainres"
            },
            {
              "type": "StrProperty",
              "value": "tfactor.x2"
            }
          ],
          [
            {
              "type": "StrProperty",
              "value": "Option_settings.dpiscale"
            },
            {
              "type": "StrProperty",
              "value": "120%"
            }
          ],
          [
            {
              "type": "StrProperty",
              "value": "Option_settings.daytime"
            },
            {
              "type": "StrProperty",
              "value": "toggle.enabled"
            }
          ],
          [
            {
              "type": "StrProperty",
              "value": "preferedTrainColor"
            },
            {
              "type": "StrProperty",
              "value": "Crimson"
            }
          ]
        ]
      }

After:

      {
        "type": "MapProperty",
        "key_type": "StrProperty",
        "value_type": "StrProperty",
        "values": {
          "Story/Campaign/index": "c1.m18b.s2",
          "music": "music.lasthope",
          "preferedEngine": "HybridEngine",
          "Option_settings.a.master": "50.0%",
          "Option_settings.a.music": "50.0%",
          "Option_settings.g.terrainres": "tfactor.x2",
          "Option_settings.dpiscale": "120%",
          "Option_settings.daytime": "toggle.enabled",
          "preferedTrainColor": "Crimson"
        }
      }

Before:

      {
        "type": "MapProperty",
        "key_type": "StrProperty",
        "value_type": "StrProperty",
        "allocation_flags": 0,
        "value": [
          [
            {
              "type": "StrProperty",
              "value": "Story/Campaign/index"
            },
            {
              "type": "StrProperty",
              "value": "c1.m18b.s2"
            }
          ],
          [
            {
              "type": "StrProperty",
              "value": "music"
            },
            {
              "type": "StrProperty",
              "value": "music.lasthope"
            }
          ],
          [
            {
              "type": "StrProperty",
              "value": "preferedEngine"
            },
            {
              "type": "StrProperty",
              "value": "HybridEngine"
            }
          ],
          [
            {
              "type": "StrProperty",
              "value": "Option_settings.a.master"
            },
            {
              "type": "StrProperty",
              "value": "50.0%"
            }
          ],
          [
            {
              "type": "StrProperty",
              "value": "Option_settings.a.music"
            },
            {
              "type": "StrProperty",
              "value": "50.0%"
            }
          ],
          [
            {
              "type": "StrProperty",
              "value": "Option_settings.g.terrainres"
            },
            {
              "type": "StrProperty",
              "value": "tfactor.x2"
            }
          ],
          [
            {
              "type": "StrProperty",
              "value": "Option_settings.dpiscale"
            },
            {
              "type": "StrProperty",
              "value": "120%"
            }
          ],
          [
            {
              "type": "StrProperty",
              "value": "Option_settings.daytime"
            },
            {
              "type": "StrProperty",
              "value": "toggle.enabled"
            }
          ],
          [
            {
              "type": "StrProperty",
              "value": "preferedTrainColor"
            },
            {
              "type": "StrProperty",
              "value": "Crimson"
            }
          ]
        ]
      }

After:

      {
        "type": "MapProperty",
        "key_type": "StrProperty",
        "value_type": "StrProperty",
        "values": {
          "Story/Campaign/index": "c1.m18b.s2",
          "music": "music.lasthope",
          "preferedEngine": "HybridEngine",
          "Option_settings.a.master": "50.0%",
          "Option_settings.a.music": "50.0%",
          "Option_settings.g.terrainres": "tfactor.x2",
          "Option_settings.dpiscale": "120%",
          "Option_settings.daytime": "toggle.enabled",
          "preferedTrainColor": "Crimson"
        }
      }
@scottanderson scottanderson requested a review from localcc January 20, 2024 07:01
@scottanderson scottanderson marked this pull request as ready for review January 20, 2024 07:01
@scottanderson scottanderson marked this pull request as draft January 20, 2024 07:14
@scottanderson scottanderson deleted the flatten-mapproperty branch March 14, 2024 22:26
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

Successfully merging this pull request may close these issues.

1 participant