Migrated PartFlatWire into node system

This commit is contained in:
Calclavia 2014-09-14 15:48:55 +08:00
parent 1678afe96e
commit 44208669ef
3 changed files with 504 additions and 523 deletions

View file

@ -6,7 +6,7 @@ import net.minecraftforge.common.util.ForgeDirection
import universalelectricity.api.core.grid.{INode, INodeProvider, ISave}
/**
* A node trait that can be mixed into any multipart nodes.
* A node trait that can be mixed into any multipart nodes. Mixing this trait will cause nodes to reconstruct/deconstruct when needed.
* @author Calclavia
*/
trait TNodePartConnector extends TMultiPart with INodeProvider

View file

@ -11,7 +11,7 @@ import universalelectricity.api.core.grid.{INode, INodeProvider}
import universalelectricity.simulator.dc.DCNode
/**
* Class extended by wires
* Abstract class extended by both flat and framed wires to handle material, insulation, color and multipart node logic.
* @author Calclavia
*/
abstract class TWire extends TMultiPart with TNodePartConnector with TPart with TMaterial[WireMaterial] with TInsulatable with TColorable
@ -74,7 +74,7 @@ abstract class TWire extends TMultiPart with TNodePartConnector with TPart with
/**
* Can this conductor connect with another potential wire object?
*/
protected def canConnectTo(obj: AnyRef): Boolean =
def canConnectTo(obj: AnyRef): Boolean =
{
if (obj != null && obj.getClass == getClass)
{
@ -95,7 +95,7 @@ abstract class TWire extends TMultiPart with TNodePartConnector with TPart with
/**
* Can this conductor connect with another potential wire object AND a DCNode?
*/
protected def canConnectTo(obj: AnyRef, from: ForgeDirection): Boolean =
def canConnectTo(obj: AnyRef, from: ForgeDirection): Boolean =
{
if (canConnectTo(obj))
return true