Porting a tiny library from Lua to C#
For context, I work with LOVE which is a game framework for Lua. One of the planned updates is API to allow people to make their own language bindings and C# is popular with making games so I figured, why not try and port a really tiny library over to C# just for fun, even if its not gonna be useful right now?
(the lib in question, it's a scene manager and its just like 130 lines)
https://github.com/tesselode/roomy/tree/master
Here's my roadblock though:
In Lua, using Roomy would look like this:
What I'd like is to replicate this same sort of behavior as close as possible, keeping
Emit
as a method that takes a name of an event and looks for it in a Scene, passing in the remaining parameters but I don't know how to ensure strong typing for different events. Just having object[]
works but it'd mean every event would have to add type checking at the top of their definitions.
Hope that explains enough, I might be missing some details1 Reply
Alternative question: is what I want even worth it/possible?