Add an ai attribute to Entity
This commit is contained in:
parent
49b48ec7a8
commit
687511d69e
1 changed files with 2 additions and 0 deletions
|
@ -17,12 +17,14 @@ class Entity:
|
||||||
|
|
||||||
def __init__(self, symbol: str, *,
|
def __init__(self, symbol: str, *,
|
||||||
position: Optional[Point] = None,
|
position: Optional[Point] = None,
|
||||||
|
ai: Optional[Type['AI']] = None,
|
||||||
fg: Optional[Tuple[int, int, int]] = None,
|
fg: Optional[Tuple[int, int, int]] = None,
|
||||||
bg: Optional[Tuple[int, int, int]] = None):
|
bg: Optional[Tuple[int, int, int]] = None):
|
||||||
self.position = position if position else Point()
|
self.position = position if position else Point()
|
||||||
self.foreground = fg if fg else (255, 255, 255)
|
self.foreground = fg if fg else (255, 255, 255)
|
||||||
self.background = bg
|
self.background = bg
|
||||||
self.symbol = symbol
|
self.symbol = symbol
|
||||||
|
self.ai = ai
|
||||||
|
|
||||||
def print_to_console(self, console: tcod.Console) -> None:
|
def print_to_console(self, console: tcod.Console) -> None:
|
||||||
console.print(x=self.position.x, y=self.position.y, string=self.symbol, fg=self.foreground, bg=self.background)
|
console.print(x=self.position.x, y=self.position.y, string=self.symbol, fg=self.foreground, bg=self.background)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue