# Path: graphic.py
# class CharPrinter(Leaf):
#     def __init__(self):
#         super(CharPrinter, self).__init__()
#         self.component_type = "char_printer"
#         self._temp_animation_frames = []
# 
#     def _tick_animation(self):
#         frame = None
#         if len(self._temp_animation_frames) > 0:
#             frame = self._temp_animation_frames.pop(0)
#         return frame
# 
#     def clear_animation(self):
#         self._temp_animation_frames = []
# 
#     def draw(self, position, the_console=0):
#         """
#         Draws the char on the given position on the console.
#         """
#         animation_frame = self._tick_animation()
#         if animation_frame:
#             return draw_graphic_char_to_console(position, animation_frame, the_console)
#         draw_graphic_char_to_console(position, self.parent.graphic_char, the_console)
# 
#     def draw_unseen(self, screen_position, the_console=0):
#         """
#         Draws the char as it looks like outside the field of view.
#         """
#         self._tick_animation()
#         console.console.set_colors_and_symbol(screen_position,
#                                               colors.UNSEEN_FG,
#                                               colors.UNSEEN_BG,
#                                               self.parent.graphic_char.icon,
#                                               console=the_console)
#     def draw_unvisited(self, screen_position, the_console=0):
#         """
#         Draws the char as it looks like outside the field of view.
#         """
#         self._tick_animation()
#         console.console.set_colors_and_symbol(screen_position,
#                                               colors.DARK_PURPLE,
#                                               colors.UNSEEN_BG,
#                                               self.parent.graphic_char.icon,
#                                               console=the_console)
# 
#     def append_graphic_char_temporary_frames(self, graphic_char_frames, animation_delay=settings.ANIMATION_DELAY):
#         """
#         Appends frames to the graphic char animation frame queue.
# 
#         These chars will be drawn as an effect,
#         the regular chars won't be drawn until the animation frame queue is empty.
#         """
#         frames = _expand_frames(graphic_char_frames, animation_delay)
#         self._temp_animation_frames.extend(frames)
# 
#     def append_fg_color_blink_frames(self, frame_colors, animation_delay=settings.ANIMATION_DELAY):
#         """
#         Appends frames to  the graphic char animation frame queue. With only fg_color changed.
# 
#         These chars will be drawn as an effect,
#         the regular chars won't be drawn until the animation frame queue is empty.
#         """
#         color_bg = self.parent.graphic_char.color_bg
#         symbol = self.parent.graphic_char.icon
#         frames = [GraphicChar(color_bg, color, symbol) for color in frame_colors]
#         self.append_graphic_char_temporary_frames(frames, animation_delay)
# 
#     def append_default_graphic_frame(self, frames=settings.ANIMATION_DELAY):
#         self.append_graphic_char_temporary_frames([self.parent.graphic_char], frames)
# 
#     def copy(self):
#         """
#         Makes a copy of this component.
#         """
#         copy = CharPrinter()
#         copy._temp_animation_frames = self._temp_animation_frames
#         return copy
# 
# Path: stats.py
# class GamePieceTypes(DataPoint):
#     ENTITY = 0
#     CLOUD = 1
#     ITEM = 2
#     DUNGEON_FEATURE = 3
#     DUNGEON_TRASH = 4
#     TERRAIN = 5
# 
#     MAX_INSTANCES_ON_TILE = {ENTITY: 1,
#                              CLOUD: 1,
#                              ITEM: 1,
#                              DUNGEON_FEATURE: 1,
#                              DUNGEON_TRASH: 1,
#                              TERRAIN: 1}
# 
# class DataPoint(Leaf):
#     """
#     Class for components holding a single data point.
#     """
#     def __init__(self, component_type, value, tags=[]):
#         super(DataPoint, self).__init__()
#         self.tags |= set(tags)
#         self.component_type = component_type
#         self.value = value
# 
# class DataTypes:
#     CLASS = "job"
#     RACE = "race"
# 
#     ENERGY = "energy"
#     CRIT_MULTIPLIER = "crit_multiplier"
#     UNARMED_CRIT_CHANCE = "unarmed_crit_chance"
#     CRIT_CHANCE = "crit_chance"
#     CRIT_CHANCE_WEAPON = "crit_chance_weapon_effect"
#     STRENGTH = "strength"
#     ARMOR = "armor"
#     ACCURACY = "accuracy"
#     DAMAGE = "damage"
#     STEALTH = "stealth"
#     AWARENESS = "awareness"
#     EVASION = "evasion"
# 
#     COUNTER_ATTACK_CHANCE = "counter_attack_chance"
#     OFFENCIVE_ATTACK_CHANCE = "offencive_attack_chance"
#     DEFENCIVE_ATTACK_CHANCE = "defencive_attack_chance"
# 
#     MELEE_SPEED = "melee_speed"
#     SHOOT_SPEED = "shoot_speed"
#     THROW_SPEED = "throw_speed"
#     THROW_ITEM_SPEED = "throw_item_speed"
#     CAST_SPEED = "cast_speed"
# 
#     MELEE_DAMAGE_MULTIPLIER = "melee_damage_multiplier"
#     THROW_DAMAGE_MULTIPLIER = "throw_damage_multiplier"
# 
#     INTELLIGENCE = "intelligence"
#     GAME_PIECE_TYPE = "game_piece_type"
#     MOVEMENT_SPEED = "movement_speed"
#     FACTION = "faction"
# 
#     WEIGHT = "weight"
#     WEAPON_RANGE = "weapon_range"
# 
#     SIGHT_RADIUS = "sight_radius"
#     SKIP_ACTION_CHANCE = "skip_action_chance"
# 
#     DENSITY = "density"
#     CLOUD_TYPE = "cloud_type"
#     CLONE_FUNCTION = "clone_function"
# 
#     MINIMUM_DEPTH = "minimum_depth"
# 
#     GAME_STATE = "game_state"


