Example #1
0
            public void BuildChainDistribution()
            {
                List <JoltageAdapter> chain = new List <JoltageAdapter>();

                JoltageAdapter current = Adapters.FirstOrDefault();

                current.Connected = true;

                while (Adapters.Any(adapter => !adapter.Connected))
                {
                    List <int>     adaptersThatCanConnect = current.AdaptersThanCanConnect();
                    JoltageAdapter adapterFound           = Adapters.FirstOrDefault(adapter => adaptersThatCanConnect.Contains(adapter.RatedOutputJoltage));
                    adapterFound.Connected = true;

                    AddDifference(adapterFound.RatedOutputJoltage - current.RatedOutputJoltage);
                    current = adapterFound;
                }
            }
 public override bool CanAcceptInputFrom(JoltageAdapter adapter) => false;
 public virtual bool CanAcceptInputFrom(JoltageAdapter adapter) => adapter != this && Output - adapter.Output <= InputCompensation;