from enum import Enum

from rpg.objects import Object


class Key(Object):
    def __init__(self, success_message, correct_place):
        self.success_message = success_message
        self.door_opened = False
        self.correct_place = correct_place

    def use(self, game):
        if isinstance(game.current_location, self.correct_place):
            if not self.door_opened:
                print(self.success_message)
                self.door_opened = True
            else:
                print(
                    "You found the correct key, but the door is already open."
                )
            return True
        return False


class RPGKeys(Enum):
    pass

dada8791e52e2a25d41707e30c3e301f3c3d0b93
<mask token>


class Key(Object):
    <mask token>
    <mask token>


class RPGKeys(Enum):
    pass

<mask token>


class Key(Object):
    <mask token>

    def use(self, game):
        if isinstance(game.current_location, self.correct_place):
            if not self.door_opened:
                print(self.success_message)
                self.door_opened = True
            else:
                print(
                    'You found the correct key, but the door is already open.')
            return True
        return False


class RPGKeys(Enum):
    pass

<mask token>


class Key(Object):

    def __init__(self, success_message, correct_place):
        self.success_message = success_message
        self.door_opened = False
        self.correct_place = correct_place

    def use(self, game):
        if isinstance(game.current_location, self.correct_place):
            if not self.door_opened:
                print(self.success_message)
                self.door_opened = True
            else:
                print(
                    'You found the correct key, but the door is already open.')
            return True
        return False


class RPGKeys(Enum):
    pass

from enum import Enum
from rpg.objects import Object


class Key(Object):

    def __init__(self, success_message, correct_place):
        self.success_message = success_message
        self.door_opened = False
        self.correct_place = correct_place

    def use(self, game):
        if isinstance(game.current_location, self.correct_place):
            if not self.door_opened:
                print(self.success_message)
                self.door_opened = True
            else:
                print(
                    'You found the correct key, but the door is already open.')
            return True
        return False


class RPGKeys(Enum):
    pass

from enum import Enum

from rpg.objects import Object


class Key(Object):
    def __init__(self, success_message, correct_place):
        self.success_message = success_message
        self.door_opened = False
        self.correct_place = correct_place

    def use(self, game):
        if isinstance(game.current_location, self.correct_place):
            if not self.door_opened:
                print(self.success_message)
                self.door_opened = True
            else:
                print(
                    "You found the correct key, but the door is already open."
                )
            return True
        return False


class RPGKeys(Enum):
    pass
