class Works::Inventory

Defined in:

works/inventory.cr

Constant Summary

MaxSlots = 80
SortOrder = [Item::Ore::Coal, Item::Ore::Copper, Item::Ore::Iron, Item::Ore::Stone, Item::Plate::Copper, Item::Plate::Iron, Item::Plate::Steel, Item::StoneBrick, Item::Struct::TransportBelt::Base, Item::Struct::TransportBelt::Fast, Item::Struct::TransportBelt::Express, Item::Struct::Inserter::Burner, Item::Struct::Inserter::Inserter, Item::Struct::Chest::Wooden, Item::Struct::Chest::Iron, Item::Struct::Chest::Steel, Item::Struct::Furnace::Stone, Item::Struct::Furnace::Electric].map(&.key)

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def add(item_klass, amount : Int) #

[View source]
def add_held_item_to_inventory(item) #

[View source]
def amount_can_add(item_klass, amount : Int) #

[View source]
def draw #

[View source]
def grab_inventory_item(index, mouse : Mouse) #

[View source]
def grab_slot_item(item, mouse : Mouse) #

[View source]
def held_index : Int32 | Nil #

[View source]
def held_item : Item::Held | Nil #

[View source]
def hide(*args, **options) #

[View source]
def hide(*args, **options, &) #

[View source]
def hover?(*args, **options) #

[View source]
def hover?(*args, **options, &) #

[View source]

[View source]
def init #

[View source]
def items : Array(Works::Item::Base) #

[View source]
def max_slots : Int32 #

[View source]
def print_str #

[View source]
def put_held_item_back(held_item, held_index) #

[View source]
def remove_hand_item(held_index) #

[View source]
def remove_held_item #

[View source]
def show(*args, **options) #

[View source]
def show(*args, **options, &) #

[View source]
def show_struct(*args, **options) #

[View source]
def show_struct(*args, **options, &) #

[View source]
def show_toggle(*args, **options) #

[View source]
def show_toggle(*args, **options, &) #

[View source]
def shown?(*args, **options) #

[View source]
def shown?(*args, **options, &) #

[View source]
def sort_items #

[View source]
def swap_held_item(held_item : Item::Held, item : Item::Base) #

[View source]
def update(keys : Keys, mouse : Mouse, map : Map, player : Player) #

[View source]
def update_held_item(keys : Keys, mouse : Mouse, map : Map, player : Player) #

[View source]