コード例 #1
0
        public static BlastUnit getBlastUnit(string _domain, long _address)
        {
            BlastUnit bu = null;

            switch (SelectedEngine)
            {
            case CorruptionEngine.NIGHTMARE:
                bu = RTC_NightmareEngine.GenerateUnit(_domain, _address);
                break;

            case CorruptionEngine.HELLGENIE:
                bu = RTC_HellgenieEngine.GenerateUnit(_domain, _address);
                break;

            case CorruptionEngine.DISTORTION:
                RTC_DistortionEngine.AddUnit(RTC_DistortionEngine.GenerateUnit(_domain, _address));
                bu = RTC_DistortionEngine.GetUnit();
                break;

            case CorruptionEngine.FREEZE:
                bu = RTC_FreezeEngine.GenerateUnit(_domain, _address);
                break;

            case CorruptionEngine.NONE:
                return(null);
            }

            return(bu);
        }
コード例 #2
0
ファイル: RTC_PipeEngine.cs プロジェクト: WolfpawGroup/RTC3
 public static void AddUnit(BlastUnit bu)
 {
     if (!LockPipes)
     {
         if (bu != null)
         {
             AllBlastPipes.Enqueue(bu);
         }
     }
 }
コード例 #3
0
        private void lbBlastLayer_SelectedIndexChanged(object sender, EventArgs e)
        {
            gbAddressEdit.Visible = false;
            gbValueEdit.Visible   = false;

            lbAddressEdit.Text = "Address Edit:";
            lbValueEdit.Text   = "Value Edit:";

            if (lbBlastLayer.SelectedIndex == -1)
            {
                return;
            }

            BlastUnit bu = (BlastUnit)lbBlastLayer.SelectedItem;

            nmValueEdit.Value   = 0;
            nmValueEdit.Maximum = Int64.MaxValue;

            if (lbBlastLayer.SelectedItem is BlastByte)
            {
                gbAddressEdit.Visible = true;
                gbValueEdit.Visible   = true;
                nmAddressEdit.Value   = (lbBlastLayer.SelectedItem as BlastByte).Address;

                var bb = (bu as BlastByte);
                nmValueEdit.Maximum = RTC_Extensions.getNumericMaxValue(bb.Value);
                nmValueEdit.Value   = RTC_Extensions.getDecimalValue(bb.Value);
            }
            else if (lbBlastLayer.SelectedItem is BlastCheat)
            {
                gbAddressEdit.Visible = true;
                nmAddressEdit.Value   = (lbBlastLayer.SelectedItem as BlastCheat).Address;
                var bc = (bu as BlastCheat);
                if (!bc.IsFreeze)
                {
                    gbValueEdit.Visible = true;

                    nmValueEdit.Maximum = RTC_Extensions.getNumericMaxValue(bc.Value);
                    nmValueEdit.Value   = RTC_Extensions.getDecimalValue(bc.Value);
                }
            }
            else if (lbBlastLayer.SelectedItem is BlastPipe)
            {
                lbAddressEdit.Text = "Address Edit:";
                lbValueEdit.Text   = "PipeAddress Edit:";

                gbAddressEdit.Visible = true;
                gbValueEdit.Visible   = true;
                nmAddressEdit.Value   = (bu as BlastPipe).Address;
                nmValueEdit.Value     = (bu as BlastPipe).PipeAddress;
                nmValueEdit.Maximum   = nmAddressEdit.Maximum;
            }
        }
コード例 #4
0
        public VmdPrototype(BlastLayer bl)
        {
            VmdName   = RTC_Core.GetRandomKey();
            GenDomain = "Hybrid";

            BlastUnit bu = bl.Layer[0];
            var       mi = RTC_MemoryDomains.getInterface(bu.Domain);

            BigEndian          = mi.BigEndian;
            WordSize           = mi.WordSize;
            SuppliedBlastLayer = bl;
        }
コード例 #5
0
        private void btnDuplicateSelected_Click(object sender, EventArgs e)
        {
            if (lbBlastLayer.SelectedIndex == -1)
            {
                MessageBox.Show("No unit was selected. Cannot duplicate.");
                return;
            }

            int pos = lbBlastLayer.SelectedIndex;

            BlastUnit bu  = sk.BlastLayer.Layer[pos];
            BlastUnit bu2 = ObjectCopier.Clone(bu);

            sk.BlastLayer.Layer.Insert(pos, bu2);


            RefreshBlastLayer();
        }
コード例 #6
0
        private void btnCorrupt_Click(object sender, EventArgs e)
        {
            BlastLayer bl = new BlastLayer();

            foreach (var item in lbBlastLayer.Items)
            {
                BlastUnit bu = (item as BlastUnit);
                if (bu.IsEnabled)
                {
                    bl.Layer.Add(bu);
                }
            }

            GC.Collect();
            GC.WaitForPendingFinalizers();

            (bl.Clone() as BlastLayer).Apply();
        }
コード例 #7
0
        public static BlastUnit getBlastUnit(string _domain, long _address)
        {
            //Will generate a blast unit depending on which Corruption Engine is currently set.
            //Some engines like Distortion may not return an Unit depending on the current state on things.

            BlastUnit bu = null;

            switch (SelectedEngine)
            {
            case CorruptionEngine.NIGHTMARE:
                bu = RTC_NightmareEngine.GenerateUnit(_domain, _address);
                break;

            case CorruptionEngine.HELLGENIE:
                bu = RTC_HellgenieEngine.GenerateUnit(_domain, _address);
                break;

            case CorruptionEngine.DISTORTION:
                RTC_DistortionEngine.AddUnit(RTC_DistortionEngine.GenerateUnit(_domain, _address));
                bu = RTC_DistortionEngine.GetUnit();
                break;

            case CorruptionEngine.FREEZE:
                bu = RTC_FreezeEngine.GenerateUnit(_domain, _address);
                break;

            case CorruptionEngine.PIPE:
                bu = RTC_PipeEngine.GenerateUnit(_domain, _address);
                break;

            case CorruptionEngine.VECTOR:
                bu = RTC_VectorEngine.GenerateUnit(_domain, _address);
                break;

            case CorruptionEngine.NONE:
                return(null);
            }

            return(bu);
        }
コード例 #8
0
        private void btnLoadCorrupt_Click(object sender, EventArgs e)
        {
            BlastLayer bl = new BlastLayer();

            foreach (var item in lbBlastLayer.Items)
            {
                BlastUnit bu = (item as BlastUnit);
                if (bu.IsEnabled)
                {
                    bl.Layer.Add(bu);
                }
            }

            StashKey newSk = (StashKey)sk.Clone();

            newSk.BlastLayer = (BlastLayer)bl.Clone();

            GC.Collect();
            GC.WaitForPendingFinalizers();

            newSk.Run();
        }
コード例 #9
0
 public static void AddUnit(BlastUnit bu)
 {
     AllDistortionBytes.Enqueue(bu);
 }