// Path: src/main/java/org/cyclops/integratedtunnels/core/part/PartStateRoundRobin.java
// public class PartStateRoundRobin<P extends IPartTypeWriter> extends PartStateWriterBase<P> {
// 
//     private IPartPosIteratorHandler partPosIteratorHandler = null;
// 
//     public PartStateRoundRobin(int inventorySize) {
//         super(inventorySize);
//     }
// 
//     public void setPartPosIteratorHandler(IPartPosIteratorHandler partPosIteratorHandler) {
//         this.partPosIteratorHandler = partPosIteratorHandler;
//     }
// 
//     public IPartPosIteratorHandler getPartPosIteratorHandler() {
//         return partPosIteratorHandler;
//     }
// }


import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity;
import org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage;
import org.cyclops.integrateddynamics.api.network.IEnergyNetwork;
import org.cyclops.integrateddynamics.api.network.INetwork;
import org.cyclops.integrateddynamics.api.part.PartPos;
import org.cyclops.integrateddynamics.api.part.PartTarget;
import org.cyclops.integrateddynamics.api.part.aspect.property.IAspectProperties;
import org.cyclops.integratedtunnels.core.part.PartStateRoundRobin;
import javax.annotation.Nullable;
package org.cyclops.integratedtunnels.part.aspect;



/**
 * @author rubensworks
 */
public interface IEnergyTarget extends IChanneledTarget<IEnergyNetwork, Long> {

    public IIngredientComponentStorage<Long, Boolean> getEnergyChannel();

    public IIngredientComponentStorage<Long, Boolean> getStorage();

    public int getAmount();

    public boolean isExactAmount();

    public static IEnergyTarget ofTile(PartTarget partTarget, IAspectProperties properties, int amount) {
        PartPos center = partTarget.getCenter();
        PartPos target = partTarget.getTarget();
        INetwork network = IChanneledTarget.getNetworkChecked(center);
        TileEntity tile = target.getPos().getWorld(true).getTileEntity(target.getPos().getBlockPos());
// Path: src/main/java/org/cyclops/integratedtunnels/core/part/PartStateRoundRobin.java
// public class PartStateRoundRobin<P extends IPartTypeWriter> extends PartStateWriterBase<P> {
// 
//     private IPartPosIteratorHandler partPosIteratorHandler = null;
// 
//     public PartStateRoundRobin(int inventorySize) {
//         super(inventorySize);
//     }
// 
//     public void setPartPosIteratorHandler(IPartPosIteratorHandler partPosIteratorHandler) {
//         this.partPosIteratorHandler = partPosIteratorHandler;
//     }
// 
//     public IPartPosIteratorHandler getPartPosIteratorHandler() {
//         return partPosIteratorHandler;
//     }
// }


// Path: src/main/java/org/cyclops/integratedtunnels/part/aspect/IEnergyTarget.java
import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity;
import org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage;
import org.cyclops.integrateddynamics.api.network.IEnergyNetwork;
import org.cyclops.integrateddynamics.api.network.INetwork;
import org.cyclops.integrateddynamics.api.part.PartPos;
import org.cyclops.integrateddynamics.api.part.PartTarget;
import org.cyclops.integrateddynamics.api.part.aspect.property.IAspectProperties;
import org.cyclops.integratedtunnels.core.part.PartStateRoundRobin;
import javax.annotation.Nullable;

package org.cyclops.integratedtunnels.part.aspect;



/**
 * @author rubensworks
 */
public interface IEnergyTarget extends IChanneledTarget<IEnergyNetwork, Long> {

    public IIngredientComponentStorage<Long, Boolean> getEnergyChannel();

    public IIngredientComponentStorage<Long, Boolean> getStorage();

    public int getAmount();

    public boolean isExactAmount();

    public static IEnergyTarget ofTile(PartTarget partTarget, IAspectProperties properties, int amount) {
        PartPos center = partTarget.getCenter();
        PartPos target = partTarget.getTarget();
        INetwork network = IChanneledTarget.getNetworkChecked(center);
        TileEntity tile = target.getPos().getWorld(true).getTileEntity(target.getPos().getBlockPos());
        PartStateRoundRobin<?> partState = IChanneledTarget.getPartState(center);