Beispiel #1
0
 public sealed override void PostReaction()
 {
     foreach (var network in NetworkCollection.GetWireNetworksConnectedTo(this))
     {
         ExportFlux(network);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Attempts to send the <paramref name="flux"/> to a connected <seealso cref="WireNetwork"/>. The flux is split among all connected networks.
        /// </summary>
        /// <param name="flux"></param>
        public void ExportFlux(WireNetwork network)
        {
            TerraFlux flux = new TerraFlux(Math.Min((float)StoredFlux, (float)ExportRate));

            //Ran out of TF
            if ((float)flux <= 0)
            {
                return;
            }

            TerraFlux send = flux / NetworkCollection.GetWireNetworksConnectedTo(this).Count;

            network.ImportFlux(this, ref send);

            if ((float)send > 0)
            {
                ImportFlux(ref send);
            }
        }