mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-03-18 21:38:13 -07:00
Compare commits
4 Commits
setup_more
...
NewSoupVi-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f6ffff674c | ||
|
|
7b21121df1 | ||
|
|
0fdc481082 | ||
|
|
92ca11b729 |
@@ -110,6 +110,16 @@ class AutoLogicRegister(type):
|
|||||||
elif not item_name.startswith("__"):
|
elif not item_name.startswith("__"):
|
||||||
if hasattr(CollectionState, item_name):
|
if hasattr(CollectionState, item_name):
|
||||||
raise Exception(f"Name conflict on Logic Mixin {name} trying to overwrite {item_name}")
|
raise Exception(f"Name conflict on Logic Mixin {name} trying to overwrite {item_name}")
|
||||||
|
|
||||||
|
assert callable(function) or "init_mixin" in dct, (
|
||||||
|
f"{name} defined class variable {item_name} without also having init_mixin.\n\n"
|
||||||
|
"Explanation:\n"
|
||||||
|
"Class variables that will be mutated need to be inintialized as instance variables in init_mixin.\n"
|
||||||
|
"If your LogicMixin variables aren't actually mutable / you don't intend to mutate them, "
|
||||||
|
"there is no point in using LogixMixin.\n"
|
||||||
|
"LogicMixin exists to track custom state variables that change when items are collected/removed."
|
||||||
|
)
|
||||||
|
|
||||||
setattr(CollectionState, item_name, function)
|
setattr(CollectionState, item_name, function)
|
||||||
return new_class
|
return new_class
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user