示例#1
0
        public void ConnectedAdd(PipeData NewConnection)
        {
            ConnectedPipes.Add(NewConnection);
            if (NetCompatible == false)
            {
                //This is a special pipe
                if (NewConnection.NetCompatible == false)
                {
                    //NewConnection is a special pipe
                    if (PipeFunctions.IsPipeOutputTo(this, NewConnection) && PipeFunctions.CanEqualiseWith(this, NewConnection))
                    {
                        Outputs.Add(NewConnection);
                    }
                }
                else
                {
                    //NewConnection is a Pipe net
                    if (PipeFunctions.IsPipeOutputTo(this, NewConnection))
                    {
                        //An input to the pipe net it does not need to be recorded
                        Outputs.Add(NewConnection);
                    }

                    if (this.Connections.Directions[(int)PipeFunctions.PipesToDirections(this, NewConnection)].PortType
                        .HasFlag(OutputType.Can_Equalise_With))
                    {
                        NewConnection.OnNet.AddEqualiseWith(this);
                    }
                }
            }
        }
示例#2
0
        public bool CanEqualiseWithThis(PipeData Pipe)
        {
            if (Pipe.NetCompatible == false)
            {
                return(PipeFunctions.CanEqualiseWith(this.pipeData, Pipe));
            }

            return(true);
        }
示例#3
0
        public virtual void OnEnable()
        {
            if (PipeAction != null)
            {
                PipeAction.pipeData = this;
            }

            AtmosManager.Instance.inGameNewPipes.Add(this);
            ConnectedPipes =
                PipeFunctions.GetConnectedPipes(ConnectedPipes, this, MatrixPos, matrix);

            foreach (var Pipe in ConnectedPipes)
            {
                Pipe.NetHookUp(this);
            }

            if (OnNet == null && NetCompatible)
            {
                OnNet = LiquidPipeNet.MakeNewNet(this);
            }

            foreach (var Pipe in ConnectedPipes)
            {
                Pipe.ConnectedAdd(this);
                if (NetCompatible == false)
                {
                    //This is a special pipe
                    //so Determine If neighbours special or net
                    if (Pipe.NetCompatible == false)
                    {
                        //What is connecting to is a special pipe
                        if (PipeFunctions.IsPipeOutputTo(this, Pipe) &&
                            PipeFunctions.CanEqualiseWith(this, Pipe))
                        {
                            Outputs.Add(Pipe);
                        }

                        //Shouldn't need to register outputs on Pipe Since it could handle itself
                    }
                    else
                    {
                        //What is connecting to is a Net
                        if (PipeFunctions.IsPipeOutputTo(this, Pipe))
                        {
                            Outputs.Add(Pipe);
                        }

                        //Can it accept input?
                        if (this.Connections.Directions[(int)PipeFunctions.PipesToDirections(this, Pipe)].PortType
                            .HasFlag(OutputType.Can_Equalise_With))
                        {
                            Pipe.OnNet.AddEqualiseWith(this);
                        }
                    }
                }
            }
        }
示例#4
0
        public void ConnectedAdd(PipeData NewConnection)
        {
            if (MonoPipe != null)
            {
                if (MonoPipe.name == "Filter (1)")
                {
                    Logger.Log("yay");
                }
            }

            ConnectedPipes.Add(NewConnection);
            var pipe1Connection =
                this.Connections.Directions[(int)PipeFunctions.PipesToDirections(this, NewConnection)];

            pipe1Connection.Connected = NewConnection;


            if (NetCompatible == false)
            {
                //This is a special pipe
                if (NewConnection.NetCompatible == false)
                {
                    //NewConnection is a special pipe
                    if (PipeFunctions.IsPipeOutputTo(this, NewConnection) &&
                        PipeFunctions.CanEqualiseWith(this, NewConnection))
                    {
                        pipe1Connection.Connected = NewConnection;
                        Outputs.Add(NewConnection);
                    }
                }
                else
                {
                    //NewConnection is a Pipe net
                    if (PipeFunctions.IsPipeOutputTo(this, NewConnection))
                    {
                        //An input to the pipe net it does not need to be recorded
                        Outputs.Add(NewConnection);
                    }

                    if (this.Connections.Directions[(int)PipeFunctions.PipesToDirections(this, NewConnection)].PortType
                        .HasFlag(OutputType.Can_Equalise_With))
                    {
                        NewConnection.OnNet.AddEqualiseWith(this);
                    }
                }
            }
        }