@Override
public void actionActivate(IStatementContainer container, IStatementParameter[] parameters) {
IPipe pipe = ((Gate) container).getPipe();
if (pipe != null && pipe instanceof Pipe) {
PipeTransport transport = ((Pipe) pipe).transport;
if (parameters[0] != null && parameters[0] instanceof StatementParameterDirection) {
ForgeDirection side = ((StatementParameterDirection) parameters[0]).direction;
if (side != ForgeDirection.UNKNOWN) {
transport.allowInput(side, state.inputOpen);
transport.allowOutput(side, state.outputOpen);
}
} else {
for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) {
transport.allowInput(side, state.inputOpen);
transport.allowOutput(side, state.outputOpen);
}
}
}
}