Okay, let's see if the Fediverse can answer this. I'm using #Csharp with #godot and need to wrap a scene "foo" in a class that creates multiple copies of it, then intercepts any method calls to "foo" and applies them to each copy. From outside the class, there should appear to only be one "foo," but in reality there are several.
I think I know how I'd do it in python or ruby, but it involves a lot of metaprogramming. Can this be done in C#?
=> More informations about this toot | More toots from uberduck@hachyderm.io
@uberduck off the top of my head. Maybe a signal/event or add the scene to a group only for that scene and when then with get by group you should be able to update them all i think.
=> More informations about this toot | More toots from Spiritech@mastodon.social
@Spiritech If I understand correctly, all of these involve the calling code to be aware that there's something odd going on. If at all possible, I'd like this to be transparent to the calling code.
=> More informations about this toot | More toots from uberduck@hachyderm.io
@uberduck Transparent in what way? Like a completion event return message? Or like progress updates?
=> More informations about this toot | More toots from Spiritech@mastodon.social
@Spiritech If I have an object 'Foo' that has method 'bar', I want to be able to write a wrapper 'Wrapper' such that I can call 'new (Wrapper(Foo)).bar()' and it will call Foo.bar(). I need to be able to this without explicitly telling Wrapper about the bar method ahead of time.
=> More informations about this toot | More toots from uberduck@hachyderm.io
@uberduck if im understanding correctly. Two classes at least one or maybe both implementing an interface with a method of bar and on the generic wrapper class the constuctor calls bar in the class that is being wrapped.
=> More informations about this toot | More toots from Spiritech@mastodon.social
@Spiritech I'm trying to avoid having to implement every method that foo might have in the wrapper individually, since that's likely to be an enormous amount of boilerplate code and will not be extensible in the slightest.
Something like this: https://keegoo.github.io/notes/2018/03/12/method-missing-in-python.html
=> More informations about this toot | More toots from uberduck@hachyderm.io
@uberduck abstract class godot may have some quirks with syntax https://www.reddit.com/r/godot/comments/17e752a/abstract_class_problem_in_c/
=> More informations about this toot | More toots from Spiritech@mastodon.social This content has been proxied by September (ba2dc).Proxy Information
text/gemini