extends RefCounted

class_name RuntimeSubstanceData

var substance: Substance
var amount: float
var temperature: float = 20.0
var is_solution: bool = false

func add(data: RuntimeSubstanceData) -> void:
	temperature = (temperature + data.temperature)/2.0
	amount += data.amount

func duplicate() -> RuntimeSubstanceData:
	var new_substance = RuntimeSubstanceData.new()
	new_substance.substance = substance
	new_substance.amount = amount
	new_substance.temperature = temperature
	
	return new_substance
