Nolram
Explore posts from serversOdd behaviour copying structs
hence my interest in source generators, because right now there's still a bit of boilerplate here and there (such as registering a button with the editing tool to create a new entity of a new given entity type, and now also the clone function). In an ideal world, I'd be able to just create a new entity type that derives from some interface or baseclass and have the rest happen automatically, but that's sadly not possible without advanced reflection (which I can't due to NAOT) or source generation.
58 replies
Odd behaviour copying structs
Higher performance is certainly preferred in my case; but actually the Nr. 1 priority is ease of implementation for someone creating a new entity type, as that's the code on the project that won't be written by me. I.e. minimizing boilerplate and all that
58 replies
Odd behaviour copying structs
Hm, I see. I suppose I'll migrate over the a base class then (I'm not super familiar with them - I come from a procedural & data-oriented background with C++ primarily), I didn't know they actually prevented multi-inheritance.
58 replies
Odd behaviour copying structs
I've had a look now at this, however this seems to just be used to box the type. I'm still trying to create a copy of my object (now a class). Reading up on it online, it does seem that now the only way to actually do that sort of copy (without weird hacks like serializing & deserialising) is via a clone function, which returns to my original question about being able to source-generate it. Are you randomly aware of any info or resources about that? I've heard source generation can be quite difficult & tedious, so if it ends up being too complicated I may just stick to manually writing a clone function.
58 replies