Skip to content

Remove LogicDict - #28

Merged
CodeTriangle merged 9 commits into
crosscode-devfrom
logicdict-refactor
Aug 29, 2026
Merged

Remove LogicDict#28
CodeTriangle merged 9 commits into
crosscode-devfrom
logicdict-refactor

Conversation

@CodeTriangle

@CodeTriangle CodeTriangle commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Remove worlds.crosscode.types.LogicDict and replace it with a reference to the CrossCodeWorld, greatly simplifying condition code.

LogicDict has a long and storied history. Originally, it was a type to represent the **kwargs that were sent to condition callbacks, but this quickly became unnecessary and useless as I realized they had no reason to be keyword arguments in the first place. So I changed it into an actual argument to the function. But its existence as a TypedDict continued since I could not find a way to pass in the specific combination of world, world data, and options that the type checker would not yell at me for.

Turns out the combination of from __future__ import annotations and if typing.TYPE_CHECKING was all I needed. So this replaces that overgrown legacy construct. I have also added several former entries of the LogicDict class to CrossCodeWorld instead.

@CodeTriangle

Copy link
Copy Markdown
Owner Author

As a note, this was forked from #24. All commits before de411e8 belong to that PR.

@CodeTriangle
CodeTriangle merged commit 5e48b16 into crosscode-dev Aug 29, 2026
10 of 25 checks passed
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