Reworked Force api

This commit is contained in:
DarkGuardsman 2013-09-04 18:56:22 -04:00
parent 5ff388a888
commit b3cfee0d0c
5 changed files with 34 additions and 62 deletions

View file

@ -1,28 +0,0 @@
package dark.api.mech;
import net.minecraftforge.common.ForgeDirection;
// mechanical
public interface IForce
{
/** @param side the rpm is coming from
* @return rpm that the block is running at */
public int getForceSide(ForgeDirection side);
/** @param side
* @return if mechanical force can be outputed from this side */
public boolean canOutputSide(ForgeDirection side);
/** @param side
* @return if mechanical force can be inputed from this side */
public boolean canInputSide(ForgeDirection side);
/** @param RPM being applied to this machine
* @return the rpm after the load has been applied */
public int applyForce(int force);
/** not required but is handy to get animation position of some mechanical block
*
* @return int between 0 -7 */
public int getAnimationPos();
}

View file

@ -0,0 +1,34 @@
package dark.api.mech;
import dark.api.parts.ITileConnector;
import net.minecraftforge.common.ForgeDirection;
/** Think of this in the same way as an electrical device from UE. getforce methods are designed to
* get the idea amount of foce that a side should be outputing at the time. Apply force is the input
* for force for the tile, and should return the actually force the machine is using. Supply is when
* the code asks for your tile to output force on the side, just return the force value don't try to
* apply the force to other machines.
*
* Tip Supply should never equal load as everything will stop moving since the load equals the
* amount of force. The supply of force should be greater
*
* @author DarkGuardsman */
public interface IForceDevice extends ITileConnector
{
/** Applies force to this tile
*
* @param side - side its coming from
* @param force - amount of force
* @return amount of force actually loaded down */
public float applyForce(ForgeDirection side, float force);
/** @param side - side that force should be supplied in
* @return force to apply in direction */
public float supplyForce(ForgeDirection side);
/** Idea force to output on the side */
public float getForceOut(ForgeDirection side);
/** Idea force to load down on the side */
public float getForceLoad(ForgeDirection side);
}

View file

@ -1,12 +0,0 @@
package dark.api.mech;
import net.minecraftforge.common.ForgeDirection;
public interface IForceLoad
{
/** @param side
* @return if mechanical force can be inputed from this side */
public boolean canInputSide(ForgeDirection side);
public int applyForce(ForgeDirection side, int force);
}

View file

@ -1,14 +0,0 @@
package dark.api.mech;
import net.minecraftforge.common.ForgeDirection;
public interface IForceProvider
{
/** @param side the rpm is coming from
* @return rpm that the block is running at */
public int getForceSide(ForgeDirection side);
/** @param side
* @return if mechanical force can be outputed from this side */
public boolean canOutputSide(ForgeDirection side);
}

View file

@ -1,8 +0,0 @@
package dark.api.mech;
import net.minecraftforge.common.ForgeDirection;
public interface IMechanicalConnector
{
public boolean canRodeConnect(ForgeDirection side);
}