# Path: icon.py
# ROW_LENGTH = 16
# 
# Path: init.py
# FONT_FILE_PATH = os.path.join('fonts', 'terminal16x16_gs_ro.png')


import colors
import frame
import settings
import libtcodpy as libtcod
from icon import ROW_LENGTH
from init import FONT_FILE_PATH

    def set_symbol(self, position, icon, console=0):
        x, y = position
        libtcod.console_set_char(console, x, y, icon)

    def set_color_fg(self, position, color, console=0):
        x, y = position
        libtcod.console_set_char_foreground(console, x, y, color)

    def set_color_bg(self, position, color, effect=libtcod.BKGND_SET, console=0):
        x, y = position
        libtcod.console_set_char_background(console, x, y, color, effect)

    def print_text(self, position, text):
        for idx, char in enumerate(text):
            self.set_color_fg((position[0] + idx, position[1]),
                              self.get_default_color_fg())
            self.set_symbol((position[0] + idx, position[1]), char)

    def print_text_vertical(self, position, text):
        for idx, char in enumerate(text):
            self.set_color_fg((position[0], position[1] + idx), self.get_default_color_fg())
            self.set_symbol((position[0], position[1] + idx), char)

    def set_colors_and_symbol(self, position, color_fg, color_bg, icon, console=0):
        x, y = position
        libtcod.console_put_char_ex(console, x, y, icon, color_fg, color_bg)

    def print_char_big(self, icon_position, destination, console=0):
        source_pixel_x = (icon_position % ROW_LENGTH) * settings.TILE_WIDTH

# Path: icon.py
# ROW_LENGTH = 16
# 
# Path: init.py
# FONT_FILE_PATH = os.path.join('fonts', 'terminal16x16_gs_ro.png')


# Path: console.py
import colors
import frame
import settings
import libtcodpy as libtcod
from icon import ROW_LENGTH
from init import FONT_FILE_PATH


    def set_symbol(self, position, icon, console=0):
        x, y = position
        libtcod.console_set_char(console, x, y, icon)

    def set_color_fg(self, position, color, console=0):
        x, y = position
        libtcod.console_set_char_foreground(console, x, y, color)

    def set_color_bg(self, position, color, effect=libtcod.BKGND_SET, console=0):
        x, y = position
        libtcod.console_set_char_background(console, x, y, color, effect)

    def print_text(self, position, text):
        for idx, char in enumerate(text):
            self.set_color_fg((position[0] + idx, position[1]),
                              self.get_default_color_fg())
            self.set_symbol((position[0] + idx, position[1]), char)

    def print_text_vertical(self, position, text):
        for idx, char in enumerate(text):
            self.set_color_fg((position[0], position[1] + idx), self.get_default_color_fg())
            self.set_symbol((position[0], position[1] + idx), char)

    def set_colors_and_symbol(self, position, color_fg, color_bg, icon, console=0):
        x, y = position
        libtcod.console_put_char_ex(console, x, y, icon, color_fg, color_bg)

    def print_char_big(self, icon_position, destination, console=0):
        source_pixel_x = (icon_position % ROW_LENGTH) * settings.TILE_WIDTH

        source_pixel_y = (icon_position / ROW_LENGTH) * settings.TILE_WIDTH