grunt-lucas / porytiles

Overworld tileset compiler for Pokémon Generation 3 decompilation projects
MIT License
30 stars 3 forks source link

Refactor warning system to reduce number of custom methods #50

Open grunt-lucas opened 1 month ago

grunt-lucas commented 1 month ago

We could have something like the following:

void issueWarning(Warning warning, std::string message) {
    // use Warning enum to increment a counter in a std::map
    // print the message
}

std::string formatTileMessage(int a, int b) {
    // complex message formatting is handled by helper methods
}

// the calling code would do the following:
issueWarning(Warning::BAD_TILE, formatTileMessage(foo, 10));