import colors
import compositecore
import frame
import terrain
from graphic import CharPrinter
from stats import GamePieceTypes, DataPoint, DataTypes


class Tile(object):
    def __init__(self):
        self.game_pieces = {
            GamePieceTypes.ENTITY: [],
            GamePieceTypes.CLOUD: [],

# Path: graphic.py
# class CharPrinter(Leaf):
#     def __init__(self):
#         super(CharPrinter, self).__init__()
#         self.component_type = "char_printer"
#         self._temp_animation_frames = []
# 
#     def _tick_animation(self):
#         frame = None
#         if len(self._temp_animation_frames) > 0:
#             frame = self._temp_animation_frames.pop(0)
#         return frame
# 
#     def clear_animation(self):
#         self._temp_animation_frames = []
# 
#     def draw(self, position, the_console=0):
#         """
#         Draws the char on the given position on the console.
#         """
#         animation_frame = self._tick_animation()
#         if animation_frame:
#             return draw_graphic_char_to_console(position, animation_frame, the_console)
#         draw_graphic_char_to_console(position, self.parent.graphic_char, the_console)
# 
#     def draw_unseen(self, screen_position, the_console=0):
#         """
#         Draws the char as it looks like outside the field of view.
#         """
#         self._tick_animation()
#         console.console.set_colors_and_symbol(screen_position,
#                                               colors.UNSEEN_FG,
#                                               colors.UNSEEN_BG,
#                                               self.parent.graphic_char.icon,
#                                               console=the_console)
#     def draw_unvisited(self, screen_position, the_console=0):
#         """
#         Draws the char as it looks like outside the field of view.
#         """
#         self._tick_animation()
#         console.console.set_colors_and_symbol(screen_position,
#                                               colors.DARK_PURPLE,
#                                               colors.UNSEEN_BG,
#                                               self.parent.graphic_char.icon,
#                                               console=the_console)
# 
#     def append_graphic_char_temporary_frames(self, graphic_char_frames, animation_delay=settings.ANIMATION_DELAY):
#         """
#         Appends frames to the graphic char animation frame queue.
# 
#         These chars will be drawn as an effect,
#         the regular chars won't be drawn until the animation frame queue is empty.
#         """
#         frames = _expand_frames(graphic_char_frames, animation_delay)
#         self._temp_animation_frames.extend(frames)
# 
#     def append_fg_color_blink_frames(self, frame_colors, animation_delay=settings.ANIMATION_DELAY):
#         """
#         Appends frames to  the graphic char animation frame queue. With only fg_color changed.
# 
#         These chars will be drawn as an effect,
#         the regular chars won't be drawn until the animation frame queue is empty.
#         """
#         color_bg = self.parent.graphic_char.color_bg
#         symbol = self.parent.graphic_char.icon
#         frames = [GraphicChar(color_bg, color, symbol) for color in frame_colors]
#         self.append_graphic_char_temporary_frames(frames, animation_delay)
# 
#     def append_default_graphic_frame(self, frames=settings.ANIMATION_DELAY):
#         self.append_graphic_char_temporary_frames([self.parent.graphic_char], frames)
# 
#     def copy(self):
#         """
#         Makes a copy of this component.
#         """
#         copy = CharPrinter()
#         copy._temp_animation_frames = self._temp_animation_frames
#         return copy
# 
# Path: stats.py
# class GamePieceTypes(DataPoint):
#     ENTITY = 0
#     CLOUD = 1
#     ITEM = 2
#     DUNGEON_FEATURE = 3
#     DUNGEON_TRASH = 4
#     TERRAIN = 5
# 
#     MAX_INSTANCES_ON_TILE = {ENTITY: 1,
#                              CLOUD: 1,
#                              ITEM: 1,
#                              DUNGEON_FEATURE: 1,
#                              DUNGEON_TRASH: 1,
#                              TERRAIN: 1}
# 
# class DataPoint(Leaf):
#     """
#     Class for components holding a single data point.
#     """
#     def __init__(self, component_type, value, tags=[]):
#         super(DataPoint, self).__init__()
#         self.tags |= set(tags)
#         self.component_type = component_type
#         self.value = value
# 
# class DataTypes:
#     CLASS = "job"
#     RACE = "race"
# 
#     ENERGY = "energy"
#     CRIT_MULTIPLIER = "crit_multiplier"
#     UNARMED_CRIT_CHANCE = "unarmed_crit_chance"
#     CRIT_CHANCE = "crit_chance"
#     CRIT_CHANCE_WEAPON = "crit_chance_weapon_effect"
#     STRENGTH = "strength"
#     ARMOR = "armor"
#     ACCURACY = "accuracy"
#     DAMAGE = "damage"
#     STEALTH = "stealth"
#     AWARENESS = "awareness"
#     EVASION = "evasion"
# 
#     COUNTER_ATTACK_CHANCE = "counter_attack_chance"
#     OFFENCIVE_ATTACK_CHANCE = "offencive_attack_chance"
#     DEFENCIVE_ATTACK_CHANCE = "defencive_attack_chance"
# 
#     MELEE_SPEED = "melee_speed"
#     SHOOT_SPEED = "shoot_speed"
#     THROW_SPEED = "throw_speed"
#     THROW_ITEM_SPEED = "throw_item_speed"
#     CAST_SPEED = "cast_speed"
# 
#     MELEE_DAMAGE_MULTIPLIER = "melee_damage_multiplier"
#     THROW_DAMAGE_MULTIPLIER = "throw_damage_multiplier"
# 
#     INTELLIGENCE = "intelligence"
#     GAME_PIECE_TYPE = "game_piece_type"
#     MOVEMENT_SPEED = "movement_speed"
#     FACTION = "faction"
# 
#     WEIGHT = "weight"
#     WEAPON_RANGE = "weapon_range"
# 
#     SIGHT_RADIUS = "sight_radius"
#     SKIP_ACTION_CHANCE = "skip_action_chance"
# 
#     DENSITY = "density"
#     CLOUD_TYPE = "cloud_type"
#     CLONE_FUNCTION = "clone_function"
# 
#     MINIMUM_DEPTH = "minimum_depth"
# 
#     GAME_STATE = "game_state"


# Path: tile.py
import colors
import compositecore
import frame
import terrain
from graphic import CharPrinter
from stats import GamePieceTypes, DataPoint, DataTypes



class Tile(object):
    def __init__(self):
        self.game_pieces = {
            GamePieceTypes.ENTITY: [],
            GamePieceTypes.CLOUD: [],

            GamePieceTypes.ITEM: [],