Skip to content

Improvements to building and accessing trees - #1164

Merged
tturocy merged 2 commits into
masterfrom
dev_tree_handles
Sep 29, 2026
Merged

tturocy merged 2 commits into
masterfrom
dev_tree_handles

Conversation

@tturocy

@tturocy tturocy commented Sep 29, 2026

Copy link
Copy Markdown
Member

No description provided.

GameNodeRep::GetPriorAction scanned the actions at its parent's
information set, calling GetChild on each, to discover which child the node
was; GetNextSibling and GetPriorSibling searched the parent's children.
Each node now records its position among its parent's children when the
tree is numbered, so these are constant time.  The position is recorded
rather than the action because a node's children keep their positions when
it moves to another information set, which does not renumber the tree;
every change to a node's children does.

GetChild now checks the action's information set by raw pointer, and
GameObjectPtr::operator-> returns a raw pointer after its null and validity
checks, rather than a shared pointer by value: the handle already keeps the
element alive, so each member access no longer pays for reference counting.
@tturocy
tturocy merged commit 1809a58 into master Sep 29, 2026
30 checks passed
@tturocy
tturocy deleted the dev_tree_handles branch September 29, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant