//Same reaction mechanic, but no volume calculations public void MakepHIndicators(SelectionObjectData object1, SelectionObjectData object2) { //Two objects react to get a resultant object System.Enum result = Reactions.React(object1.item, object2.item); //pH papers doesn't have volume. So, volume calculations is not needed //pH calculations is also needed. //TODO: Check if the item is present in the inventory //If present, compare it with it's slot's item description //If not, add it to a new slot along with the item description information to the slot. }
public void AddLiquidToPlayer(SelectionObjectData item) { //Add the selected object to the player //Add the item only if it is acid or base. if (item.item.GetType() == typeof(AcidsList) || item.item.GetType() == typeof(BasesList)) { //If player already has a liquid in him, react System.Enum result = player.React(item); //If the result is not null, place it in the inventory if (result != null) { // if(player.GetComponent<PlayerMechanics>().volume == result) } //If the player doesn't have liquid in him, then change the liquid type, volume and pH of player appropriately } }
public void Extract(SelectionObjectData item) { ItemBase i = Extraction.Extract(item.item).GetComponent <ItemBase>(); ItemsDescription des = i.itemProperties.itemDescription; des.GetItemType(); //The extraction will take default information from the prefab object. //must check if the item type is already present. int phVal = des.pHValue; AddItem(i); //invenetory will take care of everything checking for ph if present. //IF the item type is already present, it's pH value in the description data must be checked. //If the pH is same, the extra volume must be added to the existing item slot }
//Combine acids and bases....Volume calculation is present public void Combine(SelectionObjectData object1, SelectionObjectData object2) { //Two objects react to get a resultant object System.Enum result = Reactions.React(object1.item, object2.item); //Get the item description from the item manager ItemBase item = ItemManager.instance.itemDictionary[result].GetComponent <ItemBase>(); ItemsDescription description = item.itemProperties.itemDescription; //Perform the volume and pH calculations here. int pH = 9; //TODO: this must be calculated using the formula if (pH != description.pHValue) { //TODO: Assign a new slot in the inventory and add it //TODO: Add new item Description data along with it while adding } //TODO: Check if the item is present in the inventory //If present, compare it with it's slot's item description //If not, add it to a new slot along with the item description information to the slot. }