# Path: evdemo/evscaperoom/utils.py
# def create_evscaperoom_object(typeclass=None, key="testobj", location=None,
#                               delete_duplicates=True, **kwargs):
#     """
#     This is a convenience-wrapper for quickly building EvscapeRoom objects. This
#     is called from the helper-method create_object on states, but is also useful
#     for the object-create admin command.
# 
#     Note that for the purpose of the Evscaperoom, we only allow one instance
#     of each *name*, deleting the old version if it already exists.
# 
#     Kwargs:
#         typeclass (str): This can take just the class-name in the evscaperoom's
#             objects.py module. Otherwise, a full path is needed.
#         key (str): Name of object.
#         location (Object): The location to create new object.
#         delete_duplicates (bool): Delete old object with same key.
#         kwargs (any): Will be passed into create_object.
#     Returns:
#         new_obj (Object): The newly created object, if any.
# 
# 
#     """
#     if not (callable(typeclass) or
#             typeclass.startswith("evennia") or
#             typeclass.startswith("typeclasses") or
#             typeclass.startswith("evscaperoom")):
#         # unless we specify a full typeclass path or the class itself,
#         # auto-complete it
#         typeclass = _BASE_TYPECLASS_PATH + typeclass
# 
#     if delete_duplicates:
#         old_objs = [obj for obj in search_object(key)
#                     if not inherits_from(obj, "evennia.objects.objects.DefaultCharacter")]
#         if location:
#             # delete only matching objects in the given location
#             [obj.delete() for obj in old_objs if obj.location == location]
#         else:
#             [obj.delete() for obj in old_objs]
# 
#     new_obj = create_object(typeclass=typeclass, key=key,
#                             location=location, **kwargs)
#     return new_obj


import types
import re
from django.conf import settings
from evennia import SESSION_HANDLER
from evennia import Command, CmdSet, InterruptCommand, default_cmds
from evennia import syscmdkeys, DefaultObject
from evennia.utils import variable_from_module, list_to_string, inherits_from
from .utils import create_evscaperoom_object
        from .menu import run_evscaperoom_menu
        from .menu import run_option_menu
        from evennia.commands import cmdhandler
        from .menu import run_evscaperoom_menu
      or objects you can examine with |wex <detail>|n. Use |wex|n (or |wexamine|n)
      on its own to un-focus and go back to looking at the room.
    - |whelp [obj or command]|n           - get usage help (never puzzle-related)
    - |woptions|n                         - set game/accessibility options
    - |wlook/l [obj]|n                    - give things a cursory look.
    - |wexamine/ex/e [obj]|n              - look closer at an object. Use again to
                                        look away.
    - |wstand|n                           - stand up if you were sitting, lying etc.
   |yHow to express yourself ...|n
    - |wwho [all]|n                       - show who's in the room or on server.
    - |wemote/pose/: <something>|n        - free-form emote. Use /me to refer
                                        to yourself and /name to refer to other
                                        things/players. Use quotes "..." to speak.
    - |wsay/; <something>|n               - quick-speak your mind
    - |wwhisper <something>|n             - whisper your mind
    - |wshout <something>|n               - shout your mind
   |yHow to quit like a little baby ...|n
    - |wquit / give up|n                  - admit defeat and give up
"""

_HELP_FALLBACK_TEXT = """
There is no help to be had about |y{this}|n. To look away, use |wexamine|n on
its own or with another object you are interested in.
"""

_QUIT_WARNING = """
|rDo you really want to quit and let the Jester beat you?|n

{warning}


# Path: evdemo/evscaperoom/utils.py
# def create_evscaperoom_object(typeclass=None, key="testobj", location=None,
#                               delete_duplicates=True, **kwargs):
#     """
#     This is a convenience-wrapper for quickly building EvscapeRoom objects. This
#     is called from the helper-method create_object on states, but is also useful
#     for the object-create admin command.
# 
#     Note that for the purpose of the Evscaperoom, we only allow one instance
#     of each *name*, deleting the old version if it already exists.
# 
#     Kwargs:
#         typeclass (str): This can take just the class-name in the evscaperoom's
#             objects.py module. Otherwise, a full path is needed.
#         key (str): Name of object.
#         location (Object): The location to create new object.
#         delete_duplicates (bool): Delete old object with same key.
#         kwargs (any): Will be passed into create_object.
#     Returns:
#         new_obj (Object): The newly created object, if any.
# 
# 
#     """
#     if not (callable(typeclass) or
#             typeclass.startswith("evennia") or
#             typeclass.startswith("typeclasses") or
#             typeclass.startswith("evscaperoom")):
#         # unless we specify a full typeclass path or the class itself,
#         # auto-complete it
#         typeclass = _BASE_TYPECLASS_PATH + typeclass
# 
#     if delete_duplicates:
#         old_objs = [obj for obj in search_object(key)
#                     if not inherits_from(obj, "evennia.objects.objects.DefaultCharacter")]
#         if location:
#             # delete only matching objects in the given location
#             [obj.delete() for obj in old_objs if obj.location == location]
#         else:
#             [obj.delete() for obj in old_objs]
# 
#     new_obj = create_object(typeclass=typeclass, key=key,
#                             location=location, **kwargs)
#     return new_obj


# Path: evdemo/evscaperoom/commands.py
import types
import re
from django.conf import settings
from evennia import SESSION_HANDLER
from evennia import Command, CmdSet, InterruptCommand, default_cmds
from evennia import syscmdkeys, DefaultObject
from evennia.utils import variable_from_module, list_to_string, inherits_from
from .utils import create_evscaperoom_object
        from .menu import run_evscaperoom_menu
        from .menu import run_option_menu
        from evennia.commands import cmdhandler
        from .menu import run_evscaperoom_menu

      or objects you can examine with |wex <detail>|n. Use |wex|n (or |wexamine|n)
      on its own to un-focus and go back to looking at the room.
    - |whelp [obj or command]|n           - get usage help (never puzzle-related)
    - |woptions|n                         - set game/accessibility options
    - |wlook/l [obj]|n                    - give things a cursory look.
    - |wexamine/ex/e [obj]|n              - look closer at an object. Use again to
                                        look away.
    - |wstand|n                           - stand up if you were sitting, lying etc.
   |yHow to express yourself ...|n
    - |wwho [all]|n                       - show who's in the room or on server.
    - |wemote/pose/: <something>|n        - free-form emote. Use /me to refer
                                        to yourself and /name to refer to other
                                        things/players. Use quotes "..." to speak.
    - |wsay/; <something>|n               - quick-speak your mind
    - |wwhisper <something>|n             - whisper your mind
    - |wshout <something>|n               - shout your mind
   |yHow to quit like a little baby ...|n
    - |wquit / give up|n                  - admit defeat and give up
"""

_HELP_FALLBACK_TEXT = """
There is no help to be had about |y{this}|n. To look away, use |wexamine|n on
its own or with another object you are interested in.
"""

_QUIT_WARNING = """
|rDo you really want to quit and let the Jester beat you?|n

{warning}


Enter |w'quit'|n again to truly give up.