CitiesSkylinesMods / TMPE

Cities: Skylines Traffic Manager: President Edition
https://steamcommunity.com/sharedfiles/filedetails/?id=1637663252
MIT License
563 stars 85 forks source link

Slightly reduced memory footprint of API structs and enums #1732

Open krzychu124 opened 1 year ago

krzychu124 commented 1 year ago

Note it's not possible to constraint Enum backing type to byte in DropDownOption so all enums used for dropdown ui must have a byte as backing type otherwise will throw InvalidCastException at runtime. Whole implementation has a flaw anyways because current implementation of SerializableUIOption is saving value as byte so any enum larger than byte will be saved and restored incorrectly. For now everything works because we don't use such big enums for dropdown values, so it's something to handle in the future or better avoid such use case.

Build ZIP