# Path: counter.py
# class Counter(object):
#     def __init__(self, init_value, max_value, min_value=0):
#         if not(min_value <= init_value <= max_value):
#             raise Exception("Incorrectly Initialized Counter")
# 
#         self._value = init_value
#         self.min_value = min_value
#         self.max_value = max_value
# 
#     @property
#     def value(self):
#         return self._value
# 
#     @value.setter
#     def value(self, new_value):
#         self._value = new_value
# 
#     def ratio_of_full(self):
#         return float(self.value - self.min_value) / float(self.size())
# 
#     def is_full(self):
#         return self.value == self.max_value
# 
#     def size(self):
#         return self.max_value - self.min_value
# 
#     def decrease(self, delta):
#         self._value = max(self.min_value, self.value - delta)
# 
#     def increase(self, delta):
#         self._value = min(self.max_value, self.value + delta)
# 
#     def set_max(self):
#         self._value = self.max_value
# 
#     def set_min(self):
#         self._value = self.min_value
# 
# Path: equipment.py
# class EquipmentSlots(object):
#     #  Weapons
#     MELEE_WEAPON = EquipmentSlot("Melee Weapon", EquipmentTypes.MELEE_WEAPON, icon.SWORD)
#     RANGED_WEAPON = EquipmentSlot("Ranged Weapon", EquipmentTypes.RANGED_WEAPON, icon.GUN)
# 
#     #  Armor
#     HEADGEAR = EquipmentSlot("Headgear", EquipmentTypes.HEADGEAR, icon.HELM)
#     ARMOR = EquipmentSlot("Armor", EquipmentTypes.ARMOR, icon.ARMOR)
#     BOOTS = EquipmentSlot("Boots", EquipmentTypes.BOOTS, icon.BOOTS)
# 
#     #  Jewelry
#     RIGHT_RING = EquipmentSlot("Right Ring", EquipmentTypes.RING, icon.RING)
#     LEFT_RING = EquipmentSlot("Left Ring", EquipmentTypes.RING, icon.RING)
#     AMULET = EquipmentSlot("Amulet", EquipmentTypes.AMULET, icon.AMULET)
# 
#     ALL = [MELEE_WEAPON, RANGED_WEAPON, HEADGEAR, ARMOR,
#            BOOTS, RIGHT_RING, LEFT_RING, AMULET]


import action
import constants
import colors
import dungeoncreatorvisualizer
import gametime
import geometry as geo
import graphic
import gui
import menu
import rectfactory
import sacrifice
import save
import settings
import state
import style
import icon
from counter import Counter
from equipment import EquipmentSlots
    background_rect = get_menu_background(context_menu_rect)

    ui_elements = [background_rect, resulting_menu]
    ui_state = state.UIState(gui.UIElementList(ui_elements))
    return ui_state


def new_player_status_stack(player, width):
    text_margin = width - 3
    text_box_margin = (0, 0)
    strength_text_box = gui.TextBox("Str" + str(player.strength.value).rjust(text_margin), text_box_margin,
                                    colors.ORANGE)
    armor_text_box = gui.TextBox("Def" + str(player.armor.value).rjust(text_margin), text_box_margin, colors.GRAY)
    evasion_text_box = gui.TextBox("Eva" + str(player.evasion.value).rjust(text_margin), text_box_margin, colors.GREEN)
    stealth_text_box = gui.TextBox("Sth" + str(player.stealth.value).rjust(text_margin), text_box_margin, colors.BLUE)
    movement_speed_text_box = gui.TextBox("Mov" + str(int(120.0 / player.movement_speed.value * 10)).rjust(text_margin),
                                          text_box_margin, colors.CHAMPAGNE)

    status_stack_panel = gui.StackPanelVertical((0, 0), alignment=gui.StackPanelVertical.ALIGN_LEFT, vertical_space=0)
    status_stack_panel.append(strength_text_box)
    status_stack_panel.append(armor_text_box)
    status_stack_panel.append(evasion_text_box)
    status_stack_panel.append(stealth_text_box)
    status_stack_panel.append(movement_speed_text_box)
    return status_stack_panel


def new_player_weapon_table(player, width):
    equipment = player.equipment
    if equipment.slot_is_equiped(EquipmentSlots.MELEE_WEAPON):

