MCPcopy Create free account
hub / github.com/IChooseYou/Reclass / makeSimpleStruct

Method makeSimpleStruct

tests/test_generator.cpp:12–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10private:
11 // Helper: build a simple struct with a few fields
12 rcx::NodeTree makeSimpleStruct() {
13 rcx::NodeTree tree;
14 rcx::Node root;
15 root.kind = rcx::NodeKind::Struct;
16 root.name = "Player";
17 root.structTypeName = "Player";
18 root.parentId = 0;
19 root.offset = 0;
20 int ri = tree.addNode(root);
21 uint64_t rootId = tree.nodes[ri].id;
22
23 rcx::Node f1;
24 f1.kind = rcx::NodeKind::Int32;
25 f1.name = "health";
26 f1.parentId = rootId;
27 f1.offset = 0;
28 tree.addNode(f1);
29
30 rcx::Node f2;
31 f2.kind = rcx::NodeKind::Float;
32 f2.name = "speed";
33 f2.parentId = rootId;
34 f2.offset = 4;
35 tree.addNode(f2);
36
37 rcx::Node f3;
38 f3.kind = rcx::NodeKind::UInt64;
39 f3.name = "id";
40 f3.parentId = rootId;
41 f3.offset = 8;
42 tree.addNode(f3);
43
44 return tree;
45 }
46
47private slots:
48

Callers

nothing calls this directly

Calls 1

addNodeMethod · 0.45

Tested by

no test coverage detected