On Friday, 6 April 2018 at 02:20:29 UTC, Kayomn wrote:

Wrong example code, here's the correct example:
switch (queryString(childJson,"type")) {
        case (typeof (Sprite).name):
                child = this.addChild!(Sprite)(childName);


        case (typeof (Camera).name):
                child = this.addChild!(Camera)(childName);


                child = this.addChild!(Node)(childName);


Ok, first of all, I'm not sure about the question, because of the following:

Does the default case handle an unspecified class or does it handle a class which is specified, but is not mentioned in any of previous cases?
Or does the default case handle both of these circumstances?
Without a master list this play an important role, I think.

Another information shortage is: are the tags exclusive or not? So, is it possible that a class has more then one tag (still being unique (tuple))?

Besides this, I tried something with types used as user defined attributes.

Automatic compile time tagging is not my speciality, however, I think is also achievable with mixins somehow?
But I don't know how to workaround the bug
at this moment...


Reply via email to