condition package
Submodules
models.flow.condition.condition module
- class models.flow.condition.condition.Condition
Bases:
object
Base class for defining conditions in the flow.
Subclasses should implement the required methods.
- classmethod from_dict(data)
Create a condition instance from a dictionary.
- Parameters:
data (dict) – Dictionary containing the condition data.
- Returns:
An instance of the condition.
- Return type:
- Raises:
NotImplementedError – If not implemented in subclass.
- to_dict()
Serialize the condition to a dictionary.
- Returns:
Dictionary representation of the condition.
- Return type:
dict
- Raises:
NotImplementedError – If not implemented in subclass.
models.flow.condition.condition_list module
- class models.flow.condition.condition_list.AlwaysTrue
Bases:
Condition
Condition that always evaluates to True.
- classmethod from_dict(data)
Create an AlwaysTrue condition from a dictionary.
- Parameters:
data (dict) – Dictionary containing condition data.
- Returns:
An instance of AlwaysTrue.
- Return type:
- to_dict()
Serialize the condition to a dictionary.
- Returns:
Dictionary representation of the condition.
- Return type:
dict
- class models.flow.condition.condition_list.PerceptionCheck(dc)
Bases:
Condition
Condition that checks if the perception value meets or exceeds a difficulty class (DC).
- classmethod from_dict(data)
Create a PerceptionCheck condition from a dictionary.
- Parameters:
data (dict) – Dictionary containing condition data.
- Returns:
An instance of PerceptionCheck.
- Return type:
- to_dict()
Serialize the condition to a dictionary.
- Returns:
Dictionary representation of the condition.
- Return type:
dict