cataclysmbnteam / Cataclysm-BN

Cataclysm: Bright Nights, A fork/variant of Cataclysm:DDA by CleverRaven.
https://docs.cataclysmbn.org
Other
648 stars 256 forks source link

☂️ Game engine: Ongoing code migration projects #3271

Open olanti-p opened 10 months ago

olanti-p commented 10 months ago

We have multiple code migration projects that we've inherited from DDA, it'd be nice to have them finished or somehow wrapped up:

scarf005 commented 10 months ago

Modernizing JSON parser to accept type strings over raw integers

i have a JSON mapping script, could you share some conversion guidelines?

olanti-p commented 10 months ago

It basically boils down to the following steps:

  1. Finding where the parser supports loading both integer values and strings for units. For example, it seems that any assign( ... ) when used with units will accept both integers and typed strings: https://github.com/CleverRaven/Cataclysm-DDA/blob/d48717db010722fc43d6aaf8e3ff207de3a6d0a2/src/assign.cpp#L37-L40 There may be more hidden here and there.

  2. Updating these usages in JSON with a script, replacing integer values with typed strings

  3. Some time in the future (when? #3302), dropping the integer support for migrated fields