Advertisement
jadenquinn

IEnergyTransfer.java

Sep 28th, 2018
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.36 KB | None | 0 0
  1. /*------------------------------------------------------------------------------
  2.  Copyright (c) CovertJaguar, 2011-2016
  3.  
  4.  This work (the API) is licensed under the "MIT" License,
  5.  see LICENSE.md for details.
  6.  -----------------------------------------------------------------------------*/
  7.  
  8. package mods.railcraft.api.carts;
  9.  
  10. /**
  11.  * This interface is implemented by the Energy Cart
  12.  * and is used by the Energy Loaders to charge/discharge carts.
  13.  * It is roughly equivalent to the IItemTransfer interface
  14.  * and based on ElectricItem and IElectricItem.
  15.  *
  16.  * This interface has been superseded by the CapabilityCartCharge
  17.  * interface for general use. It remains in use solely for the
  18.  * IC2 based Energy Loaders.
  19.  *
  20.  * @author CovertJaguar <http://www.railcraft.info>
  21.  */
  22. public interface IEnergyTransfer {
  23.  
  24.     /**
  25.      * Injects the specified amount of EU into the device.
  26.      *
  27.      * The function returns the remainder of the EU after
  28.      * any EU used is subtracted.
  29.      *
  30.      * @param source              Object initiating the transfer, should be an Entity or Tile Entity
  31.      * @param amount              amount of energy to transfer in EU
  32.      * @param tier                tier of the source device, has to be at least as high as the target device
  33.      * @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit()
  34.      * @param simulate            don't actually change the item, just determine the return value
  35.      * @return The amount of EU not used
  36.      */
  37.     double injectEnergy(Object source, double amount, int tier, boolean ignoreTransferLimit, boolean simulate, boolean passAlong);
  38.  
  39.     /**
  40.      * Requests a certain amount of EU from the device.
  41.      *
  42.      * The is function will subtract EU from the device's store of power
  43.      * and return a portion up to, but not exceeding, the amount of EU requested.
  44.      *
  45.      * @param source              Object initiating the transfer, should be an Entity or Tile Entity
  46.      * @param amount              amount of energy to transfer in EU
  47.      * @param tier                tier of the source device, has to be at least as high as the target device
  48.      * @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit()
  49.      * @param simulate            don't actually change the item, just determine the return value
  50.      * @param passAlong           whether neighboring carts should be asked to provide any missing power.
  51.      * @return The amount of EU transferred
  52.      */
  53.     double extractEnergy(Object source, double amount, int tier, boolean ignoreTransferLimit, boolean simulate, boolean passAlong);
  54.  
  55.     /**
  56.      * Return true if energy can be injected into this device.
  57.      *
  58.      * @return true if can inject energy
  59.      */
  60.     boolean canInjectEnergy();
  61.  
  62.     /**
  63.      * Return true if energy can be extracted from this device.
  64.      *
  65.      * @return true if can extract energy
  66.      */
  67.     boolean canExtractEnergy();
  68.  
  69.     /**
  70.      * The max capacity of the device.
  71.      *
  72.      * @return max capacity
  73.      */
  74.     int getCapacity();
  75.  
  76.     /**
  77.      * Returns the current energy contained in the device.
  78.      *
  79.      * @return current energy
  80.      */
  81.     double getEnergy();
  82.  
  83.     int getTier();
  84.  
  85.     /**
  86.      * The device's transfer rate in EU/t.
  87.      *
  88.      * @return the transfer rate
  89.      */
  90.     int getTransferLimit();
  91.  
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement