# Path: console.py
# class ConsoleVisual(object):
#     def __init__(self, width, height):
#     def get_color_fg(self, position):
#     def get_color_bg(self, position):
#     def get_symbol(self, position):
#     def get_default_color_fg(self):
#     def get_default_color_bg(self):
#     def set_default_color_fg(self, color, console=0):
#     def set_default_color_bg(self, color, console=0):
#     def set_symbol(self, position, icon, console=0):
#     def set_color_fg(self, position, color, console=0):
#     def set_color_bg(self, position, color, effect=libtcod.BKGND_SET, console=0):
#     def print_text(self, position, text):
#     def print_text_vertical(self, position, text):
#     def set_colors_and_symbol(self, position, color_fg, color_bg, icon, console=0):
#     def print_char_big(self, icon_position, destination, console=0):
#     def flush(self):
#     def print_screen(self):


import geometry as geo
import gui
import icon
import libtcodpy as libtcod
import colors
import inputhandler
import settings
import state
from console import console


class PositionExaminer(state.State):
    def __init__(self, state_stack, position, background_state,
                 max_distance=float("inf")):
        super(PositionExaminer, self).__init__()
        self._state_stack = state_stack
        self._cursor_position = position
        self.start_position = position
        self.max_distance = max_distance
        self.camera = background_state.camera  # Ugly, but we know the bg state is the game state.
        self.cursor_symbol = 'X'
        self.cursor_color = colors.CURSOR
        self._background_state = background_state
        self._info_text = gui.InfoTextLine(["DIRECTION to step, SHIFT + DIRECTION to step 5.",
                                            " ENTER to walk to cursor."])

    @property
    def cursor_position(self):
        return self._cursor_position

    @cursor_position.setter
    def cursor_position(self, value):
        x, y = self.camera.dungeon_to_screen_position(value)
        x = max(0, min(x, settings.SCREEN_WIDTH - 1))
        y = max(0, min(y, settings.SCREEN_HEIGHT - 1))
        self._cursor_position = self.camera.screen_to_dungeon_position((x, y))

    def update(self):

# Path: console.py
# class ConsoleVisual(object):
#     def __init__(self, width, height):
#     def get_color_fg(self, position):
#     def get_color_bg(self, position):
#     def get_symbol(self, position):
#     def get_default_color_fg(self):
#     def get_default_color_bg(self):
#     def set_default_color_fg(self, color, console=0):
#     def set_default_color_bg(self, color, console=0):
#     def set_symbol(self, position, icon, console=0):
#     def set_color_fg(self, position, color, console=0):
#     def set_color_bg(self, position, color, effect=libtcod.BKGND_SET, console=0):
#     def print_text(self, position, text):
#     def print_text_vertical(self, position, text):
#     def set_colors_and_symbol(self, position, color_fg, color_bg, icon, console=0):
#     def print_char_big(self, icon_position, destination, console=0):
#     def flush(self):
#     def print_screen(self):


# Path: positionexaminer.py
import geometry as geo
import gui
import icon
import libtcodpy as libtcod
import colors
import inputhandler
import settings
import state
from console import console



class PositionExaminer(state.State):
    def __init__(self, state_stack, position, background_state,
                 max_distance=float("inf")):
        super(PositionExaminer, self).__init__()
        self._state_stack = state_stack
        self._cursor_position = position
        self.start_position = position
        self.max_distance = max_distance
        self.camera = background_state.camera  # Ugly, but we know the bg state is the game state.
        self.cursor_symbol = 'X'
        self.cursor_color = colors.CURSOR
        self._background_state = background_state
        self._info_text = gui.InfoTextLine(["DIRECTION to step, SHIFT + DIRECTION to step 5.",
                                            " ENTER to walk to cursor."])

    @property
    def cursor_position(self):
        return self._cursor_position

    @cursor_position.setter
    def cursor_position(self, value):
        x, y = self.camera.dungeon_to_screen_position(value)
        x = max(0, min(x, settings.SCREEN_WIDTH - 1))
        y = max(0, min(y, settings.SCREEN_HEIGHT - 1))
        self._cursor_position = self.camera.screen_to_dungeon_position((x, y))

    def update(self):

        inputhandler.handler.update_keys()