From 8c3bdc372613dc89b32c941142d9c4756a1d0c38 Mon Sep 17 00:00:00 2001 From: Marcin Kostrzewski Date: Sat, 16 May 2020 09:48:42 +0200 Subject: [PATCH] Interactable entities now have classification field --- src/entities/Interactable.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/entities/Interactable.py b/src/entities/Interactable.py index f963687..a49dda6 100644 --- a/src/entities/Interactable.py +++ b/src/entities/Interactable.py @@ -2,7 +2,7 @@ from src.entities.Entity import Entity class Interactable(Entity): - def __init__(self, texture, size, pos, Statistics): + def __init__(self, texture, size, pos, Statistics, classifier=None): """ Create an interactable entity, that can be interacted with. @@ -10,10 +10,13 @@ class Interactable(Entity): :param size: Size in px :param pos: A tuple of coords (x,y) :param Statistics: Outcome of the interaction + :param classifier: Type of the entity (food, water, rest) """ super().__init__(texture, size, pos) self.Statistics = Statistics + self.classifier = classifier + def on_interaction(self, Player): """ Applies outcome to the Player