electrodynamics/src/main/scala/resonantinduction/mechanical/mech/turbine/TurbineNode.scala

36 lines
1,016 B
Scala
Raw Normal View History

package resonantinduction.mechanical.mech.turbine
import net.minecraftforge.common.util.ForgeDirection
2014-11-13 03:22:46 +01:00
import resonantinduction.mechanical.mech.grid.NodeMechanical
/**
* Turbine's Mechanical node
* Turbines always face forward and connect from behind.
*
* @author Calclavia, Darkguardsman
*/
2014-11-14 17:22:38 +01:00
class TurbineNode(parent: TileTurbine) extends NodeMechanical(parent)
{
2014-11-14 17:22:38 +01:00
/**
* Moment of inertia = m * r * r
* Where "m" is the mass and "r" is the radius of the object.
*/
override def momentOfInertia = parent.multiBlockRadius * parent.multiBlockRadius
2014-10-26 15:41:40 +01:00
def turbine: TileTurbine =
{
return getParent.asInstanceOf[TileTurbine]
}
2014-11-04 15:06:08 +01:00
override def canConnect[B](other: B, from: ForgeDirection): Boolean =
2014-10-26 15:41:40 +01:00
{
2014-11-13 03:22:46 +01:00
return turbine.getMultiBlock.isPrimary && other.isInstanceOf[NodeMechanical] && !(other.isInstanceOf[TurbineNode]) && from == turbine.getDirection
2014-10-26 15:41:40 +01:00
}
2014-11-10 12:28:36 +01:00
/**
2014-10-26 15:41:40 +01:00
override def inverseRotation(dir: ForgeDirection): Boolean =
{
return dir == turbine.getDirection.getOpposite
2014-11-14 17:22:38 +01:00
} */
}