Mr Flibble
unread,Aug 4, 2018, 4:08:43 PM8/4/18You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
After much procrastination and umming and ahing I have decided to call my
ECS component that contains basic information about an entity
"entity_meta". Naming things properly can be hardest part of coding I
find: names inform your thinking about abstractions.
namespace neogfx
{
struct entity_meta
{
entity_id id;
neolib::uuid archetypeId;
bool destroyed;
struct meta : i_component_data::meta
{
static const neolib::uuid& id()
{
static const neolib::uuid sId = { 0x867e30c2, 0xaf8e, 0x452e, 0xa542,
{ 0xd, 0xd0, 0xd1, 0x1, 0xe4, 0x2d } };
return sId;
}
static const neolib::i_string& name()
{
static const neolib::string sName = "Entity Meta";
return sName;
}
static uint32_t field_count()
{
return 3;
}
static component_data_field_type field_type(uint32_t aFieldIndex)
{
switch (aFieldIndex)
{
case 0:
return component_data_field_type::Uint64;
case 1:
return component_data_field_type::Uuid;
case 2:
return component_data_field_type::Bool;
}
}
static const neolib::i_string& field_name(uint32_t aFieldIndex)
{
static const neolib::string sFieldNames[] =
{
"Entity Id",
"Archetype Id",
"Destroyed"
};
return sFieldNames[aFieldIndex];
}
};
};
}
That is all.
Message ends.
/Flibble
--
"Suppose it’s all true, and you walk up to the pearly gates, and are
confronted by God," Bryne asked on his show The Meaning of Life. "What
will Stephen Fry say to him, her, or it?"
"I’d say, bone cancer in children? What’s that about?" Fry replied.
"How dare you? How dare you create a world to which there is such misery
that is not our fault. It’s not right, it’s utterly, utterly evil."
"Why should I respect a capricious, mean-minded, stupid God who creates a
world that is so full of injustice and pain. That’s what I would say."