Search in sources :

Example 1 with LogisticsOrder

use of logisticspipes.routing.order.LogisticsOrder in project LogisticsPipes by RS485.

the class PipeManagerContentPacket method writeData.

@Override
public void writeData(LPDataOutput output) {
    super.writeData(output);
    // manual collection write, because generics are wrong here
    output.writeInt(manager.size());
    for (LogisticsOrder order : manager) {
        output.writeSerializable(order);
    }
}
Also used : LogisticsOrder(logisticspipes.routing.order.LogisticsOrder)

Example 2 with LogisticsOrder

use of logisticspipes.routing.order.LogisticsOrder in project LogisticsPipes by RS485.

the class PipeLogisticsChassi method fullFill.

@Override
public LogisticsOrder fullFill(LogisticsPromise promise, IRequestItems destination, IAdditionalTargetInformation info) {
    if (!isEnabled()) {
        return null;
    }
    for (int i = 0; i < getChassiSize(); i++) {
        LogisticsModule x = _module.getSubModule(i);
        if (x instanceof ILegacyActiveModule) {
            ILegacyActiveModule y = (ILegacyActiveModule) x;
            LogisticsOrder result = y.fullFill(promise, destination, info);
            if (result != null) {
                spawnParticle(Particles.WhiteParticle, 2);
                return result;
            }
        }
    }
    return null;
}
Also used : ILegacyActiveModule(logisticspipes.interfaces.ILegacyActiveModule) LogisticsOrder(logisticspipes.routing.order.LogisticsOrder) LogisticsModule(logisticspipes.modules.abstractmodules.LogisticsModule)

Aggregations

LogisticsOrder (logisticspipes.routing.order.LogisticsOrder)2 ILegacyActiveModule (logisticspipes.interfaces.ILegacyActiveModule)1 LogisticsModule (logisticspipes.modules.abstractmodules.LogisticsModule)1