# Path: counter.py
# class Counter(object):
#     def __init__(self, init_value, max_value, min_value=0):
#         if not(min_value <= init_value <= max_value):
#             raise Exception("Incorrectly Initialized Counter")
# 
#         self._value = init_value
#         self.min_value = min_value
#         self.max_value = max_value
# 
#     @property
#     def value(self):
#         return self._value
# 
#     @value.setter
#     def value(self, new_value):
#         self._value = new_value
# 
#     def ratio_of_full(self):
#         return float(self.value - self.min_value) / float(self.size())
# 
#     def is_full(self):
#         return self.value == self.max_value
# 
#     def size(self):
#         return self.max_value - self.min_value
# 
#     def decrease(self, delta):
#         self._value = max(self.min_value, self.value - delta)
# 
#     def increase(self, delta):
#         self._value = min(self.max_value, self.value + delta)
# 
#     def set_max(self):
#         self._value = self.max_value
# 
#     def set_min(self):
#         self._value = self.min_value
# 
# Path: equipment.py
# class EquipmentSlots(object):
#     #  Weapons
#     MELEE_WEAPON = EquipmentSlot("Melee Weapon", EquipmentTypes.MELEE_WEAPON, icon.SWORD)
#     RANGED_WEAPON = EquipmentSlot("Ranged Weapon", EquipmentTypes.RANGED_WEAPON, icon.GUN)
# 
#     #  Armor
#     HEADGEAR = EquipmentSlot("Headgear", EquipmentTypes.HEADGEAR, icon.HELM)
#     ARMOR = EquipmentSlot("Armor", EquipmentTypes.ARMOR, icon.ARMOR)
#     BOOTS = EquipmentSlot("Boots", EquipmentTypes.BOOTS, icon.BOOTS)
# 
#     #  Jewelry
#     RIGHT_RING = EquipmentSlot("Right Ring", EquipmentTypes.RING, icon.RING)
#     LEFT_RING = EquipmentSlot("Left Ring", EquipmentTypes.RING, icon.RING)
#     AMULET = EquipmentSlot("Amulet", EquipmentTypes.AMULET, icon.AMULET)
# 
#     ALL = [MELEE_WEAPON, RANGED_WEAPON, HEADGEAR, ARMOR,
#            BOOTS, RIGHT_RING, LEFT_RING, AMULET]


# Path: menufactory.py
import action
import constants
import colors
import dungeoncreatorvisualizer
import gametime
import geometry as geo
import graphic
import gui
import menu
import rectfactory
import sacrifice
import save
import settings
import state
import style
import icon
from counter import Counter
from equipment import EquipmentSlots

    background_rect = get_menu_background(context_menu_rect)

    ui_elements = [background_rect, resulting_menu]
    ui_state = state.UIState(gui.UIElementList(ui_elements))
    return ui_state


def new_player_status_stack(player, width):
    text_margin = width - 3
    text_box_margin = (0, 0)
    strength_text_box = gui.TextBox("Str" + str(player.strength.value).rjust(text_margin), text_box_margin,
                                    colors.ORANGE)
    armor_text_box = gui.TextBox("Def" + str(player.armor.value).rjust(text_margin), text_box_margin, colors.GRAY)
    evasion_text_box = gui.TextBox("Eva" + str(player.evasion.value).rjust(text_margin), text_box_margin, colors.GREEN)
    stealth_text_box = gui.TextBox("Sth" + str(player.stealth.value).rjust(text_margin), text_box_margin, colors.BLUE)
    movement_speed_text_box = gui.TextBox("Mov" + str(int(120.0 / player.movement_speed.value * 10)).rjust(text_margin),
                                          text_box_margin, colors.CHAMPAGNE)

    status_stack_panel = gui.StackPanelVertical((0, 0), alignment=gui.StackPanelVertical.ALIGN_LEFT, vertical_space=0)
    status_stack_panel.append(strength_text_box)
    status_stack_panel.append(armor_text_box)
    status_stack_panel.append(evasion_text_box)
    status_stack_panel.append(stealth_text_box)
    status_stack_panel.append(movement_speed_text_box)
    return status_stack_panel


def new_player_weapon_table(player, width):
    equipment = player.equipment
    if equipment.slot_is_equiped(EquipmentSlots.MELEE_WEAPON):

        melee_graphic = equipment.get(EquipmentSlots.MELEE_WEAPON).graphic_char