creating and accessing C# objects
See original GitHub issueHi Florian!
I’m probably missing something, or maybe it’s not (yet) possible at all? -> I would like to create a C# object (in mages), and then access it (from mages).
what I do now: I have a plugin-function called “object” [public static object @object(Object[] args)], which I call to create/instanitante a custom C# object (it’s internally added to a dictionary of counters, so I can later refer to it again, see below…):
object("counter1", "new:counter", 0, 100, 100, 5);
which creates a (named) counter “counter1” with some properties
I can later use
object("counter1", "start");
object("counter1", "stop");
object("counter1", "setvalue", 15);
etc. to work with this named counter.
however, it would be great to use something like:
counter1 = new counter(0,100,100,5);
counter1.start();
counter1.stop();
counter1.value = 15;
Object metadata #49 might be what I’m looking for. It was added to milestone 2.0 - but is still open…
Thanks for any info/hints/pointers!
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
ok - thanks.
I most likely will change the delimiter for our hierarchy after all. Using “\” in the code and replacing it with a character >=0x80
root\module1\counter1.value=42
might make things clearer after all and will just require getting used to using ‘\’ instead of ‘.’yes, that’s why that is no option. The only option is to make a generic string indexer as proposed.