Mekanism-tilera-Edition/common/mekanism/api/ChemicalInput.java

52 lines
818 B
Java
Raw Normal View History

2013-12-13 02:35:37 +01:00
package mekanism.api;
import mekanism.api.gas.Gas;
public class ChemicalInput
{
public Gas leftGas;
public Gas rightGas;
public ChemicalInput(Gas left, Gas right)
{
leftGas = left;
rightGas = right;
}
public boolean isValid()
{
return leftGas != null && rightGas != null;
}
@Override
public boolean equals(Object obj)
{
2013-12-13 00:33:56 +01:00
if(!(obj instanceof ChemicalInput))
{
return false;
}
ChemicalInput compare = (ChemicalInput)obj;
if(leftGas == compare.leftGas && rightGas == compare.rightGas)
{
return true;
}
else if(leftGas == compare.rightGas && rightGas == compare.leftGas)
{
return true;
}
return false;
}
@Override
public int hashCode()
{
int code = 1;
code = 31 * code + leftGas.getID();
code = 31 * code + rightGas.getID();
return code;
}
}