| 8 | using namespace rcx; |
| 9 | |
| 10 | static void buildTree(NodeTree& tree) { |
| 11 | tree.baseAddress = 0x1000; |
| 12 | |
| 13 | Node root; |
| 14 | root.kind = NodeKind::Struct; |
| 15 | root.structTypeName = "Player"; |
| 16 | root.name = "Player"; |
| 17 | root.parentId = 0; |
| 18 | root.offset = 0; |
| 19 | int ri = tree.addNode(root); |
| 20 | uint64_t rootId = tree.nodes[ri].id; |
| 21 | |
| 22 | auto field = [&](int off, NodeKind k, const char* name) { |
| 23 | Node n; |
| 24 | n.kind = k; |
| 25 | n.name = name; |
| 26 | n.parentId = rootId; |
| 27 | n.offset = off; |
| 28 | tree.addNode(n); |
| 29 | }; |
| 30 | |
| 31 | field(0, NodeKind::Int32, "health"); |
| 32 | field(4, NodeKind::Int32, "armor"); |
| 33 | field(8, NodeKind::Float, "speed"); |
| 34 | field(12, NodeKind::Hex32, "flags"); |
| 35 | } |
| 36 | |
| 37 | static QByteArray makeBuffer() { |
| 38 | QByteArray data(128, '\0'); |