No need.
Message has additional arguments.
Btw, thanks for help! I found a solution.
struct Message
{
uint id;
string command;
Variant[] args;
this(T...)(uint id, string command, T args)
{
this.id = id;
this.command = command;
this.args = variantArray
Thanks for reply.
Strings are immutable so thats ok. A class instance that isn't
immutable isn't.
It's not a class instance, it's a class type. Something like
`cast(Sprite) null` in parameters. It can be replaced by string
"Sprite", but in this case I can't use receive() as it is. E.g.
send
Hi!
I'm trying to make my program multithreaded, and I was stuck at
messaging between threads.
I need to pack types and variables into one message. Will I use
Tuples or something?
e.g.
class Sprite {};
send(tid, Sprite, "create", myInt);
Also I don't understand how to use
Thanks for the answers!
How to compare two types? Will I use T.stringof instead of this?
void main()
{
if(One is Two) {} //Error: type One is not an expression
//Error: type Two is not an expression
}
class One {}
class Two {}
Regards,
MarisaLovesUsAll
On Thursday, 21 August 2014 at 20:16:33 UTC, anonymous wrote:
Maybe you can explain what you're trying to achieve with all
this. There may be a different/better way to do it.
Sure.
Class tree: GameObject->Component->Sprite.
GameObject structure:
Component[];
Component addComponent(Compo
On Thursday, 21 August 2014 at 13:19:06 UTC, anonymous wrote:
1) How to make mixin inject automatic?
You could use this pattern:
interface Component {}
class ComponentImpl(T) {}
class Sprite : ComponentImpl!Sprite {}
From my view, it's an architectural crutch. %)
You can use `typeof(this)`
I found a rough solution. It's not ideal and I still want to make
autoinject, but it works.
mixin template Manager(T) {};
class Component {};
class Sprite:Component
{
mixin Manager!Sprite;
};
1) How to make mixin inject automatic?
2) If it's impossible, how to use "mixin Manager;" without
tl;dr - how to get child classname from inherited parent function
at compile time?
class A { string getName(); };
class B { };
B foo = new B;
assert(foo.getName() == "B");
...
Hi! I'm stuck at one issue, and I don't know how to solve it. I
think this is about mixins/templates, isn't it?
When in
Hi!
I sometimes got a useless messages in stdout from SDL_Image
library, and I want to temporary silence it. How do I do?
10 matches
Mail list logo