Exemple #1
0
    public override void ShowDetails()
    {
        if (isServer)
        {
            Logger.Log("connections " + (Data.connections.Count.ToString()), Category.Electrical);
            Logger.Log("ID " + (this.GetInstanceID()), Category.Electrical);
            Logger.Log("Type " + (InData.Categorytype.ToString()), Category.Electrical);
            Logger.Log("Can connect to " + (string.Join(",", InData.CanConnectTo)), Category.Electrical);
            Logger.Log("UpstreamCount " + (Data.UpstreamCount.ToString()), Category.Electrical);
            Logger.Log("DownstreamCount " + (Data.DownstreamCount.ToString()), Category.Electrical);
            if (RelatedLine != null)
            {
                //RelatedLine.UpdateCoveringCable();
                Data.ActualVoltage       = RelatedLine.TheEnd.Data.ActualVoltage;
                Data.CurrentInWire       = RelatedLine.TheEnd.Data.CurrentInWire;
                Data.EstimatedResistance = RelatedLine.TheEnd.Data.EstimatedResistance;
            }

            Logger.Log("ActualVoltage " + (Data.ActualVoltage.ToString()), Category.Electrical);
            Logger.Log("CurrentInWire " + (Data.CurrentInWire.ToString()), Category.Electrical);
            Logger.Log("EstimatedResistance " + (Data.EstimatedResistance.ToString()), Category.Electrical);
        }

        RequestElectricalStats.Send(PlayerManager.LocalPlayer, gameObject);
    }
Exemple #2
0
    protected override void ShowDetails()
    {
        if (isServer)
        {
            ElectricityFunctions.WorkOutActualNumbers(this);
            Logger.Log("connections " + (string.Join(",", Data.connections)), Category.Electrical);
            Logger.Log("ID " + (this.GetInstanceID()), Category.Electrical);
            Logger.Log("Type " + (InData.Categorytype.ToString()), Category.Electrical);
            Logger.Log("Can connect to " + (string.Join(",", InData.CanConnectTo)), Category.Electrical);
            foreach (var Supply in Data.SupplyDependent)
            {
                LogSupply(Supply);
            }

            if (RelatedLine != null)
            {
                Logger.Log("line heree!!!");
                ElectricityFunctions.WorkOutActualNumbers(RelatedLine.TheEnd);
                Data.ActualVoltage       = RelatedLine.TheEnd.Data.ActualVoltage;
                Data.CurrentInWire       = RelatedLine.TheEnd.Data.CurrentInWire;
                Data.EstimatedResistance = RelatedLine.TheEnd.Data.EstimatedResistance;

                foreach (var Supply in RelatedLine.TheEnd.Data.SupplyDependent)
                {
                    LogSupply(Supply);
                }
            }
            Logger.Log(" ActualVoltage > " + Data.ActualVoltage + " CurrentInWire > " + Data.CurrentInWire + " EstimatedResistance >  " + Data.EstimatedResistance, Category.Electrical);
        }
        RequestElectricalStats.Send(PlayerManager.LocalPlayer, gameObject);
    }
Exemple #3
0
    protected virtual void ShowDetails()
    {
        if (isServer)
        {
            ElectricityFunctions.WorkOutActualNumbers(this);
            Logger.Log("connections " + (string.Join(",", Data.connections)), Category.Electrical);
            Logger.Log("ID " + (this.GetInstanceID()), Category.Electrical);
            Logger.Log("Type " + (InData.Categorytype.ToString()), Category.Electrical);
            Logger.Log("Can connect to " + (string.Join(",", InData.CanConnectTo)), Category.Electrical);
            foreach (var Supply in Data.SupplyDependent)
            {
                string ToLog;
                ToLog  = "Supply > " + Supply.Key + "\n";
                ToLog += "Upstream > ";
                ToLog += string.Join(",", Supply.Value.Upstream) + "\n";
                ToLog += "Downstream > ";
                ToLog += string.Join(",", Supply.Value.Downstream) + "\n";
                ToLog += "ResistanceGoingTo > ";
                ToLog += string.Join(",", Supply.Value.ResistanceGoingTo) + "\n";
                ToLog += "ResistanceComingFrom > ";
                ToLog += string.Join(",", Supply.Value.ResistanceComingFrom) + "\n";
                ToLog += "CurrentComingFrom > ";
                ToLog += string.Join(",", Supply.Value.CurrentComingFrom) + "\n";
                ToLog += "CurrentGoingTo > ";
                ToLog += string.Join(",", Supply.Value.CurrentGoingTo) + "\n";
                ToLog += Supply.Value.SourceVoltages.ToString();
                Logger.Log(ToLog, Category.Electrical);
            }
            Logger.Log(" ActualVoltage > " + Data.ActualVoltage + " CurrentInWire > " + Data.CurrentInWire + " EstimatedResistance >  " + Data.EstimatedResistance, Category.Electrical);
        }

        RequestElectricalStats.Send(PlayerManager.LocalPlayer, gameObject);
    }
    public virtual void ShowDetails()
    {
        if (isServer)
        {
            InData.ShowDetails();
        }

        RequestElectricalStats.Send(PlayerManager.LocalPlayer, gameObject);
    }
Exemple #5
0
    public static RequestElectricalStats Send(GameObject player, GameObject electricalItem)
    {
        RequestElectricalStats msg = new RequestElectricalStats
        {
            Player         = player.GetComponent <NetworkIdentity>().netId,
            ElectricalItem = electricalItem.GetComponent <NetworkIdentity>().netId,
        };

        msg.Send();
        return(msg);
    }
Exemple #6
0
 public void ShowDetails()
 {
     if (isServer)
     {
         Logger.Log("connections " + (Data.connections.Count.ToString()), Category.Electrical);
         Logger.Log("ID " + (this.GetInstanceID()), Category.Electrical);
         Logger.Log("Can connect to " + (string.Join(",", InData.CanConnectTo)), Category.Electrical);
         Logger.Log("UpstreamCount " + (Data.UpstreamCount.ToString()), Category.Electrical);
         Logger.Log("DownstreamCount " + (Data.DownstreamCount.ToString()), Category.Electrical);
         Logger.Log("Type " + (InData.Categorytype.ToString()), Category.Electrical);
     }
     RequestElectricalStats.Send(PlayerManager.LocalPlayer, gameObject);
 }