Skip to content

Consumables Groups

Vadim Gromov edited this page Jan 5, 2021 · 8 revisions

Consumables groups are used to aggregate certain types of consumable inventory items, for example some kind of food can have the same effect as the antibiotic pill when consumed, so this food item type and antibiotic pills can be grouped to form the Antibiotic consumables group.

These groups are used in a disease treatment, so, for example, any food from the Antibiotics group consumed will be treated by the disease treatment node just like the antibiotic pill.

Consumables groups are described in a MedicalConsumablesGroup class.
MedicalConsumablesGroup constructor receives a list of inventory items names that should be grouped in this manner. One item can be a part of any number of groups, and disease treatment will handle this case correctly, but GetRelevantMedicalGroup method will return in this case only the first group it finds.

This class has a number of methods to help with finding groups and performing checks:

  • GetRelevantMedicalGroup
  • IsApplicableToGroup

Static GetRelevantMedicalGroup method will check if the given consumable inventory item belongs to any group, and return this group. It will return null otherwise.
IsApplicableToGroup will check if a given inventory item belongs to this consumable group and return boolean.

You can also merge two group together using the + operator, like
var newGroup = MedicalConsumablesGroup.SedativeGroup + MedicalConsumablesGroup.AspirinGroup;

By default, Zara has these consumables groups:

EpinephrineGroup
AntiVenomGroup
AtropineGroup
MorphineGroup
DoripenemGroup
AntibioticGroup
AspirinGroup
AcetaminophenGroup
LoperamideGroup
OseltamivirGroup
SedativeGroup
Clone this wiki locally