# Path: commands/core.py
# class Command(Resolvable):
#     pass
# 
# 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)
# 
# class GlobalEntity(EntityRef):
# 
#     def __init__(self, namespace):
#         self.namespace = namespace
#     
#     def is_single_entity(self, scope):
#         return True
# 
#     def resolve(self, scope):
#         return scope.global_entity(self.namespace)


from .core import Command, Resolvable, EntityRef, GlobalEntity
        assert isinstance(right, ScoreRef)
        self.left = left
        self.right = right

    def resolve(self, scope):
        return 'scoreboard players operation %s %s %s' % (
            self.left.resolve(scope), self.op, self.right.resolve(scope))

class OpAssign(Operation): op = '='
class OpAdd(Operation): op = '+='
class OpSub(Operation): op = '-='
class OpMul(Operation): op = '*='
class OpDiv(Operation): op = '/='
class OpMod(Operation): op = '%='
class OpIfLt(Operation): op = '<'
class OpIfGt(Operation): op = '>'
class OpSwap(Operation): op = '><'

class ObjectiveRef(Resolvable):

    def __init__(self, name):
        assert type(name) == str
        self.objective = name

    def resolve(self, scope):
        return scope.objective(self.objective)

class ScoreRef(Resolvable):

    def __init__(self, target, objective):

# Path: commands/core.py
# class Command(Resolvable):
#     pass
# 
# 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)
# 
# class GlobalEntity(EntityRef):
# 
#     def __init__(self, namespace):
#         self.namespace = namespace
#     
#     def is_single_entity(self, scope):
#         return True
# 
#     def resolve(self, scope):
#         return scope.global_entity(self.namespace)


# Path: commands/scoreboard.py
from .core import Command, Resolvable, EntityRef, GlobalEntity

        assert isinstance(right, ScoreRef)
        self.left = left
        self.right = right

    def resolve(self, scope):
        return 'scoreboard players operation %s %s %s' % (
            self.left.resolve(scope), self.op, self.right.resolve(scope))

class OpAssign(Operation): op = '='
class OpAdd(Operation): op = '+='
class OpSub(Operation): op = '-='
class OpMul(Operation): op = '*='
class OpDiv(Operation): op = '/='
class OpMod(Operation): op = '%='
class OpIfLt(Operation): op = '<'
class OpIfGt(Operation): op = '>'
class OpSwap(Operation): op = '><'

class ObjectiveRef(Resolvable):

    def __init__(self, name):
        assert type(name) == str
        self.objective = name

    def resolve(self, scope):
        return scope.objective(self.objective)

class ScoreRef(Resolvable):

    def __init__(self, target, objective):

        assert isinstance(target, EntityRef)