Add a HostileEnemy AI component
This commit is contained in:
parent
cf9ec2d17e
commit
49b48ec7a8
1 changed files with 22 additions and 0 deletions
22
roguebasin/ai.py
Normal file
22
roguebasin/ai.py
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
# Eryn Wells <eryn@erynwells.me>
|
||||||
|
|
||||||
|
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)
|
Loading…
Add table
Add a link
Reference in a new issue