mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
27 lines
579 B
Python
27 lines
579 B
Python
![]() |
from __future__ import annotations
|
||
|
|
||
|
from abc import abstractmethod
|
||
|
from typing import Protocol, Tuple, runtime_checkable
|
||
|
|
||
|
from BaseClasses import CollectionState
|
||
|
|
||
|
|
||
|
@runtime_checkable
|
||
|
class StardewRule(Protocol):
|
||
|
|
||
|
@abstractmethod
|
||
|
def __call__(self, state: CollectionState) -> bool:
|
||
|
...
|
||
|
|
||
|
@abstractmethod
|
||
|
def __and__(self, other: StardewRule):
|
||
|
...
|
||
|
|
||
|
@abstractmethod
|
||
|
def __or__(self, other: StardewRule):
|
||
|
...
|
||
|
|
||
|
@abstractmethod
|
||
|
def evaluate_while_simplifying(self, state: CollectionState) -> Tuple[StardewRule, bool]:
|
||
|
...
|