More tests and more coverage
This commit is contained in:
@ -66,12 +66,16 @@ class Tile(Enum):
|
||||
|
||||
|
||||
class Entity:
|
||||
x: int
|
||||
y: int
|
||||
x: int
|
||||
|
||||
def move(self, x: int, y: int) -> None:
|
||||
self.x = x
|
||||
def __init__(self):
|
||||
self.y = 0
|
||||
self.x = 0
|
||||
|
||||
def move(self, y: int, x: int) -> None:
|
||||
self.y = y
|
||||
self.x = x
|
||||
|
||||
def act(self, m: Map) -> None:
|
||||
"""
|
||||
@ -85,9 +89,12 @@ class FightingEntity(Entity):
|
||||
maxhealth: int
|
||||
health: int
|
||||
strength: int
|
||||
dead: bool
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.health = self.maxhealth
|
||||
self.dead = False
|
||||
|
||||
def hit(self, opponent: "FightingEntity") -> None:
|
||||
opponent.take_damage(self, self.strength)
|
||||
@ -98,4 +105,4 @@ class FightingEntity(Entity):
|
||||
self.die()
|
||||
|
||||
def die(self) -> None:
|
||||
pass
|
||||
self.dead = True
|
||||
|
Reference in New Issue
Block a user