​python_modules /
module-07 / ex1 / capabilities.py
106 commits
21-05-2026
21 lines 408 B
 1from abc import ABC, abstractmethod
 2from ex0 import Creature
 3
 4
 5class HealCapability(ABC):
 6    @abstractmethod
 7    def heal(self, target: Creature | None = None) -> str:
 8        pass
 9
10
11class TransformCapability(ABC):
12    def __init__(self) -> None:
13        self.transformed = False
14
15    @abstractmethod
16    def transform(self) -> str:
17        ...
18
19    @abstractmethod
20    def revert(self) -> str:
21        ...