Kryzeth Standard Library

StdLib.Data.ItemSubgroup

supers: StdLib.Data

Wrapper for Factorio item-subgroup prototypes.

Methods8

function ItemSubgroup.__call(item_subgroup: string) -> item_subgroup StdLib.Data.ItemSubgroup

Looks up and wraps an item subgroup by name.

Parameters
item_subgroupstring

Item-subgroup prototype name

Returns
function ItemSubgroup.count_visible_entries() -> count nil | integer

Counts the number of visible entries in this subgroup. Hidden prototypes and Factoriopedia-hidden prototypes are ignored. Prototypes with duplicate internal names are only counted once.

function ItemSubgroup.get_visible_entry_count() -> count nil | integer
function ItemSubgroup.count_rows() -> rows nil | integer

Counts the number of visible rows used by this subgroup. Returns zero if the subgroup contains no visible entries. Returns one for 1-10 visible entries, two for 11-20 visible entries, etc.

function ItemSubgroup.get_row_count() -> rows nil | integer
function ItemSubgroup.count_subgroup_rows() -> rows nil | integer
function ItemSubgroup.count_placeable_entries(entity_types: string[]) -> count nil | integer

Counts visible items in this subgroup that place one of the given entity types.

Parameters
entity_typesstring[]

Entity prototype types

Returns
countnil | integer
function ItemSubgroup.count_placeable_rows(entity_types: string[]) -> rows nil | integer

Counts rows used by visible items that place one of the given entity types.

Parameters
entity_typesstring[]

Entity prototype types

Returns
rowsnil | integer

Fields3

ItemSubgroup.group : string

Parent item-group prototype name

ItemSubgroup.__class: string = "ItemSubgroup"
ItemSubgroup.__index : unknown