public static void DrawingOnCore() { if (Menu.Item("Range Blink").GetValue <bool>() && blink != null) { blinkRange = 1200; if (BlinkRange == null) { if (me.IsAlive) { BlinkRange = me.AddParticleEffect("materials/ensage_ui/particles/range_display_mod.vpcf"); BlinkRange.SetControlPoint(3, new Vector3(5, 0, 0)); BlinkRange.SetControlPoint(2, new Vector3(255, 0, 222)); BlinkRange.SetControlPoint(1, new Vector3(blinkRange, 0, 222)); } } else { if (!me.IsAlive) { BlinkRange.Dispose(); BlinkRange = null; } else if (lastblinkRange != blinkRange) { BlinkRange.Dispose(); lastblinkRange = blinkRange; BlinkRange = me.AddParticleEffect("materials/ensage_ui/particles/range_display_mod.vpcf"); BlinkRange.SetControlPoint(3, new Vector3(5, 0, 0)); BlinkRange.SetControlPoint(2, new Vector3(255, 0, 222)); BlinkRange.SetControlPoint(1, new Vector3(blinkRange, 0, 222)); } } } else { if (BlinkRange != null) { BlinkRange.Dispose(); } BlinkRange = null; } if (Menu.Item("Range Static Remnant").GetValue <bool>() && Q != null && Q.Level > 0) { qRange = Q.GetAbilityData("static_remnant_radius"); if (QRange == null) { if (me.IsAlive) { QRange = me.AddParticleEffect("materials/ensage_ui/particles/range_display_mod.vpcf"); QRange.SetControlPoint(3, new Vector3(5, 0, 0)); QRange.SetControlPoint(2, new Vector3(152, 92, 255)); QRange.SetControlPoint(1, new Vector3(qRange, 0, 222)); } } else { if (!me.IsAlive) { QRange.Dispose(); QRange = null; } else if (lastqRange != qRange) { QRange.Dispose(); lastqRange = qRange; QRange = me.AddParticleEffect("materials/ensage_ui/particles/range_display_mod.vpcf"); QRange.SetControlPoint(3, new Vector3(5, 0, 0)); QRange.SetControlPoint(2, new Vector3(152, 92, 255)); QRange.SetControlPoint(1, new Vector3(qRange, 0, 222)); } } } else { if (QRange != null) { QRange.Dispose(); } QRange = null; } if (Menu.Item("Range Electric Vortex").GetValue <bool>() && W != null && W.Level > 0) { wRange = W.GetCastRange(); if (WRange == null) { if (me.IsAlive) { WRange = me.AddParticleEffect("materials/ensage_ui/particles/range_display_mod.vpcf"); WRange.SetControlPoint(3, new Vector3(5, 0, 0)); WRange.SetControlPoint(2, new Vector3(64, 224, 208)); WRange.SetControlPoint(1, new Vector3(wRange, 0, 222)); } } else { if (!me.IsAlive) { WRange.Dispose(); WRange = null; } else if (lastwRange != wRange) { WRange.Dispose(); lastwRange = wRange; WRange = me.AddParticleEffect("materials/ensage_ui/particles/range_display_mod.vpcf"); WRange.SetControlPoint(3, new Vector3(5, 0, 0)); WRange.SetControlPoint(2, new Vector3(64, 224, 208)); WRange.SetControlPoint(1, new Vector3(wRange, 0, 222)); } } } else { if (WRange != null) { WRange.Dispose(); } WRange = null; } }
public virtual async Task DrawingRangeDisplay() { if (Config.RangeStaticRemnant.Value && Q != null && Q.Level > 0) { qRange = Q.GetAbilityData("static_remnant_radius"); if (QRange == null) { if (me.IsAlive) { QRange = me.AddParticleEffect("materials/ensage_ui/particles/range_display_mod.vpcf"); QRange.SetControlPoint(3, new Vector3(5, 0, 0)); QRange.SetControlPoint(2, new Vector3(152, 92, 255)); QRange.SetControlPoint(1, new Vector3(qRange, 0, 222)); } } else { if (!me.IsAlive) { QRange.Dispose(); QRange = null; } else if (lastqRange != qRange) { QRange.Dispose(); lastqRange = qRange; QRange = me.AddParticleEffect("materials/ensage_ui/particles/range_display_mod.vpcf"); QRange.SetControlPoint(3, new Vector3(5, 0, 0)); QRange.SetControlPoint(2, new Vector3(152, 92, 255)); QRange.SetControlPoint(1, new Vector3(qRange, 0, 222)); } } } else { if (QRange != null) { QRange.Dispose(); } QRange = null; } if (Config.RangeElectricVortex.Value && W != null && W.Level > 0) { wRange = W.GetCastRange(); if (WRange == null) { if (me.IsAlive) { WRange = me.AddParticleEffect("materials/ensage_ui/particles/range_display_mod.vpcf"); WRange.SetControlPoint(3, new Vector3(5, 0, 0)); WRange.SetControlPoint(2, new Vector3(64, 224, 208)); WRange.SetControlPoint(1, new Vector3(wRange, 0, 222)); } } else { if (!me.IsAlive) { WRange.Dispose(); WRange = null; } else if (lastwRange != wRange) { WRange.Dispose(); lastwRange = wRange; WRange = me.AddParticleEffect("materials/ensage_ui/particles/range_display_mod.vpcf"); WRange.SetControlPoint(3, new Vector3(5, 0, 0)); WRange.SetControlPoint(2, new Vector3(64, 224, 208)); WRange.SetControlPoint(1, new Vector3(wRange, 0, 222)); } } } else { if (WRange != null) { WRange.Dispose(); } WRange = null; } await Await.Delay(500); }
public void ArraySharing() { // Basic copy-on-write var array1 = new QArray <long>(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); var array2 = new QArray <long>(array1); Assert.Equal(2, array1[2]); Assert.Equal(2, array2[2]); array1.Modify(2, 12); Assert.Equal(12, array1[2]); Assert.Equal(2, array2[2]); array2.Modify(2, 22); Assert.Equal(12, array1[2]); Assert.Equal(22, array2[2]); // Arrays of arrays array1 = new QArray <long>(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); array2 = new QArray <long>(array1); var arrayArray1 = new QArray <QArray <long> >(array1, array2); // in generated C# code, QArray<IQArray<long>> is used var arrayArray2 = new QArray <QArray <long> >(arrayArray1); Assert.Equal(2, arrayArray1[0][2]); Assert.Equal(2, arrayArray1[1][2]); arrayArray1.Modify(0, arrayArray1[0].Modify(2, 12)); Assert.Equal(12, arrayArray1[0][2]); Assert.Equal(2, arrayArray1[1][2]); Assert.Equal(12, array1[2]); arrayArray1.Modify(1, arrayArray1[1].Modify(2, 22)); Assert.Equal(12, arrayArray1[0][2]); Assert.Equal(22, arrayArray1[1][2]); Assert.Equal(12, array1[2]); Assert.Equal(22, array2[2]); // Copy-on-write with slices var r = new QRange(1, 2, 10); var array3 = array2.Slice(r); var expected = new QArray <long>(1, 3, 5, 7, 9); Assert.Equal(expected, array3); array3.Modify(0, 11); Assert.Equal(1, array2[1]); Assert.Equal(11, array3[0]); // Mixing slicing and joining array2 = new QArray <long>(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); var expected2 = new QArray <long>(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); r = new QRange(1, 2, 10); array3 = array2.Slice(r); var array4 = new QArray <long>(11, 13); var array5 = QArray <long> .Add(array3, array4); var expected3 = new QArray <long>(1, 3, 5, 7, 9); var expected4 = new QArray <long>(11, 13); var expected5 = new QArray <long>(1, 3, 5, 7, 9, 11, 13); Assert.Equal(expected2, array2); Assert.Equal(expected3, array3); Assert.Equal(expected4, array4); Assert.Equal(expected5, array5); // Self-joining array1 = new QArray <long>(0, 1, 2); array2 = new QArray <long>(QArray <long> .Add(array1, array1)); var expected1 = new QArray <long>(0, 1, 2); expected2 = new QArray <long>(0, 1, 2, 0, 1, 2); Assert.Equal(expected1, array1); Assert.Equal(expected2, array2); array1.Modify(0, 10); Assert.Equal(10, array1[0]); Assert.Equal(0, array2[0]); }
public Range(QRange value) => this.Value = value;