From 49b48ec7a8f7583b84a724abdbaeeea86f512c75 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sun, 8 May 2022 09:48:22 -0700 Subject: [PATCH] Add a HostileEnemy AI component --- roguebasin/ai.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 roguebasin/ai.py diff --git a/roguebasin/ai.py b/roguebasin/ai.py new file mode 100644 index 0000000..f758fb2 --- /dev/null +++ b/roguebasin/ai.py @@ -0,0 +1,22 @@ +# Eryn Wells + +from typing import TYPE_CHECKING + +from .actions import Action, WaitAction +from .components import Component +from .object import Entity + +if TYPE_CHECKING: + from .engine import Engine + +class AI(Component): + def __init__(self, entity: Entity) -> None: + super().__init__() + self.entity = entity + + def act(self, engine: 'Engine') -> Action: + raise NotImplementedError() + +class HostileEnemy(AI): + def act(self, engine: 'Engine') -> Action: + return WaitAction(self.entity) \ No newline at end of file