babylon.models.entities.effect
Effect model for state modifications.
An Effect represents an atomic change to the game state. Effects are the fundamental unit of state mutation in the simulation.
This replaces the old dataclass in data/models/contradiction.py.
Classes
|
A modification to game state. |
- class babylon.models.entities.effect.Effect(**data)[source]
Bases:
BaseModelA modification to game state.
Effects are the atoms of change - they modify single attributes on single targets by specific amounts. Every state change in the simulation should be expressible as one or more Effects.
- Parameters:
- target_id
ID of the entity to modify
- attribute
Name of the attribute to change
- operation
How to modify the value
- magnitude
Amount of change (interpretation depends on operation)
- description
Human-readable explanation of why this effect occurs
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].