power_play/src/proto/pp_ent.h
2025-11-12 15:00:05 -06:00

94 lines
1.5 KiB
C

////////////////////////////////////////////////////////////
//~ Key types
#define PP_NilEntKey ((PP_EntKey) { 0 })
#define PP_RootEntKey ((PP_EntKey) { .v.hi = 0x75ebb7a47d1ca753, .v.lo = 0x2d505fc8961e5576 })
Struct(PP_EntKey)
{
U128 v;
};
////////////////////////////////////////////////////////////
//~ Shape types
Struct(PP_Shape)
{
f32 radius;
u32 points_count;
Vec2 points[8];
};
////////////////////////////////////////////////////////////
//~ Ent types
//////////////////////////////
//- Ent roperties
Enum(PP_EntProp)
{
PP_EntProp_None,
};
//////////////////////////////
//- Ent
Struct(PP_Ent)
{
PP_EntKey parent;
PP_EntKey first;
PP_EntKey last;
PP_EntKey next;
PP_EntKey prev;
PP_EntKey key;
PP_Shape shape;
} extern Readonly PP_nil_ent;
//////////////////////////////
//- Ent list
Struct(PP_EntListNode)
{
PP_EntListNode *next;
PP_Ent ent;
};
Struct(PP_EntList)
{
PP_EntListNode *first;
PP_EntListNode *last;
u64 count;
};
////////////////////////////////////////////////////////////
//~ Lookup types
Struct(PP_EntLookupBin)
{
i32 _;
};
////////////////////////////////////////////////////////////
//~ World types
Struct(PP_World)
{
i64 tick;
PP_Ent *ents;
i64 ents_count;
};
Struct(PP_WorldNode)
{
PP_WorldNode *next;
PP_World world;
};
////////////////////////////////////////////////////////////
//~ Nil helpers
b32 PP_IsKeyNil(PP_EntKey key);
b32 PP_IsEntNil(PP_Ent *ent);