# Path: twistedbot/plugins/base.py
# class PluginChatBase(PluginBase):
# 
#     def send_chat_message(self, msg):
#         self.world.chat.send_chat_message(msg)
# 
#     @abc.abstractproperty
#     def command_verb(self):
#         pass
# 
#     @property
#     def aliases(self):
#         return []
# 
#     @abc.abstractproperty
#     def help(self):
#         pass
# 
#     @abc.abstractmethod
#     def command(self, sender, command, args):
#         pass
# 
# Path: twistedbot/behavior_tree.py
# class WalkSigns(BTGoal):
#     def __init__(self, group=None, walk_type=None, **kwargs):
#         super(WalkSigns, self).__init__(**kwargs)
#         self.signpoint = None
#         self.signpoint_forward_direction = True
#         self.group = group
#         self.walk_type = walk_type
#         self.name = '%s signs in group "%s"' % (self.walk_type, self.group)
# 
#     @property
#     def goal_reached(self):
#         return False
# 
#     def setup(self):
#         if self.walk_type == "circulate":
#             self.next_sign = self.blackboard.sign_waypoints_get_groupnext_circulate
#         elif self.walk_type == "rotate":
#             self.next_sign = self.blackboard.sign_waypoints_get_groupnext_rotate
# 
#     def is_valid(self):
#         if not self.blackboard.sign_waypoints_has_group(self.group):
#             self.blackboard.send_chat_message("no group named '%s'" % self.group)
#             return False
#         return True
# 
#     def choices(self):
#         while self.is_valid():
#             new_signpoint, self.signpoint_forward_direction = self.next_sign(self.group, self.signpoint, self.signpoint_forward_direction)
#             if new_signpoint == self.signpoint:
#                 break
#             else:
#                 self.signpoint = new_signpoint
#             if not self.blackboard.sign_waypoints_check_sign(self.signpoint):
#                 continue
#             log.msg("go to sign %s" % self.signpoint)
#             yield self.make_behavior(TravelTo, coords=self.signpoint.coords)


from twistedbot.plugins.base import PluginChatBase
from twistedbot.behavior_tree import WalkSigns



class Rotate(PluginChatBase):
    @property
    def command_verb(self):
        return "rotate"

    @property
    def aliases(self):
        return ["circulate"]

    @property
    def help(self):
        return ["rotate/circulate sign group",

# Path: twistedbot/plugins/base.py
# class PluginChatBase(PluginBase):
# 
#     def send_chat_message(self, msg):
#         self.world.chat.send_chat_message(msg)
# 
#     @abc.abstractproperty
#     def command_verb(self):
#         pass
# 
#     @property
#     def aliases(self):
#         return []
# 
#     @abc.abstractproperty
#     def help(self):
#         pass
# 
#     @abc.abstractmethod
#     def command(self, sender, command, args):
#         pass
# 
# Path: twistedbot/behavior_tree.py
# class WalkSigns(BTGoal):
#     def __init__(self, group=None, walk_type=None, **kwargs):
#         super(WalkSigns, self).__init__(**kwargs)
#         self.signpoint = None
#         self.signpoint_forward_direction = True
#         self.group = group
#         self.walk_type = walk_type
#         self.name = '%s signs in group "%s"' % (self.walk_type, self.group)
# 
#     @property
#     def goal_reached(self):
#         return False
# 
#     def setup(self):
#         if self.walk_type == "circulate":
#             self.next_sign = self.blackboard.sign_waypoints_get_groupnext_circulate
#         elif self.walk_type == "rotate":
#             self.next_sign = self.blackboard.sign_waypoints_get_groupnext_rotate
# 
#     def is_valid(self):
#         if not self.blackboard.sign_waypoints_has_group(self.group):
#             self.blackboard.send_chat_message("no group named '%s'" % self.group)
#             return False
#         return True
# 
#     def choices(self):
#         while self.is_valid():
#             new_signpoint, self.signpoint_forward_direction = self.next_sign(self.group, self.signpoint, self.signpoint_forward_direction)
#             if new_signpoint == self.signpoint:
#                 break
#             else:
#                 self.signpoint = new_signpoint
#             if not self.blackboard.sign_waypoints_check_sign(self.signpoint):
#                 continue
#             log.msg("go to sign %s" % self.signpoint)
#             yield self.make_behavior(TravelTo, coords=self.signpoint.coords)


# Path: twistedbot/plugins/core/chat_rotate.py
from twistedbot.plugins.base import PluginChatBase
from twistedbot.behavior_tree import WalkSigns




class Rotate(PluginChatBase):
    @property
    def command_verb(self):
        return "rotate"

    @property
    def aliases(self):
        return ["circulate"]

    @property
    def help(self):
        return ["rotate/circulate sign group",

                "rotate - 'group' rotates (after the end, goes back to the beginning) between signs (see readme)",