abstract class Works::Struct::Base

Direct Known Subclasses

Defined in:

works/struct/base.cr

Constant Summary

BackgroundColor = LibAllegro.premul_rgba_f(0, 0, 0, 0.13)
Color = LibAllegro.map_rgb_f(0.5, 0.5, 0.1)
HoverColor = LibAllegro.premul_rgba_f(1, 0.5, 0, 0.33)
Key = :struct
Margin = 4 * Screen.scale_factor

HUD

Name = "Struct"
SlotSize = 32 * Screen.scale_factor

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class Works::Cell

clone clone, col : UInt16 col, col=(col : UInt16) col=, cols : UInt8 cols, dimensions : NamedTuple(x: UInt8, y: UInt8) dimensions, draw(x, y) draw, draw_selection(dx, dy, color = nil) draw_selection, height height, hover?(mouse_col, mouse_row) hover?, name name, overlaps?(o_col, o_row)
overlaps?(cell : Cell)
overlaps?
, print_str print_str, row : UInt16 row, row=(row : UInt16) row=, rows : UInt8 rows, size : UInt16 size, width width, x x, y y

Constructor methods inherited from class Works::Cell

new(col : UInt16 = 0_u16, row : UInt16 = 0_u16) new

Class methods inherited from class Works::Cell

dimensions : NamedTuple(x: UInt8, y: UInt8) dimensions, draw_selection(x, y, width, height, selection_color = nil) draw_selection, size : UInt16 size

Constructor Detail

def self.new(col = 0_u16, row = 0_u16) #

[View source]

Class Method Detail

def self.color #

[View source]
def self.hud_background_color #

[View source]
def self.hud_hover_color #

[View source]
def self.hud_margin #

[View source]
def self.hud_slot_size #

[View source]
def self.key #

[View source]
def self.name #

[View source]

Instance Method Detail

def accept_item?(item : Item::Base) #

[View source]
def add_from_inserter(klass, amount, inserter_facing : Symbol) #

[View source]
def add_from_inserter?(item : Item::Base, inserter_facing : Symbol) #

[View source]
def after_rotate(map : Map) #

[View source]
def can_overwrite?(strct : Struct::Base) #

[View source]
def color #

[View source]
def destroy #

[View source]
def draw(dx, dy, color) #

[View source]
def draw(x, y) #

[View source]
def draw_hover_info #

[View source]
def draw_struct_info(inventory_width, inventory_height) #

[View source]
def draw_struct_info_slots(inventory_width, inventory_height) #

[View source]
abstract def grab_item(item_grab_size) #

[View source]
def grab_item #

[View source]
def hide_hud #

[View source]
def hud_background_color #

[View source]
def hud_hover_color #

[View source]
def hud_margin #

[View source]
def hud_shown? : Bool #

[View source]
def hud_slot_size #

[View source]
def hud_x #

[View source]
def hud_y(inventory_height) #

[View source]
abstract def item_class #

[View source]
def key #

[View source]
def overlaps_input?(col, row) #

[View source]
def overlaps_output?(col, row) #

[View source]
def rotate #

[View source]
def show_hud #

[View source]
def slot_click(inventory : Inventory, mouse : Mouse) #

[View source]
def slot_click_grab_item(inventory : Inventory, mouse : Mouse) #

[View source]
def slot_click_held_item(inventory : Inventory, held_item : Item::Held) #

[View source]
def slot_hover?(slot_x, slot_y, mouse : Mouse) #

[View source]
abstract def update(map : Map) #

[View source]
def update_struct_info_slot_hovers(mouse : Mouse, inventory_width, inventory_height) #

[View source]