# Path: characters/enums.py
# class Sex(Enum):
#     Male = 0
#     Female = 1
#     Androgynous = 2
# 
# Path: components/game_object.py
# class NoneVoid(object):
#     """
#     This class's only purpose is to Falsify any other calls make to get attributes from it.
#     It allows us to duck type into components a little easier.
#     """
#     def __getattr__(self, item):
#         return None
# 
#     def __bool__(self):
#         return False


from characters.enums import Sex
from enum import Enum
from collections import defaultdict
from components.game_object import NoneVoid
    def __init__(self, console, game_context):
        self.console = console
        self.game_context = game_context
        if not EchoService.singleton:
            EchoService.singleton = self

    def combat_context_echo(self, message, attacker=None, defender=None,
                            attacker_weapon=None, defender_weapon=None, defender_bodypart=None):
        context_variables = defaultdict(lambda: "N/A")
        context_variables["player"] = self.game_context.player

        if attacker:
            context_variables["attacker"] = attacker
        if defender:
            context_variables["defender"] = defender
        if attacker_weapon:
            context_variables["attacker_weapon"] = attacker_weapon
        if defender_weapon:
            context_variables["defender_weapon"] = defender_weapon
        if defender_bodypart:
            context_variables["defender_bodypart"] = defender_bodypart

        for context_variable in context_variables.keys():
            if context_variable in message_router:
                context_variables[context_variable] = message_router[context_variable](**context_variables)

        for variable in MessageVariables:
            if variable.value in message and variable.name not in context_variables and variable.name in message_router:
                context_variables[variable.name] = message_router[variable.name](**context_variables)


# Path: characters/enums.py
# class Sex(Enum):
#     Male = 0
#     Female = 1
#     Androgynous = 2
# 
# Path: components/game_object.py
# class NoneVoid(object):
#     """
#     This class's only purpose is to Falsify any other calls make to get attributes from it.
#     It allows us to duck type into components a little easier.
#     """
#     def __getattr__(self, item):
#         return None
# 
#     def __bool__(self):
#         return False


# Path: managers/echo.py
from characters.enums import Sex
from enum import Enum
from collections import defaultdict
from components.game_object import NoneVoid

    def __init__(self, console, game_context):
        self.console = console
        self.game_context = game_context
        if not EchoService.singleton:
            EchoService.singleton = self

    def combat_context_echo(self, message, attacker=None, defender=None,
                            attacker_weapon=None, defender_weapon=None, defender_bodypart=None):
        context_variables = defaultdict(lambda: "N/A")
        context_variables["player"] = self.game_context.player

        if attacker:
            context_variables["attacker"] = attacker
        if defender:
            context_variables["defender"] = defender
        if attacker_weapon:
            context_variables["attacker_weapon"] = attacker_weapon
        if defender_weapon:
            context_variables["defender_weapon"] = defender_weapon
        if defender_bodypart:
            context_variables["defender_bodypart"] = defender_bodypart

        for context_variable in context_variables.keys():
            if context_variable in message_router:
                context_variables[context_variable] = message_router[context_variable](**context_variables)

        for variable in MessageVariables:
            if variable.value in message and variable.name not in context_variables and variable.name in message_router:
                context_variables[variable.name] = message_router[variable.name](**context_variables)


        formatted_message = message.format(**context_variables)