More tests and more coverage

This commit is contained in:
Yohann D'ANELLO
2020-11-06 16:13:28 +01:00
parent 8ccb74ea54
commit ff435dc328
5 changed files with 115 additions and 8 deletions

View File

@ -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