Record Class ComponentTreeNode
java.lang.Object
java.lang.Record
com.botwithus.bot.api.model.ComponentTreeNode
- Record Components:
component- the decoded component at this nodeparentIndex- index of this node's parent in the same list, or-1for the root
One node of a flattened interface subtree returned by
GameAPI.getInterfaceTree(int, int) — the raw
decode of a single get_interface_tree entry.
parentIndex references an earlier slot in the same list
(-1 for the root), so a consumer can rebuild the tree without a
second lookup. The producer walks the live Component* children
vectors, so a child's own interface id rides along in
component.ifaceId() — the tree stays correct across mounted
sub-interface boundaries, which per-node
GameAPI.getStaticChildren(int, int) cannot
follow.
Most scripts never touch this directly — the
Components facade wraps it into a
navigable ComponentTree.
-
Constructor Summary
ConstructorsConstructorDescriptionComponentTreeNode(Component component, int parentIndex) Creates an instance of aComponentTreeNoderecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecomponentrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of theparentIndexrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ComponentTreeNode
Creates an instance of aComponentTreeNoderecord class.- Parameters:
component- the value for thecomponentrecord componentparentIndex- the value for theparentIndexrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
component
-
parentIndex
public int parentIndex()Returns the value of theparentIndexrecord component.- Returns:
- the value of the
parentIndexrecord component
-