<commit_before>from survive.inventory.inventorymodel import Inventory
from survive.player.attributes.attributemodel import Attribute


class Player(object):
    def __init__(self, name):
        # Basic player attributes
        self.health = 10
        self.name = name

        # Advanced player attributes
        self.inventory = Inventory()
        self.level = Attribute(1, "Level")
        self.stamina = Attribute(10, "Stamina")
        self.strength = Attribute(2, "Strength")
        self.wood_working = Attribute(1, "Woodworking")

        # Attacks
        self.basic_attack = 1
        self.special_attack = 2

    def check_inventory(self):
        self.inventory.display()

    def check_stats(self):
        print("Player Stats:")
        print("Current level: ", self.level.get_level())
        print("Current Health: ", self.health)
        print("Strength: ", self.strength.get_level())
        print("\n")

# TODO: Create a file to hold how much health should increase
# based on what the player eats.
    def eat_food(self):
        self.health += 5

    def is_player_dead(self):
        if(self.health <= 0):
            return True
        else:
            return False

    def kill_player(self):
        self.health = 0

    def reduce_health(self, damage_taken):
        self.health = (self.health - damage_taken)

    def restore_health(self, amount_restored):
        self.health = (self.health + amount_restored)

    def get_basic_attack(self):
        return self.basic_attack + self.strength.get_level()

    def get_special_attack(self):
        return self.special_attack + self.strength.get_level()<commit_msg>Added getters, made some variables private<commit_after>from survive.inventory.inventorymodel import Inventory
from survive.player.attributes.attributemodel import Attribute


class Player(object):
    def __init__(self, name):
        # Basic player attributes
        self._health = 10
        self._name = name

        # Advanced player attributes
        # TODO: Woodworker is directly accessing these variables
        self.inventory = Inventory()
        self.level = Attribute(1, "Level")
        self.stamina = Attribute(10, "Stamina")
        self.strength = Attribute(2, "Strength")
        self.wood_working = Attribute(1, "Woodworking")

        # Attacks
        self._basic_attack = 1
        self._special_attack = 2

    def check_inventory(self):
        self.inventory.display()

    def check_stats(self):
        print("Player Stats:")
        print("Current level: ", self.level.get_level())
        print("Current Health: ", self._health)
        print("Strength: ", self.strength.get_level())
        print("\n")

# TODO: Create a file to hold how much health should increase
# based on what the player eats.
    def eat_food(self):
        self._health += 5
        
    def get_basic_attack(self):
        return self._basic_attack + self.strength.get_level()

    def get_health(self):
        return self._health

    def get_name(self):
        return self._name

    def get_special_attack(self):
        return self._special_attack + self.strength.get_level()

    def is_player_dead(self):
        if(self._health <= 0):
            return True
        else:
            return False

    def kill_player(self):
        self._health = 0

    def reduce_health(self, damage_taken):
        self._health = (self._health - damage_taken)

    def restore_health(self, amount_restored):
        self._health = (self._health + amount_restored)
{'fraction_non_alphanumeric': 0.09869169510807736, 'fraction_numerical': 0.006825938566552901, 'mean_word_length': 2.5597165991902835, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '900866', 'n_tokens_mistral': 1046, 'n_tokens_neox': 963, 'n_words': 247}