# Path: commands/core.py
# class Command(Resolvable):
#     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 Resolvable(metaclass=abc.ABCMeta):
# 
#     @abc.abstractmethod
#     def resolve(self, scope):
#         pass
# 
# Path: commands/scoreboard.py
# class ScoreRef(Resolvable):
# 
#     def __init__(self, target, objective):
#         assert isinstance(target, EntityRef)
#         assert isinstance(objective, ObjectiveRef)
#         self.target = target
#         self.objective = objective
# 
#     def resolve(self, scope):
#         return '%s %s' % (self.target.resolve(scope),
#                           self.objective.resolve(scope))
# 
# Path: commands/nbt.py
# class Path(NbtPath):
# 
#     def resolve(self, scope):
#         return scope.custom_nbt_path(self.path)
# 
# class NBTStorable(Resolvable):
#     pass


import json
from .core import Command, EntityRef, Resolvable
from .scoreboard import ScoreRef
from .nbt import Path, NBTStorable
                    extra.append(child_child.resolve(scope))
            else:
                extra.append(child.resolve(scope))
        if not self.style:
            return extra
        if extra:
            if len(extra) == 1 and type(extra[0]) == dict:
                text.update(extra[0])
            else:
                text['extra'] = extra
        return text

    def _resolve_style(self, key, value, scope):
        if key == 'clickEvent':
            assert isinstance(value, TextClickAction)
            return value.resolve(scope)
        return value

class TextStringComponent(TextComponent):

    def __init__(self, stringval):
        self.val = stringval

    def resolve(self, scope):
        return {'text': self.val}

class TextNBTComponent(TextComponent):

    def __init__(self, storage, path):
        assert isinstance(storage, NBTStorable)

# Path: commands/core.py
# class Command(Resolvable):
#     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 Resolvable(metaclass=abc.ABCMeta):
# 
#     @abc.abstractmethod
#     def resolve(self, scope):
#         pass
# 
# Path: commands/scoreboard.py
# class ScoreRef(Resolvable):
# 
#     def __init__(self, target, objective):
#         assert isinstance(target, EntityRef)
#         assert isinstance(objective, ObjectiveRef)
#         self.target = target
#         self.objective = objective
# 
#     def resolve(self, scope):
#         return '%s %s' % (self.target.resolve(scope),
#                           self.objective.resolve(scope))
# 
# Path: commands/nbt.py
# class Path(NbtPath):
# 
#     def resolve(self, scope):
#         return scope.custom_nbt_path(self.path)
# 
# class NBTStorable(Resolvable):
#     pass


# Path: commands/text.py
import json
from .core import Command, EntityRef, Resolvable
from .scoreboard import ScoreRef
from .nbt import Path, NBTStorable

                    extra.append(child_child.resolve(scope))
            else:
                extra.append(child.resolve(scope))
        if not self.style:
            return extra
        if extra:
            if len(extra) == 1 and type(extra[0]) == dict:
                text.update(extra[0])
            else:
                text['extra'] = extra
        return text

    def _resolve_style(self, key, value, scope):
        if key == 'clickEvent':
            assert isinstance(value, TextClickAction)
            return value.resolve(scope)
        return value

class TextStringComponent(TextComponent):

    def __init__(self, stringval):
        self.val = stringval

    def resolve(self, scope):
        return {'text': self.val}

class TextNBTComponent(TextComponent):

    def __init__(self, storage, path):
        assert isinstance(storage, NBTStorable)

        assert isinstance(path, Path)