Open lukaspj opened 9 years ago
Dynamics is ofc an issue, this could be handled through a "dynamics" parameter which could be a key-value pair or something.
Is that second TS-style constructor valid C#? What must I search for to read about this wizardry?
Yeah, I guess we could set up dynamics, haven’t messed with them lately though
From: Daniel Buckmaster [mailto:notifications@github.com] Sent: Friday, January 09, 2015 6:47 PM To: Winterleaf/OmniEngine.Net Subject: Re: [OmniEngine.Net] ObjectCreator is uglyyyy. (#19)
Is that second TS-style constructor valid C#? What must I search for to read about this wizardry?
— Reply to this email directly or view it on GitHub https://github.com/Winterleaf/OmniEngine.Net/issues/19#issuecomment-69421495 . https://github.com/notifications/beacon/ACUNZAOhJ85qMws7alAuYUfMck3BQOVkks5ngF_fgaJpZM4DQk0O.gif
@eightyeight this bit?
GuiWindowCtrl oc_Newobject4 = (new GuiWindowCtrlInstance("ConsoleDlgWindow")
{
isContainer = true,
AllowPopWindow = true
}).create();
It's basically the same as doing oc_Newobject4.isContainer = true etc. after initialization It's just syntactic sugar, and it is valid C# ;)
Edit: Oh, source
As an example of the syntactical difference:
ObjectCreator oc = new ObjectCreator("SimGroup", "MeshQualityGroup", typeof (QualityGroup));
ObjectCreator ao1 = new ObjectCreator("ArrayObject", "[Lowest]", typeof (GraphicsQualityLevel));
ao1["class"] = "GraphicsQualityLevel";
ao1["caseSensitive"] = true;
oc["#1"] = ao1;
oc.Create();
Will become:
SimGroup group = new SimGroupInstance(name: "MeshQualityGroup");
ArrayObject array = new ArrayObjectInstance(name: "[Lowest]",
class: "GraphicsQualityLevel",
caseSensitive: true);
group.add(array);
so Lukas, this is all for readability, not any new functionality correct? how long do u think this would take to accomplish (pure curiosity)
On Fri, Jan 9, 2015 at 8:11 PM, Lukas Joergensen notifications@github.com wrote:
As an example of the syntactical difference:
ObjectCreator oc = new ObjectCreator("SimGroup", "MeshQualityGroup", typeof (QualityGroup)); ObjectCreator ao1 = new ObjectCreator("ArrayObject", "[Lowest]", typeof (GraphicsQualityLevel)); ao1["class"] = "GraphicsQualityLevel"; ao1["caseSensitive"] = true; oc["#1"] = ao1; oc.Create();
Will become:
SimGroup group = new SimGroupInstance(name: "MeshQualityGroup"); ArrayObject array = new ArrayObjectInstance(name: "[Lowest]", class: "GraphicsQualityLevel", caseSensitive: true);group.add(array);
— Reply to this email directly or view it on GitHub https://github.com/Winterleaf/OmniEngine.Net/issues/19#issuecomment-69429340 .
Paul Yoskowitz [image: http://]about.me/paulyoskowitz http://about.me/paulyoskowitz?promo=email_sig
Yeah just for readability, I don't know how long it would take.. It depends on the generator that Vince is fumbling with, it doesn't take an awful lot of time to make the implementation for just e.g. SimObjects but if you need it for all classes and all future code it might take some time.. @Winterleaf (Vince) would probably be better at answering that than me :)
well vince is in the middle of game code atm is why I asked ya :)
and its your suger ;)
On Fri, Jan 9, 2015 at 8:25 PM, Lukas Joergensen notifications@github.com wrote:
Yeah just for readability, I don't know how long it would take.. It depends on the generator that Vince is fumbling with, it doesn't take an awful lot of time to make the implementation for just e.g. SimObjects but if you need it for all classes and all future code it might take some time.. @Winterleaf https://github.com/Winterleaf (Vince) would probably be better at answering that than me :)
— Reply to this email directly or view it on GitHub https://github.com/Winterleaf/OmniEngine.Net/issues/19#issuecomment-69430906 .
Paul Yoskowitz [image: http://]about.me/paulyoskowitz http://about.me/paulyoskowitz?promo=email_sig
Well, I might be able to achieve this on my own:
SimGroup group = new SimObjectInstance("MeshQualityGroup");
ArrayObject array = new SimObjectInstance("[Lowest]")
{
class = "GraphicsQualityLevel",
caseSensitive = true
};
group.add(array);
But that will be without intellisense. Anything more than that will need to be written into the project generator.
hmm.... is that out on github?
On Fri, Jan 9, 2015 at 8:33 PM, Lukas Joergensen notifications@github.com wrote:
Well, I might be able to achieve this on my own:
SimGroup group = new SimObjectInstance("MeshQualityGroup"); ArrayObject array = new SimObjectInstance("[Lowest]") { class = "GraphicsQualityLevel", caseSensitive = true };group.add(array);
But that will be without intellisense. Anything more than that will need to be written into the project generator.
— Reply to this email directly or view it on GitHub https://github.com/Winterleaf/OmniEngine.Net/issues/19#issuecomment-69431683 .
Paul Yoskowitz [image: http://]about.me/paulyoskowitz http://about.me/paulyoskowitz?promo=email_sig
@chieling Is what on Github? The generator?
https://github.com/Winterleaf/OmniEngine.Net
I remember there being a tools folder and didn't remember if the generator code was in there or snot.
On Fri, Jan 9, 2015 at 8:47 PM, Lukas Joergensen notifications@github.com wrote:
@chieling https://github.com/chieling Is what on Github? The generator?
— Reply to this email directly or view it on GitHub https://github.com/Winterleaf/OmniEngine.Net/issues/19#issuecomment-69432551 .
Paul Yoskowitz [image: http://]about.me/paulyoskowitz http://about.me/paulyoskowitz?promo=email_sig
Afaik thats not in there.
ah ok
On Fri, Jan 9, 2015 at 9:04 PM, Lukas Joergensen notifications@github.com wrote:
Afaik thats not in there.
— Reply to this email directly or view it on GitHub https://github.com/Winterleaf/OmniEngine.Net/issues/19#issuecomment-69433375 .
Paul Yoskowitz [image: http://]about.me/paulyoskowitz http://about.me/paulyoskowitz?promo=email_sig
So Lukas, do u need anything? or can u test and work with what u got?
On Fri, Jan 9, 2015 at 9:12 PM, Paul Yoskowitz < pyoskowitz@winterleafentertainment.com> wrote:
ah ok
On Fri, Jan 9, 2015 at 9:04 PM, Lukas Joergensen <notifications@github.com
wrote:
Afaik thats not in there.
— Reply to this email directly or view it on GitHub https://github.com/Winterleaf/OmniEngine.Net/issues/19#issuecomment-69433375 .
Paul Yoskowitz [image: http://]about.me/paulyoskowitz http://about.me/paulyoskowitz?promo=email_sig
Paul Yoskowitz [image: http://]about.me/paulyoskowitz http://about.me/paulyoskowitz?promo=email_sig
I can probably make an exapmle implementation, but we'll need to edit the codegenerator for a proper implementation. And I still don't have access to that afaik :P
I really wanna clean up object creation.
Is just syntactic sugar for:
So instead of this:
We could have this:
And we should use named parameters in the constructors so that instead of this:
We should have: