Roderick Gibson:
Variant is a possiblity. How is the performance with large
containers of these, since these structures will likely hold
the majority of the data in the game?
You probably have to benchmark yourself. (But I have suggested an
Algebraic).
Bye,
bearophile
On Tuesday, 2 July 2013 at 06:54:58 UTC, bearophile wrote:
Roderick Gibson:
Variant is a possiblity. How is the performance with large
containers of these, since these structures will likely hold
the majority of the data in the game?
You probably have to benchmark yourself. (But I have
Roderick Gibson:
I should know the types at compile time, so I will be using it
most likely, but reading the docs it looks like Algebraic is
built on top of the same structure as Variant. Is there any
difference in implementation?
Take a look at the Phobos source code, it's much faster than
On Tuesday, 2 July 2013 at 21:45:57 UTC, bearophile wrote:
Roderick Gibson:
I should know the types at compile time, so I will be using it
most likely, but reading the docs it looks like Algebraic is
built on top of the same structure as Variant. Is there any
difference in implementation?
I'm asking because I'm doing some game development in D and I've
come upon the entity component architecture, and it looks like a
good way to handle the complexity and interdependency that games
seem to have.
The components wind up being plain old data types (I currently
use structs), with
Roderick Gibson:
auto entities = new Entities();
auto entity_id = entities.createEntity();
entities.addComponent!(position)(entity_id, pos);
entities.addComponent!(movement)(entity_id, mov);
entities.addComponent!(collision)(entity_id, col);
auto physics_data =
On Monday, 1 July 2013 at 12:03:25 UTC, Roderick Gibson wrote:
I'm asking because I'm doing some game development in D and
I've come upon the entity component architecture, and it looks
like a good way to handle the complexity and interdependency
that games seem to have.
The components wind
On Monday, 1 July 2013 at 12:16:50 UTC, bearophile wrote:
Roderick Gibson:
auto entities = new Entities();
auto entity_id = entities.createEntity();
entities.addComponent!(position)(entity_id, pos);
entities.addComponent!(movement)(entity_id, mov);
entities.addComponent!(collision)(entity_id,