2014-09-05 05:20:12 +02:00
|
|
|
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;
|
2015-02-25 14:44:24 +01:00
|
|
|
}
|
|
|
|
else if(type == storage.type)
|
2014-09-05 05:20:12 +02:00
|
|
|
{
|
|
|
|
amount = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|