surrsurus / edgequest

Edgequest Season Two
Mozilla Public License 2.0
8 stars 1 forks source link

Config loading should be done through serde #46

Closed surrsurus closed 6 years ago

surrsurus commented 6 years ago

It would make it so much easier to add/remove config options since we could just directly serialize them at once and not have to worry about a custom error scheme.

surrsurus commented 6 years ago

So I just remembered that since Serialize and Deserialize aren't implemented for tcod enums I can't really use serde. Kind of gives me an idea though on how to solve this? Maybe the enum matching can happen AFTER serde? Sounds crazy enough to work.

surrsurus commented 6 years ago

Turns out you can just match the string only when it's necessary. Funny how programming works out like that. Anyway, serde loading works which means we cut a big chunk of code out.