tcod-rs icon indicating copy to clipboard operation
tcod-rs copied to clipboard

Replace bools with enums where appropriate

Open tomassedovic opened this issue 10 years ago • 2 comments

Things like setting fullscreen/windowed mode or whether path.walk should recalculate or not should use aptly-named enums instead of an opaque boolean that you have to dig into docs to figure out.

tomassedovic avatar Nov 20 '14 22:11 tomassedovic

Is it possible that we could also replace the bitflags with enums? Most of them are just mutually exclusive settings anyway (we'd need to keep them internally to pass through to tcod-sys but it's a good opportunity to provide a nicer interface).

jgilchrist avatar Jan 13 '15 01:01 jgilchrist

I tried to use enums where the values were exclusive and bitflags where you could genuinely specify multiple options at once.

But yeah, I may have missed something and it's quite possible that we can design a better API for the bitflags cases, too.

tomassedovic avatar Jan 13 '15 08:01 tomassedovic