* initial commit of rules engine
* implement most of the stuff
* add docs and fill out rest of the functionality
* add in explain functions
* dedupe items and add more docs
* pr feedback and optimization updates
* Self is not in typing on 3.10
* fix test
* Update docs/rule builder.md
Co-authored-by: BadMagic100 <dempsey.sean@outlook.com>
* pr feedback
* love it when CI gives me different results than local
* add composition with bitwise and and or
* strongly typed option filtering
* skip resolving location parent region
* update docs
* update typing and add decorator
* add string explains
* move simplify code to world
* add wrapper rule
* I may need to abandon the generic typing
* missing space for faris
* fix hashing for resolved rules
* thank u typing extensions ilu
* remove bad cacheable check
* add decorator to assign hash and rule name
* more type crimes...
* region access rules are now cached
* break compatibility so new features work
* update docs
* replace decorators with __init_subclass__
* ok now the frozen dataclass is automatic
* one more type fix for the road
* small fixes and caching tests
* play nicer with tests
* ok actually fix the tests
* add item_mapping for faris
* add more state helpers as rules
* fix has from list rules
* fix can reach location caching and add set completion condition
* fix can reach entrance caching
* implement HasGroup and HasGroupUnique
* add more tests and fix some bugs
* Add name arg to create_entrance
Co-authored-by: roseasromeo <11944660+roseasromeo@users.noreply.github.com>
* fix json dumping option filters
* restructure and test serialization
* add prop to disable caching
* switch to __call__ and revert access_rule changes
* update docs and make edge cases match
* ruff has lured me into a false sense of security
* also unused
* fix disabling caching
* move filter function to filter class
* add more docs
* tests for explain functions
* Update docs/rule builder.md
Co-authored-by: roseasromeo <11944660+roseasromeo@users.noreply.github.com>
* chore: Strip out uses of TYPE_CHECKING as much as possible
* chore: add empty webworld for test
* chore: optimize rule evaluations
* remove getattr from hot code paths
* testing new cache flags
* only clear cache for rules cached as false in collect
* update test for new behaviour
* do not have rules inherit from each other
* update docs on caching
* fix name of attribute
* make explain messages more colorful
* fix issue with combining rules with different options
* add convenience functions for filtering
* use an operator with higher precedence
* name conflicts less with optionfilter
* move simplify and instance caching code
* update docs
* kill resolve_rule
* kill true_rule and false_rule
* move helpers to base classes
* update docs
* I really should finish all of my
* fix test
* rename mixin
* fix typos
* refactor rule builder into folder for better imports
* update docs
* do not dupe collectionrule
* docs review feedback
* missed a file
* remove rule_caching_enabled from base World
* update docs on caching
* shuffle around some docs
* use option instead of option.value
* add in operator and more testing
* rm World = object
* test fixes
* move cache to logic mixin
* keep test rule builder world out of global registry
* todone
* call register_dependencies automatically
* move register deps call to call_single
* add filtered_resolution
* allow bool opts on filters
* fix serialization tests
* allow reverse operations
---------
Co-authored-by: BadMagic100 <dempsey.sean@outlook.com>
Co-authored-by: roseasromeo <11944660+roseasromeo@users.noreply.github.com>
* Tests: unroll test_multiworlds.TestTwoPlayerMulti
Also adds a helper function that other tests can use to unroll tests.
* Docs: add more details to docs/tests.md
* Explain parametrization, subtests and link to the new helper
* Mention some performance details and work-arounds
* Mention multithreading / pytest-xdist
* Tests: make param.classvar_matrix accept sets
* CI: add test/param.py to type checking
* Tests: add missing typing to test/param.py
* Tests: fix typo in test/param.py doc comment
Co-authored-by: qwint <qwint.42@gmail.com>
* update docs
* Docs: reword note on performance
---------
Co-authored-by: qwint <qwint.42@gmail.com>
* Core: some low-hanging fruit on the strict type check
* bump pyright version
* bump pyright version
* bump pyright and remove file that's no longer easy
* CI: strict mypy check in github actions
mypy_files.txt is a list of files that will fail the CI if mypy finds errors in them
* don't need these
* `Any` should be a way to silence the type checker
* restrict return Any
* CI: pyright in github actions
* fix mistake in translating from mypy
* missed another change from mypy to pyright
* pin pyright version
* add more paths that should trigger check
* use Python instead of bash
* type error for testing CI
* Revert "type error for testing CI"
This reverts commit 99f65f3dad.
* oops
* don't need to redirect output