mirror of
https://github.com/Ed94/metadesk.git
synced 2026-08-06 07:38:45 +00:00
tidying up naming scheme and parameters in helper inspection API; [examples] sketch of type metadata example
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
** Setup as input to the type metadata example
|
||||
*/
|
||||
|
||||
@type(basic) U32: 4;
|
||||
@type(basic) F32: 4;
|
||||
@type(basic) V2F32: 8;
|
||||
|
||||
@type(struct)
|
||||
Circle:
|
||||
{
|
||||
r: F32;
|
||||
pos: V2F32;
|
||||
}
|
||||
|
||||
@type(struct)
|
||||
RoundedSegment:
|
||||
{
|
||||
r: F32;
|
||||
p1: V2F32;
|
||||
p2: V2F32;
|
||||
}
|
||||
|
||||
@type(struct)
|
||||
RoundedPolygon:
|
||||
{
|
||||
r: F32;
|
||||
count: U32;
|
||||
p: @array(count) V2F32;
|
||||
}
|
||||
|
||||
@type(enum: U32)
|
||||
Shape:
|
||||
{
|
||||
Circle: 1,
|
||||
Segment: 2,
|
||||
Polygon: 3,
|
||||
}
|
||||
|
||||
@map(Shape -> `$Type`; complete)
|
||||
type_info_from_shape:
|
||||
{
|
||||
Circle -> Circle,
|
||||
Segment -> RoundedSegment,
|
||||
Polygon -> RoundedPolygon,
|
||||
}
|
||||
|
||||
@map(Shape -> U32; default: 0; auto: 64)
|
||||
max_slot_from_shape:
|
||||
{
|
||||
Polygon -> 12,
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/*
|
||||
** Setup as input to the user-errors example
|
||||
*/
|
||||
|
||||
@foo @bar Foo:
|
||||
{
|
||||
@@ -6,6 +9,8 @@
|
||||
1, 2, 3,
|
||||
}
|
||||
|
||||
[50 + 200]
|
||||
|
||||
@baz Blah:
|
||||
{
|
||||
x100 y200 z300
|
||||
|
||||
Reference in New Issue
Block a user