Mekanism-tilera-Edition/src/main/java/mekanism/common/InfuseStorage.java
Aidan C. Brady 955160ff45 Lithium!
2015-02-25 08:44:24 -05:00

35 lines
570 B
Java

package mekanism.common;
import mekanism.api.infuse.InfuseType;
public class InfuseStorage
{
public InfuseType type;
public int amount;
public InfuseStorage() {}
public InfuseStorage(InfuseType infuseType, int infuseAmount)
{
type = infuseType;
amount = infuseAmount;
}
public boolean contains(InfuseStorage storage)
{
return type == storage.type && amount >= storage.amount;
}
public void subtract(InfuseStorage storage)
{
if(contains(storage))
{
amount -= storage.amount;
}
else if(type == storage.type)
{
amount = 0;
}
}
}