# Path: commands/core.py
# class Resolvable(metaclass=abc.ABCMeta):
# 
#     @abc.abstractmethod
#     def resolve(self, scope):
#         pass
# 
# class EntityRef(Resolvable, metaclass=abc.ABCMeta):
# 
#     @abc.abstractmethod
#     def is_single_entity(self, scope):
#         pass
# 
#     @property
#     def ref(self):
#         from .nbt import EntityReference
#         return EntityReference(self)
# 
# Path: commands/scoreboard.py
# class ObjectiveRef(Resolvable):
# 
#     def __init__(self, name):
#         assert type(name) == str
#         self.objective = name
# 
#     def resolve(self, scope):
#         return scope.objective(self.objective)


from .core import Resolvable, EntityRef
from .scoreboard import ObjectiveRef

class SelectorArgs(Resolvable):
    pass

class SimpleSelectorArgs(SelectorArgs):
    def __init__(self, args):
        self.args = args

    def resolve(self, scope):
        return dict(self.args)

class ScoreRange(Resolvable):

    def __init__(self, min=None, max=None):
        assert min is not None or max is not None
        self.min = min
        self.max = max

    def resolve(self, scope):
        range = ''
        if self.min is not None:
            range = '%d' % self.min
        if self.max is not None and self.max != self.min:
            range += '..%d' % self.max
        elif self.max is None:
            range += '..'
        return range

class SelRange(SelectorArgs):
    def __init__(self, objective, min=None, max=None):

# Path: commands/core.py
# class Resolvable(metaclass=abc.ABCMeta):
# 
#     @abc.abstractmethod
#     def resolve(self, scope):
#         pass
# 
# class EntityRef(Resolvable, metaclass=abc.ABCMeta):
# 
#     @abc.abstractmethod
#     def is_single_entity(self, scope):
#         pass
# 
#     @property
#     def ref(self):
#         from .nbt import EntityReference
#         return EntityReference(self)
# 
# Path: commands/scoreboard.py
# class ObjectiveRef(Resolvable):
# 
#     def __init__(self, name):
#         assert type(name) == str
#         self.objective = name
# 
#     def resolve(self, scope):
#         return scope.objective(self.objective)


# Path: commands/selector.py
from .core import Resolvable, EntityRef
from .scoreboard import ObjectiveRef


class SelectorArgs(Resolvable):
    pass

class SimpleSelectorArgs(SelectorArgs):
    def __init__(self, args):
        self.args = args

    def resolve(self, scope):
        return dict(self.args)

class ScoreRange(Resolvable):

    def __init__(self, min=None, max=None):
        assert min is not None or max is not None
        self.min = min
        self.max = max

    def resolve(self, scope):
        range = ''
        if self.min is not None:
            range = '%d' % self.min
        if self.max is not None and self.max != self.min:
            range += '..%d' % self.max
        elif self.max is None:
            range += '..'
        return range

class SelRange(SelectorArgs):
    def __init__(self, objective, min=None, max=None):

        assert isinstance(objective, ObjectiveRef)