Esempio n. 1
0
	// Update is called once per frame
	void Update () {
		if(Input.GetKeyUp(KeyCode.Space)) {

			CustomData customData = new CustomData();
			customData.Add("velocity", this.gameObject.GetComponent<Rigidbody>().velocity.ToString());

			RedMetricsManager.get ().sendEvent(TrackingEvent.JUMP,
			                                   this.gameObject.transform.position,
			                                   customData,
			                                   Application.loadedLevelName);

			giveImpulsion();
		}

		if(this.gameObject.transform.localPosition.y < -2.0f) {

			CustomData customData = new CustomData();
			customData.Add("velocity", this.gameObject.GetComponent<Rigidbody>().velocity.ToString());

			RedMetricsManager.get ().sendEvent(TrackingEvent.BOUNCE, 
			                                   this.gameObject.transform.position,
			                                   customData,
			                                   Application.loadedLevelName);
			giveImpulsion();
		}
	}
 public CustomData GetProvinceAndBrowser(string Country, string Browser)
 {
     CustomData customData = new CustomData();
     customData.ProvinceInfo = new CountryProvinceBL().GetProvince(Country);
     if (Browser == "ie")
         customData.BrowserInfo = " Did you learn to program IE 8.0";
     else if (Browser == "firefox")
         customData.BrowserInfo = " Mozilla rocks, try Firebug & Fiddler addon's";
     else
         customData.BrowserInfo = " I did not test in this browser";
     return customData;
 }
        public void AggregatesTimeValuePairsWithOutVolumeProperly()
        {
            TradeBar newTradeBar = null;
            var consolidator = new DynamicDataConsolidator(4);
            consolidator.DataConsolidated += (sender, tradeBar) =>
            {
                newTradeBar = tradeBar;
            };
            var reference = DateTime.Today;
            var bar1 = new CustomData
            {
                Symbol = "SPY",
                Time = reference,
                Value = 5
            };
            consolidator.Update(bar1);
            Assert.IsNull(newTradeBar);

            var bar2 = new CustomData
            {
                Symbol = "SPY",
                Time = reference.AddHours(1),
                Value = 10
            };
            consolidator.Update(bar2);
            Assert.IsNull(newTradeBar);
            var bar3 = new CustomData
            {
                Symbol = "SPY",
                Time = reference.AddHours(2),
                Value = 1
            };
            consolidator.Update(bar3);
            Assert.IsNull(newTradeBar);

            var bar4 = new CustomData
            {
                Symbol = "SPY",
                Time = reference.AddHours(3),
                Value = 9
            };
            consolidator.Update(bar4);
            Assert.IsNotNull(newTradeBar);

            Assert.AreEqual("SPY", newTradeBar.Symbol.Permtick);
            Assert.AreEqual(bar1.Time, newTradeBar.Time);
            Assert.AreEqual(bar1.Value, newTradeBar.Open);
            Assert.AreEqual(bar2.Value, newTradeBar.High);
            Assert.AreEqual(bar3.Value, newTradeBar.Low);
            Assert.AreEqual(bar4.Value, newTradeBar.Close);
            Assert.AreEqual(0, newTradeBar.Volume);
        }
        protected void HandlePanic(SimpleXmlPropertyBag input, SimpleXmlPropertyBag output, bool start)
        {
            // get the resource...
            string resourceId = input.GetStringValue("resourceid", null, Cultures.System, OnNotFound.ThrowException);

            // find it...
            ResourceCollection resources = Resource.GetByExternalId(resourceId);
            if (resources.Count == 0)
                throw new InvalidOperationException(string.Format("A resource with ID '{0}' was not found.", resourceId));

            // we've got the one that we want...
            Resource resource = resources[0];

            // find the custom field...
            TableCatalogItem table = TableCatalogItem.GetByName("Resource");
            if (table == null)
                throw new InvalidOperationException("'table' is null.");
            CustomField field = CustomField.GetByNameAndTableCatalogId("Panic", table.TableCatalogId);
            if (field == null)
                throw new InvalidOperationException("'field' is null.");

            // get the data item...
            CustomData item = CustomData.GetByCustomFieldIdAndObjectId(field.CustomFieldId, resource.ResourceId);
            if (item == null)
            {
                item = new CustomData();
                item.CustomField = field;
                item.ObjectId = resource.ResourceId;
            }

            // set...
            if (start)
                item.Value = string.Format("Entered alert state at '{0}'", DateTime.Now);
            else
                item.Value = string.Empty;

            // save...
            item.SaveChanges();

            // set...
            output["NowPanicking"] = start;
        }
Esempio n. 5
0
        public float Seconds(NWCreature user, NWItem item, NWObject target, Location targetLocation, CustomData customData)
        {
            NWPlayer userPlayer = (user.Object);
            NWItem   targetItem = (target.Object);
            float    perkBonus  = 0.0f;

            if (_item.ArmorBaseItemTypes.Contains(targetItem.BaseItemType))
            {
                perkBonus = _perk.GetPCPerkLevel(userPlayer, PerkType.SpeedyArmorsmith) * 0.1f;
            }
            else if (_item.WeaponBaseItemTypes.Contains(targetItem.BaseItemType))
            {
                perkBonus = _perk.GetPCPerkLevel(userPlayer, PerkType.SpeedyWeaponsmith) * 0.1f;
            }

            float seconds = 18.0f - (18.0f * perkBonus);

            if (seconds <= 0.1f)
            {
                seconds = 0.1f;
            }
            return(seconds);
        }
Esempio n. 6
0
        /// <inheritdoc />
        public bool Equals([AllowNull] ScatterCarpet other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                     ) &&
                 (
                     Visible == other.Visible ||
                     Visible != null &&
                     Visible.Equals(other.Visible)
                 ) &&
                 (
                     ShowLegend == other.ShowLegend ||
                     ShowLegend != null &&
                     ShowLegend.Equals(other.ShowLegend)
                 ) &&
                 (
                     LegendGroup == other.LegendGroup ||
                     LegendGroup != null &&
                     LegendGroup.Equals(other.LegendGroup)
                 ) &&
                 (
                     Opacity == other.Opacity ||
                     Opacity != null &&
                     Opacity.Equals(other.Opacity)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     UId == other.UId ||
                     UId != null &&
                     UId.Equals(other.UId)
                 ) &&
                 (
                     Equals(Ids, other.Ids) ||
                     Ids != null && other.Ids != null &&
                     Ids.SequenceEqual(other.Ids)
                 ) &&
                 (
                     Equals(CustomData, other.CustomData) ||
                     CustomData != null && other.CustomData != null &&
                     CustomData.SequenceEqual(other.CustomData)
                 ) &&
                 (
                     Meta == other.Meta ||
                     Meta != null &&
                     Meta.Equals(other.Meta)
                 ) &&
                 (
                     Equals(MetaArray, other.MetaArray) ||
                     MetaArray != null && other.MetaArray != null &&
                     MetaArray.SequenceEqual(other.MetaArray)
                 ) &&
                 (
                     SelectedPoints == other.SelectedPoints ||
                     SelectedPoints != null &&
                     SelectedPoints.Equals(other.SelectedPoints)
                 ) &&
                 (
                     HoverLabel == other.HoverLabel ||
                     HoverLabel != null &&
                     HoverLabel.Equals(other.HoverLabel)
                 ) &&
                 (
                     Stream == other.Stream ||
                     Stream != null &&
                     Stream.Equals(other.Stream)
                 ) &&
                 (
                     Equals(Transforms, other.Transforms) ||
                     Transforms != null && other.Transforms != null &&
                     Transforms.SequenceEqual(other.Transforms)
                 ) &&
                 (
                     UiRevision == other.UiRevision ||
                     UiRevision != null &&
                     UiRevision.Equals(other.UiRevision)
                 ) &&
                 (
                     Carpet == other.Carpet ||
                     Carpet != null &&
                     Carpet.Equals(other.Carpet)
                 ) &&
                 (
                     Equals(A, other.A) ||
                     A != null && other.A != null &&
                     A.SequenceEqual(other.A)
                 ) &&
                 (
                     Equals(B, other.B) ||
                     B != null && other.B != null &&
                     B.SequenceEqual(other.B)
                 ) &&
                 (
                     Mode == other.Mode ||
                     Mode != null &&
                     Mode.Equals(other.Mode)
                 ) &&
                 (
                     Text == other.Text ||
                     Text != null &&
                     Text.Equals(other.Text)
                 ) &&
                 (
                     Equals(TextArray, other.TextArray) ||
                     TextArray != null && other.TextArray != null &&
                     TextArray.SequenceEqual(other.TextArray)
                 ) &&
                 (
                     TextTemplate == other.TextTemplate ||
                     TextTemplate != null &&
                     TextTemplate.Equals(other.TextTemplate)
                 ) &&
                 (
                     Equals(TextTemplateArray, other.TextTemplateArray) ||
                     TextTemplateArray != null && other.TextTemplateArray != null &&
                     TextTemplateArray.SequenceEqual(other.TextTemplateArray)
                 ) &&
                 (
                     HoverText == other.HoverText ||
                     HoverText != null &&
                     HoverText.Equals(other.HoverText)
                 ) &&
                 (
                     Equals(HoverTextArray, other.HoverTextArray) ||
                     HoverTextArray != null && other.HoverTextArray != null &&
                     HoverTextArray.SequenceEqual(other.HoverTextArray)
                 ) &&
                 (
                     Line == other.Line ||
                     Line != null &&
                     Line.Equals(other.Line)
                 ) &&
                 (
                     ConnectGaps == other.ConnectGaps ||
                     ConnectGaps != null &&
                     ConnectGaps.Equals(other.ConnectGaps)
                 ) &&
                 (
                     Fill == other.Fill ||
                     Fill != null &&
                     Fill.Equals(other.Fill)
                 ) &&
                 (
                     FillColor == other.FillColor ||
                     FillColor != null &&
                     FillColor.Equals(other.FillColor)
                 ) &&
                 (
                     Marker == other.Marker ||
                     Marker != null &&
                     Marker.Equals(other.Marker)
                 ) &&
                 (
                     TextFont == other.TextFont ||
                     TextFont != null &&
                     TextFont.Equals(other.TextFont)
                 ) &&
                 (
                     TextPosition == other.TextPosition ||
                     TextPosition != null &&
                     TextPosition.Equals(other.TextPosition)
                 ) &&
                 (
                     Equals(TextPositionArray, other.TextPositionArray) ||
                     TextPositionArray != null && other.TextPositionArray != null &&
                     TextPositionArray.SequenceEqual(other.TextPositionArray)
                 ) &&
                 (
                     Selected == other.Selected ||
                     Selected != null &&
                     Selected.Equals(other.Selected)
                 ) &&
                 (
                     Unselected == other.Unselected ||
                     Unselected != null &&
                     Unselected.Equals(other.Unselected)
                 ) &&
                 (
                     HoverInfo == other.HoverInfo ||
                     HoverInfo != null &&
                     HoverInfo.Equals(other.HoverInfo)
                 ) &&
                 (
                     Equals(HoverInfoArray, other.HoverInfoArray) ||
                     HoverInfoArray != null && other.HoverInfoArray != null &&
                     HoverInfoArray.SequenceEqual(other.HoverInfoArray)
                 ) &&
                 (
                     HoverOn == other.HoverOn ||
                     HoverOn != null &&
                     HoverOn.Equals(other.HoverOn)
                 ) &&
                 (
                     HoverTemplate == other.HoverTemplate ||
                     HoverTemplate != null &&
                     HoverTemplate.Equals(other.HoverTemplate)
                 ) &&
                 (
                     Equals(HoverTemplateArray, other.HoverTemplateArray) ||
                     HoverTemplateArray != null && other.HoverTemplateArray != null &&
                     HoverTemplateArray.SequenceEqual(other.HoverTemplateArray)
                 ) &&
                 (
                     XAxis == other.XAxis ||
                     XAxis != null &&
                     XAxis.Equals(other.XAxis)
                 ) &&
                 (
                     YAxis == other.YAxis ||
                     YAxis != null &&
                     YAxis.Equals(other.YAxis)
                 ) &&
                 (
                     IdsSrc == other.IdsSrc ||
                     IdsSrc != null &&
                     IdsSrc.Equals(other.IdsSrc)
                 ) &&
                 (
                     CustomDataSrc == other.CustomDataSrc ||
                     CustomDataSrc != null &&
                     CustomDataSrc.Equals(other.CustomDataSrc)
                 ) &&
                 (
                     MetaSrc == other.MetaSrc ||
                     MetaSrc != null &&
                     MetaSrc.Equals(other.MetaSrc)
                 ) &&
                 (
                     ASrc == other.ASrc ||
                     ASrc != null &&
                     ASrc.Equals(other.ASrc)
                 ) &&
                 (
                     BSrc == other.BSrc ||
                     BSrc != null &&
                     BSrc.Equals(other.BSrc)
                 ) &&
                 (
                     TextSrc == other.TextSrc ||
                     TextSrc != null &&
                     TextSrc.Equals(other.TextSrc)
                 ) &&
                 (
                     TextTemplateSrc == other.TextTemplateSrc ||
                     TextTemplateSrc != null &&
                     TextTemplateSrc.Equals(other.TextTemplateSrc)
                 ) &&
                 (
                     HoverTextSrc == other.HoverTextSrc ||
                     HoverTextSrc != null &&
                     HoverTextSrc.Equals(other.HoverTextSrc)
                 ) &&
                 (
                     TextPositionSrc == other.TextPositionSrc ||
                     TextPositionSrc != null &&
                     TextPositionSrc.Equals(other.TextPositionSrc)
                 ) &&
                 (
                     HoverInfoSrc == other.HoverInfoSrc ||
                     HoverInfoSrc != null &&
                     HoverInfoSrc.Equals(other.HoverInfoSrc)
                 ) &&
                 (
                     HoverTemplateSrc == other.HoverTemplateSrc ||
                     HoverTemplateSrc != null &&
                     HoverTemplateSrc.Equals(other.HoverTemplateSrc)
                 ));
        }
Esempio n. 7
0
        public void ApplyEffects(NWCreature user, NWItem item, NWObject target, Location targetLocation, CustomData customData)
        {
            NWPlayer player         = (user.Object);
            var      effectiveStats = PlayerStatService.GetPlayerItemEffectiveStats(player);

            CustomEffectService.RemovePCCustomEffect(target.Object, CustomEffectType.Bleeding);
            player.SendMessage("You finish bandaging " + target.Name + "'s wounds.");

            int rank = SkillService.GetPCSkillRank(player, SkillType.Medicine);

            int healAmount = 2 + effectiveStats.Medicine / 2;

            healAmount += item.MedicineBonus;
            if (rank >= item.RecommendedLevel && item.MedicineBonus > 0)
            {
                _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectHeal(healAmount), target);
            }
            if (target.IsPlayer)
            {
                int xp = (int)SkillService.CalculateRegisteredSkillLevelAdjustedXP(100, item.RecommendedLevel, rank);
                SkillService.GiveSkillXP(player, SkillType.Medicine, xp);
            }
        }
Esempio n. 8
0
        /// <inheritdoc />
        public bool Equals([AllowNull] Histogram2DContour other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                     ) &&
                 (
                     Visible == other.Visible ||
                     Visible != null &&
                     Visible.Equals(other.Visible)
                 ) &&
                 (
                     ShowLegend == other.ShowLegend ||
                     ShowLegend != null &&
                     ShowLegend.Equals(other.ShowLegend)
                 ) &&
                 (
                     LegendGroup == other.LegendGroup ||
                     LegendGroup != null &&
                     LegendGroup.Equals(other.LegendGroup)
                 ) &&
                 (
                     Opacity == other.Opacity ||
                     Opacity != null &&
                     Opacity.Equals(other.Opacity)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     UId == other.UId ||
                     UId != null &&
                     UId.Equals(other.UId)
                 ) &&
                 (
                     Equals(Ids, other.Ids) ||
                     Ids != null && other.Ids != null &&
                     Ids.SequenceEqual(other.Ids)
                 ) &&
                 (
                     Equals(CustomData, other.CustomData) ||
                     CustomData != null && other.CustomData != null &&
                     CustomData.SequenceEqual(other.CustomData)
                 ) &&
                 (
                     Meta == other.Meta ||
                     Meta != null &&
                     Meta.Equals(other.Meta)
                 ) &&
                 (
                     Equals(MetaArray, other.MetaArray) ||
                     MetaArray != null && other.MetaArray != null &&
                     MetaArray.SequenceEqual(other.MetaArray)
                 ) &&
                 (
                     HoverInfo == other.HoverInfo ||
                     HoverInfo != null &&
                     HoverInfo.Equals(other.HoverInfo)
                 ) &&
                 (
                     Equals(HoverInfoArray, other.HoverInfoArray) ||
                     HoverInfoArray != null && other.HoverInfoArray != null &&
                     HoverInfoArray.SequenceEqual(other.HoverInfoArray)
                 ) &&
                 (
                     HoverLabel == other.HoverLabel ||
                     HoverLabel != null &&
                     HoverLabel.Equals(other.HoverLabel)
                 ) &&
                 (
                     Stream == other.Stream ||
                     Stream != null &&
                     Stream.Equals(other.Stream)
                 ) &&
                 (
                     Equals(Transforms, other.Transforms) ||
                     Transforms != null && other.Transforms != null &&
                     Transforms.SequenceEqual(other.Transforms)
                 ) &&
                 (
                     UiRevision == other.UiRevision ||
                     UiRevision != null &&
                     UiRevision.Equals(other.UiRevision)
                 ) &&
                 (
                     Equals(X, other.X) ||
                     X != null && other.X != null &&
                     X.SequenceEqual(other.X)
                 ) &&
                 (
                     Equals(Y, other.Y) ||
                     Y != null && other.Y != null &&
                     Y.SequenceEqual(other.Y)
                 ) &&
                 (
                     Equals(Z, other.Z) ||
                     Z != null && other.Z != null &&
                     Z.SequenceEqual(other.Z)
                 ) &&
                 (
                     Marker == other.Marker ||
                     Marker != null &&
                     Marker.Equals(other.Marker)
                 ) &&
                 (
                     HistNorm == other.HistNorm ||
                     HistNorm != null &&
                     HistNorm.Equals(other.HistNorm)
                 ) &&
                 (
                     HistFunc == other.HistFunc ||
                     HistFunc != null &&
                     HistFunc.Equals(other.HistFunc)
                 ) &&
                 (
                     NBinsX == other.NBinsX ||
                     NBinsX != null &&
                     NBinsX.Equals(other.NBinsX)
                 ) &&
                 (
                     XBins == other.XBins ||
                     XBins != null &&
                     XBins.Equals(other.XBins)
                 ) &&
                 (
                     NBinsY == other.NBinsY ||
                     NBinsY != null &&
                     NBinsY.Equals(other.NBinsY)
                 ) &&
                 (
                     YBins == other.YBins ||
                     YBins != null &&
                     YBins.Equals(other.YBins)
                 ) &&
                 (
                     AutoBinX == other.AutoBinX ||
                     AutoBinX != null &&
                     AutoBinX.Equals(other.AutoBinX)
                 ) &&
                 (
                     AutoBinY == other.AutoBinY ||
                     AutoBinY != null &&
                     AutoBinY.Equals(other.AutoBinY)
                 ) &&
                 (
                     BinGroup == other.BinGroup ||
                     BinGroup != null &&
                     BinGroup.Equals(other.BinGroup)
                 ) &&
                 (
                     XBinGroup == other.XBinGroup ||
                     XBinGroup != null &&
                     XBinGroup.Equals(other.XBinGroup)
                 ) &&
                 (
                     YBinGroup == other.YBinGroup ||
                     YBinGroup != null &&
                     YBinGroup.Equals(other.YBinGroup)
                 ) &&
                 (
                     AutoContour == other.AutoContour ||
                     AutoContour != null &&
                     AutoContour.Equals(other.AutoContour)
                 ) &&
                 (
                     NContours == other.NContours ||
                     NContours != null &&
                     NContours.Equals(other.NContours)
                 ) &&
                 (
                     Contours == other.Contours ||
                     Contours != null &&
                     Contours.Equals(other.Contours)
                 ) &&
                 (
                     Line == other.Line ||
                     Line != null &&
                     Line.Equals(other.Line)
                 ) &&
                 (
                     ZHoverFormat == other.ZHoverFormat ||
                     ZHoverFormat != null &&
                     ZHoverFormat.Equals(other.ZHoverFormat)
                 ) &&
                 (
                     HoverTemplate == other.HoverTemplate ||
                     HoverTemplate != null &&
                     HoverTemplate.Equals(other.HoverTemplate)
                 ) &&
                 (
                     Equals(HoverTemplateArray, other.HoverTemplateArray) ||
                     HoverTemplateArray != null && other.HoverTemplateArray != null &&
                     HoverTemplateArray.SequenceEqual(other.HoverTemplateArray)
                 ) &&
                 (
                     ZAuto == other.ZAuto ||
                     ZAuto != null &&
                     ZAuto.Equals(other.ZAuto)
                 ) &&
                 (
                     ZMin == other.ZMin ||
                     ZMin != null &&
                     ZMin.Equals(other.ZMin)
                 ) &&
                 (
                     ZMax == other.ZMax ||
                     ZMax != null &&
                     ZMax.Equals(other.ZMax)
                 ) &&
                 (
                     ZMid == other.ZMid ||
                     ZMid != null &&
                     ZMid.Equals(other.ZMid)
                 ) &&
                 (
                     ColorScale == other.ColorScale ||
                     ColorScale != null &&
                     ColorScale.Equals(other.ColorScale)
                 ) &&
                 (
                     AutoColorScale == other.AutoColorScale ||
                     AutoColorScale != null &&
                     AutoColorScale.Equals(other.AutoColorScale)
                 ) &&
                 (
                     ReverseScale == other.ReverseScale ||
                     ReverseScale != null &&
                     ReverseScale.Equals(other.ReverseScale)
                 ) &&
                 (
                     ShowScale == other.ShowScale ||
                     ShowScale != null &&
                     ShowScale.Equals(other.ShowScale)
                 ) &&
                 (
                     ColorBar == other.ColorBar ||
                     ColorBar != null &&
                     ColorBar.Equals(other.ColorBar)
                 ) &&
                 (
                     ColorAxis == other.ColorAxis ||
                     ColorAxis != null &&
                     ColorAxis.Equals(other.ColorAxis)
                 ) &&
                 (
                     XCalendar == other.XCalendar ||
                     XCalendar != null &&
                     XCalendar.Equals(other.XCalendar)
                 ) &&
                 (
                     YCalendar == other.YCalendar ||
                     YCalendar != null &&
                     YCalendar.Equals(other.YCalendar)
                 ) &&
                 (
                     XAxis == other.XAxis ||
                     XAxis != null &&
                     XAxis.Equals(other.XAxis)
                 ) &&
                 (
                     YAxis == other.YAxis ||
                     YAxis != null &&
                     YAxis.Equals(other.YAxis)
                 ) &&
                 (
                     IdsSrc == other.IdsSrc ||
                     IdsSrc != null &&
                     IdsSrc.Equals(other.IdsSrc)
                 ) &&
                 (
                     CustomDataSrc == other.CustomDataSrc ||
                     CustomDataSrc != null &&
                     CustomDataSrc.Equals(other.CustomDataSrc)
                 ) &&
                 (
                     MetaSrc == other.MetaSrc ||
                     MetaSrc != null &&
                     MetaSrc.Equals(other.MetaSrc)
                 ) &&
                 (
                     HoverInfoSrc == other.HoverInfoSrc ||
                     HoverInfoSrc != null &&
                     HoverInfoSrc.Equals(other.HoverInfoSrc)
                 ) &&
                 (
                     XSrc == other.XSrc ||
                     XSrc != null &&
                     XSrc.Equals(other.XSrc)
                 ) &&
                 (
                     YSrc == other.YSrc ||
                     YSrc != null &&
                     YSrc.Equals(other.YSrc)
                 ) &&
                 (
                     ZSrc == other.ZSrc ||
                     ZSrc != null &&
                     ZSrc.Equals(other.ZSrc)
                 ) &&
                 (
                     HoverTemplateSrc == other.HoverTemplateSrc ||
                     HoverTemplateSrc != null &&
                     HoverTemplateSrc.Equals(other.HoverTemplateSrc)
                 ));
        }
Esempio n. 9
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (Visible != null)
         {
             hashCode = hashCode * 59 + Visible.GetHashCode();
         }
         if (ShowLegend != null)
         {
             hashCode = hashCode * 59 + ShowLegend.GetHashCode();
         }
         if (LegendGroup != null)
         {
             hashCode = hashCode * 59 + LegendGroup.GetHashCode();
         }
         if (Opacity != null)
         {
             hashCode = hashCode * 59 + Opacity.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (UId != null)
         {
             hashCode = hashCode * 59 + UId.GetHashCode();
         }
         if (Ids != null)
         {
             hashCode = hashCode * 59 + Ids.GetHashCode();
         }
         if (CustomData != null)
         {
             hashCode = hashCode * 59 + CustomData.GetHashCode();
         }
         if (Meta != null)
         {
             hashCode = hashCode * 59 + Meta.GetHashCode();
         }
         if (MetaArray != null)
         {
             hashCode = hashCode * 59 + MetaArray.GetHashCode();
         }
         if (SelectedPoints != null)
         {
             hashCode = hashCode * 59 + SelectedPoints.GetHashCode();
         }
         if (HoverLabel != null)
         {
             hashCode = hashCode * 59 + HoverLabel.GetHashCode();
         }
         if (Stream != null)
         {
             hashCode = hashCode * 59 + Stream.GetHashCode();
         }
         if (Transforms != null)
         {
             hashCode = hashCode * 59 + Transforms.GetHashCode();
         }
         if (UiRevision != null)
         {
             hashCode = hashCode * 59 + UiRevision.GetHashCode();
         }
         if (Mode != null)
         {
             hashCode = hashCode * 59 + Mode.GetHashCode();
         }
         if (R != null)
         {
             hashCode = hashCode * 59 + R.GetHashCode();
         }
         if (Theta != null)
         {
             hashCode = hashCode * 59 + Theta.GetHashCode();
         }
         if (R0 != null)
         {
             hashCode = hashCode * 59 + R0.GetHashCode();
         }
         if (Dr != null)
         {
             hashCode = hashCode * 59 + Dr.GetHashCode();
         }
         if (Theta0 != null)
         {
             hashCode = hashCode * 59 + Theta0.GetHashCode();
         }
         if (DTheta != null)
         {
             hashCode = hashCode * 59 + DTheta.GetHashCode();
         }
         if (ThetaUnit != null)
         {
             hashCode = hashCode * 59 + ThetaUnit.GetHashCode();
         }
         if (Text != null)
         {
             hashCode = hashCode * 59 + Text.GetHashCode();
         }
         if (TextArray != null)
         {
             hashCode = hashCode * 59 + TextArray.GetHashCode();
         }
         if (TextTemplate != null)
         {
             hashCode = hashCode * 59 + TextTemplate.GetHashCode();
         }
         if (TextTemplateArray != null)
         {
             hashCode = hashCode * 59 + TextTemplateArray.GetHashCode();
         }
         if (HoverText != null)
         {
             hashCode = hashCode * 59 + HoverText.GetHashCode();
         }
         if (HoverTextArray != null)
         {
             hashCode = hashCode * 59 + HoverTextArray.GetHashCode();
         }
         if (HoverTemplate != null)
         {
             hashCode = hashCode * 59 + HoverTemplate.GetHashCode();
         }
         if (HoverTemplateArray != null)
         {
             hashCode = hashCode * 59 + HoverTemplateArray.GetHashCode();
         }
         if (Line != null)
         {
             hashCode = hashCode * 59 + Line.GetHashCode();
         }
         if (ConnectGaps != null)
         {
             hashCode = hashCode * 59 + ConnectGaps.GetHashCode();
         }
         if (Marker != null)
         {
             hashCode = hashCode * 59 + Marker.GetHashCode();
         }
         if (Fill != null)
         {
             hashCode = hashCode * 59 + Fill.GetHashCode();
         }
         if (FillColor != null)
         {
             hashCode = hashCode * 59 + FillColor.GetHashCode();
         }
         if (TextPosition != null)
         {
             hashCode = hashCode * 59 + TextPosition.GetHashCode();
         }
         if (TextPositionArray != null)
         {
             hashCode = hashCode * 59 + TextPositionArray.GetHashCode();
         }
         if (TextFont != null)
         {
             hashCode = hashCode * 59 + TextFont.GetHashCode();
         }
         if (HoverInfo != null)
         {
             hashCode = hashCode * 59 + HoverInfo.GetHashCode();
         }
         if (HoverInfoArray != null)
         {
             hashCode = hashCode * 59 + HoverInfoArray.GetHashCode();
         }
         if (Selected != null)
         {
             hashCode = hashCode * 59 + Selected.GetHashCode();
         }
         if (Unselected != null)
         {
             hashCode = hashCode * 59 + Unselected.GetHashCode();
         }
         if (Subplot != null)
         {
             hashCode = hashCode * 59 + Subplot.GetHashCode();
         }
         if (IdsSrc != null)
         {
             hashCode = hashCode * 59 + IdsSrc.GetHashCode();
         }
         if (CustomDataSrc != null)
         {
             hashCode = hashCode * 59 + CustomDataSrc.GetHashCode();
         }
         if (MetaSrc != null)
         {
             hashCode = hashCode * 59 + MetaSrc.GetHashCode();
         }
         if (RSrc != null)
         {
             hashCode = hashCode * 59 + RSrc.GetHashCode();
         }
         if (ThetaSrc != null)
         {
             hashCode = hashCode * 59 + ThetaSrc.GetHashCode();
         }
         if (TextSrc != null)
         {
             hashCode = hashCode * 59 + TextSrc.GetHashCode();
         }
         if (TextTemplateSrc != null)
         {
             hashCode = hashCode * 59 + TextTemplateSrc.GetHashCode();
         }
         if (HoverTextSrc != null)
         {
             hashCode = hashCode * 59 + HoverTextSrc.GetHashCode();
         }
         if (HoverTemplateSrc != null)
         {
             hashCode = hashCode * 59 + HoverTemplateSrc.GetHashCode();
         }
         if (TextPositionSrc != null)
         {
             hashCode = hashCode * 59 + TextPositionSrc.GetHashCode();
         }
         if (HoverInfoSrc != null)
         {
             hashCode = hashCode * 59 + HoverInfoSrc.GetHashCode();
         }
         return(hashCode);
     }
 }
Esempio n. 10
0
    public void Initialize(SerializableSiteElement[] serializableSiteElements, Site parentSite)
    {
        this.parentSite = parentSite;
        setType         = GetSetType();


        Debug.Log("Initializing " + setType + " for site " + parentSite.siteName);

        siteElements = new List <SiteElement>();

        foreach (SerializableSiteElement element in serializableSiteElements)
        {
            //Merge customData string and customdata object, prioritizing previously existing object
            CustomData c = JsonUtility.FromJson <CustomData>(element.customData);
            element.custom = c != null ? c : new CustomData();

            //Add local overrides to json file
            if (SiteManager.instance.customOverrides != null)
            {
                SerializableElements customs = SiteManager.instance.customOverrides;
                foreach (SerializableSiteElement e in customs.elements)
                {
                    //If names are equal, override custom properties
                    Debug.Log(e.name);
                    Debug.Log(element.name);
                    if (e.name == element.name)
                    {
                        if (e.custom.audio != null)
                        {
                            element.custom.audio = e.custom.audio;
                        }
                        if (e.custom.modelType != null && e.custom.modelType != "")
                        {
                            element.custom.modelType = e.custom.modelType;
                        }
                        if (e.custom.startTransform.position != Vector3.zero ||
                            e.custom.startTransform.eulerAngles != Vector3.zero
                            )
                        {
                            Debug.Log("override position: " + e.custom.startTransform.position);
                            element.custom.startTransform = e.custom.startTransform;
                        }
                        if (e.custom.splines != null)
                        {
                            element.custom.splines = e.custom.splines;
                        }
                        if (e.custom.shapefilePath != null && e.custom.shapefilePath != "")
                        {
                            element.custom.shapefilePath = e.custom.shapefilePath;
                        }
                    }
                }
            }

            GameObject  newElementObj = CreateElementObject(element.name);
            SiteElement newElement    = AddElementComponent(newElementObj, element);

            newElement.Initialize(element, parentSite);

            siteElements.Add(newElement);
        }
    }
 public void sendEvent(TrackingEvent trackingEvent, CustomData customData = null, string section = null, int[] coordinates = null)
 {
     //logMessage("RedMetricsManager::sendEvent");
     if(Application.isWebPlayer) {
         TrackingEventDataWithoutIDs data = new TrackingEventDataWithoutIDs(trackingEvent, customData, section, coordinates);
         string json = getJsonString(data);
         //logMessage("RedMetricsManager::sendEvent isWebPlayer will rmPostEvent json="+json);
         Application.ExternalCall("rmPostEvent", json);
     } else {
         //logMessage("RedMetricsManager::sendEvent non web player");
         //TODO wait on playerID using an IEnumerator
         if(!string.IsNullOrEmpty(playerID))
         {
             TrackingEventDataWithIDs data = new TrackingEventDataWithIDs(playerID, gameVersion, trackingEvent, customData, section, coordinates);
             string json = getJsonString(data);
             //logMessage("RedMetricsManager::sendEvent player already identified - pID="+playerID);
             sendDataStandalone(redMetricsEvent, json, value => wwwLogger(value, "sendEvent("+trackingEvent+")"));
         } else {
             logMessage("RedMetricsManager::sendEvent no registered player!", MessageLevel.ERROR);
         }
     }
 }
 public void sendEvent(TrackingEvent trackingEvent, Vector3 coordinates, CustomData customData = null, string section = null)
 {
     int[] _coordinates = { Mathf.RoundToInt(coordinates.x), Mathf.RoundToInt(coordinates.y), Mathf.RoundToInt(coordinates.z) };
     sendEvent(trackingEvent, customData, section, _coordinates);
 }
Esempio n. 13
0
    public void sendEvent (TrackingEvent trackingEvent, CustomData customData = null, string section = null, int[] coordinates = null, string userTime = null)
    {
        string checkedSection = section;

        //TODO remove dependency to Hero class
        if (string.IsNullOrEmpty (section) && (null != Hero.get ())) {
            checkedSection = Hero.get ().getLastCheckpointName ();
        }

        int[] checkedCoordinates = null;
        if (null != coordinates) {
            checkedCoordinates = new int[coordinates.Length];
            for (int i = 0; i < coordinates.Length; i++) {
                checkedCoordinates [i] = coordinates [i];
            }
        } else {
            if (null != Hero.get ()) {
                Vector3 position = Hero.get ().gameObject.transform.position;
                checkedCoordinates = new int[2] {
                    Mathf.FloorToInt (position.x),
                    Mathf.FloorToInt (position.z)
                };
            }
        }
             
        //logMessage(MessageLevel.DEFAULT, "RedMetricsManager::sendEvent({0})", trackingEvent.ToString());
        if (Application.isWebPlayer) {
            TrackingEventDataWithoutIDs data = new TrackingEventDataWithoutIDs (trackingEvent, customData, checkedSection, checkedCoordinates, userTime);   
            if(isGameSessionGUIDCreated) {
                string json = getJsonString (data);
                Application.ExternalCall ("rmPostEvent", json);
            } else {
                addEventToSendLater(data);
                //TODO: what if connection fails, or even fails permanently? Should retry connection at different intervals
            }
        } else {
            //TODO wait on gameSessionGUID using an IEnumerator
            if (defaultGameSessionGUID != gameSessionGUID) {
            } else {
                logMessage (MessageLevel.ERROR, "sendEvent default player guid: no registered player!");
            }

            TrackingEventDataWithIDs data = new TrackingEventDataWithIDs (gameSessionGUID, gameVersionGuid, trackingEvent, customData, checkedSection, checkedCoordinates);
            string json = getJsonString (data);
            //logMessage (MessageLevel.DEFAULT, string.Format ("RedMetricsManager::sendEvent - gameSessionGUID={0}, gameVersionGuid={1}, json={2}", gameSessionGUID, gameVersionGuid, json));
            sendDataStandalone (redMetricsEvent, json, value => wwwLogger (value, "sendEvent(" + trackingEvent + ")"));
            //TODO pass data as parameter to sendDataStandalone so that it's serialized inside
        }
    }
Esempio n. 14
0
 public CustomData generateCustomDataForGuidInit() {
     //TODO manage GLOBALPLAYERGUID
     CustomData guidCD = new CustomData (CustomDataTag.LOCALPLAYERGUID, localPlayerGUID);
     guidCD.Add(CustomDataTag.PLATFORM, Application.platform.ToString().ToLowerInvariant());
     //logMessage(MessageLevel.DEFAULT, "generated guidCD={0}", guidCD);
     return guidCD;        
 } 
Esempio n. 15
0
    void Update()
    {
        #region Tout ceci est pour les warehouses et leurs effets
        //Tout ceci est pour les warehouses et leurs effets
        for (var i = _numberOfWarehouses.Count - 1; i > -1; i--) {
            if (_numberOfWarehouses [i] == null)
                _numberOfWarehouses.RemoveAt (i);
        }

        _intOfWarehouses = _numberOfWarehouses.Count;

        _maxElectricity = 500f + (500f / 20) * _intOfWarehouses;
        _maxOxygen = 300f + (300f / 20) * _intOfWarehouses;
        _maxWater = 300f + (300f / 20) * _intOfWarehouses;
        _maxFood = 300f + (300f / 20) * _intOfWarehouses;
        _maxConstructionMaterials = 2000f + (1000f / 20) * _intOfWarehouses;
        _maxReparationMaterials = 2000f + (1000f / 20) * _intOfWarehouses;
        _maxUpgradeMaterials = 2000f + (1000f / 20) * _intOfWarehouses;
        #endregion

        //Redmetrics When the night end send stats
        if (Camera.main.GetComponent<DayNightController> ().currentTimeOfDay == 0) {

            CustomData customData = new CustomData ();
            customData.Add ("DataDay", ",  Oxygen: " + _actualOxygen + ",  Water: " + _actualWater + ",  Food: " + _actualFood + ",  Electricity: " + _actualElectricity + ",  Days: " + Camera.main.GetComponent<DayNightController> ()._days);

            RedMetricsManager.get ().sendEvent (TrackingEvent.STATS, customData);
        }
        //Redmetrics When the night end send stats

        if (_actualElectricity > _maxElectricity) {
            _actualElectricity = _maxElectricity;
        }

        if (_actualFood > _maxFood) {
            _actualFood = _maxFood;
        }

        if (_actualHumans > _maxHumans) {
            _actualHumans = _maxHumans;
        }

        if (_actualOxygen > _maxOxygen) {
            _actualOxygen = _maxOxygen;
        }

        if (_actualWater > _maxWater) {
            _actualWater = _maxWater;
        }

        if (_actualTemperature > _maxTemperature) {
            _actualTemperature = _maxTemperature;
        }

        if (_actualConstructionMaterials > _maxConstructionMaterials) {
            _actualConstructionMaterials = _maxConstructionMaterials;
        }

        if (_actualReparationMaterials > _maxReparationMaterials) {
            _actualReparationMaterials = _maxReparationMaterials;
        }

        if (_actualUpgradeMaterials > _maxUpgradeMaterials) {
            _actualUpgradeMaterials = _maxUpgradeMaterials;
        }
    }
Esempio n. 16
0
 public RequestCustomData(string Username, CustomData dataType, string Data = "")
 {
     Code = (int)CodeMessage.CARequestCustomData;
     From = Username;
     State = (int)CustomData.RequestUdpPort;
     if (Data != "") Msg = Encoding.GetBytes(Data);
 }
Esempio n. 17
0
 public float Seconds(NWCreature user, NWItem item, NWObject target, Location targetLocation, CustomData customData)
 {
     return(0);
 }
Esempio n. 18
0
 public void ThrowsErrorWhenDataShapeIsNotExpected()
 {
     var consolidator = new DynamicDataConsolidator(1, true, true);
     var data = new CustomData();
     consolidator.Update(data);
 }
Esempio n. 19
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (Visible != null)
         {
             hashCode = hashCode * 59 + Visible.GetHashCode();
         }
         if (ShowLegend != null)
         {
             hashCode = hashCode * 59 + ShowLegend.GetHashCode();
         }
         if (LegendGroup != null)
         {
             hashCode = hashCode * 59 + LegendGroup.GetHashCode();
         }
         if (Opacity != null)
         {
             hashCode = hashCode * 59 + Opacity.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (UId != null)
         {
             hashCode = hashCode * 59 + UId.GetHashCode();
         }
         if (Ids != null)
         {
             hashCode = hashCode * 59 + Ids.GetHashCode();
         }
         if (CustomData != null)
         {
             hashCode = hashCode * 59 + CustomData.GetHashCode();
         }
         if (Meta != null)
         {
             hashCode = hashCode * 59 + Meta.GetHashCode();
         }
         if (MetaArray != null)
         {
             hashCode = hashCode * 59 + MetaArray.GetHashCode();
         }
         if (Stream != null)
         {
             hashCode = hashCode * 59 + Stream.GetHashCode();
         }
         if (UiRevision != null)
         {
             hashCode = hashCode * 59 + UiRevision.GetHashCode();
         }
         if (Carpet != null)
         {
             hashCode = hashCode * 59 + Carpet.GetHashCode();
         }
         if (Z != null)
         {
             hashCode = hashCode * 59 + Z.GetHashCode();
         }
         if (A != null)
         {
             hashCode = hashCode * 59 + A.GetHashCode();
         }
         if (A0 != null)
         {
             hashCode = hashCode * 59 + A0.GetHashCode();
         }
         if (DA != null)
         {
             hashCode = hashCode * 59 + DA.GetHashCode();
         }
         if (B != null)
         {
             hashCode = hashCode * 59 + B.GetHashCode();
         }
         if (B0 != null)
         {
             hashCode = hashCode * 59 + B0.GetHashCode();
         }
         if (Db != null)
         {
             hashCode = hashCode * 59 + Db.GetHashCode();
         }
         if (Text != null)
         {
             hashCode = hashCode * 59 + Text.GetHashCode();
         }
         if (HoverText != null)
         {
             hashCode = hashCode * 59 + HoverText.GetHashCode();
         }
         if (Transpose != null)
         {
             hashCode = hashCode * 59 + Transpose.GetHashCode();
         }
         if (AType != null)
         {
             hashCode = hashCode * 59 + AType.GetHashCode();
         }
         if (BType != null)
         {
             hashCode = hashCode * 59 + BType.GetHashCode();
         }
         if (FillColor != null)
         {
             hashCode = hashCode * 59 + FillColor.GetHashCode();
         }
         if (AutoContour != null)
         {
             hashCode = hashCode * 59 + AutoContour.GetHashCode();
         }
         if (NContours != null)
         {
             hashCode = hashCode * 59 + NContours.GetHashCode();
         }
         if (Contours != null)
         {
             hashCode = hashCode * 59 + Contours.GetHashCode();
         }
         if (Line != null)
         {
             hashCode = hashCode * 59 + Line.GetHashCode();
         }
         if (ZAuto != null)
         {
             hashCode = hashCode * 59 + ZAuto.GetHashCode();
         }
         if (ZMin != null)
         {
             hashCode = hashCode * 59 + ZMin.GetHashCode();
         }
         if (ZMax != null)
         {
             hashCode = hashCode * 59 + ZMax.GetHashCode();
         }
         if (ZMid != null)
         {
             hashCode = hashCode * 59 + ZMid.GetHashCode();
         }
         if (ColorScale != null)
         {
             hashCode = hashCode * 59 + ColorScale.GetHashCode();
         }
         if (AutoColorScale != null)
         {
             hashCode = hashCode * 59 + AutoColorScale.GetHashCode();
         }
         if (ReverseScale != null)
         {
             hashCode = hashCode * 59 + ReverseScale.GetHashCode();
         }
         if (ShowScale != null)
         {
             hashCode = hashCode * 59 + ShowScale.GetHashCode();
         }
         if (ColorBar != null)
         {
             hashCode = hashCode * 59 + ColorBar.GetHashCode();
         }
         if (ColorAxis != null)
         {
             hashCode = hashCode * 59 + ColorAxis.GetHashCode();
         }
         if (XAxis != null)
         {
             hashCode = hashCode * 59 + XAxis.GetHashCode();
         }
         if (YAxis != null)
         {
             hashCode = hashCode * 59 + YAxis.GetHashCode();
         }
         if (IdsSrc != null)
         {
             hashCode = hashCode * 59 + IdsSrc.GetHashCode();
         }
         if (CustomDataSrc != null)
         {
             hashCode = hashCode * 59 + CustomDataSrc.GetHashCode();
         }
         if (MetaSrc != null)
         {
             hashCode = hashCode * 59 + MetaSrc.GetHashCode();
         }
         if (ZSrc != null)
         {
             hashCode = hashCode * 59 + ZSrc.GetHashCode();
         }
         if (ASrc != null)
         {
             hashCode = hashCode * 59 + ASrc.GetHashCode();
         }
         if (BSrc != null)
         {
             hashCode = hashCode * 59 + BSrc.GetHashCode();
         }
         if (TextSrc != null)
         {
             hashCode = hashCode * 59 + TextSrc.GetHashCode();
         }
         if (HoverTextSrc != null)
         {
             hashCode = hashCode * 59 + HoverTextSrc.GetHashCode();
         }
         return(hashCode);
     }
 }
Esempio n. 20
0
    void Victory()
    {
        EndTime = Time.time;
        TimeToFinish = EndTime - StartTime;

        //Redmetrics
        if (GameObject.FindGameObjectWithTag("Redmetrics") !=null){
        CustomData _customData = new CustomData();
        _customData.Add("Level Finished", "Level " + Application.loadedLevel + " finished, " +
                                    "Time Taken to finish : " + (int)TimeToFinish + " seconds, " +
                                    "Number of trials : " + NumberOfTries);

        RedMetricsManager.get().sendEvent(TrackingEvent.LEVELFINISHED, _customData);
        }
        //

        _UI.SetActive(false);
        foreach (Transform child in _ParticulSystem.transform)
        {
            child.GetComponent<ParticleSystem>().Play();
        }
        CurrentCase.transform.DOLocalMoveY(10, AscnesionTime);
        StartCoroutine("KatyPerry");
    }
        private async void SaveCommandExecute()
        {
            IsLoading = true;

            var updateUserRequest = new UpdateUserRequest {User = new UserRequest() {FullName = UserName}};

            if (newImageBytes != null)
            {
                var contentHelper = new ContentClientHelper(QuickbloxClient);
                var imageUploadResult = await contentHelper.UploadPublicImage(newImageBytes);
                if (imageUploadResult != null)
                {
                    var customData = new CustomData { AvatarUrl = imageUploadResult.Url, IsImport = "1" };
                    var customDataJson = JsonConvert.SerializeObject(customData);
                    updateUserRequest.User.BlobId = imageUploadResult.BlodId;
                    updateUserRequest.User.CustomData = customDataJson;
                }
            }

            var updateUserResponse = await QuickbloxClient.UsersClient.UpdateUserAsync(currentUser.Id, updateUserRequest);

            if (updateUserResponse.StatusCode == HttpStatusCode.OK)
            {
                var cachingQbClient = ServiceLocator.Locator.Get<ICachingQuickbloxClient>();
                cachingQbClient.DeleteUserFromCacheById(currentUser.Id);

                NavigationService.GoBack();
            }
            IsLoading = false;
        }
Esempio n. 22
0
        public bool Equals([AllowNull] FunnelArea other)
        {
            if (other == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return((Type == other.Type && Type != null && other.Type != null && Type.Equals(other.Type)) &&
                   (Visible == other.Visible && Visible != null && other.Visible != null && Visible.Equals(other.Visible)) &&
                   (ShowLegend == other.ShowLegend && ShowLegend != null && other.ShowLegend != null && ShowLegend.Equals(other.ShowLegend)) &&
                   (LegendGroup == other.LegendGroup && LegendGroup != null && other.LegendGroup != null && LegendGroup.Equals(other.LegendGroup)) &&
                   (Opacity == other.Opacity && Opacity != null && other.Opacity != null && Opacity.Equals(other.Opacity)) &&
                   (Name == other.Name && Name != null && other.Name != null && Name.Equals(other.Name)) &&
                   (UId == other.UId && UId != null && other.UId != null && UId.Equals(other.UId)) &&
                   (Equals(Ids, other.Ids) || Ids != null && other.Ids != null && Ids.SequenceEqual(other.Ids)) &&
                   (Equals(CustomData, other.CustomData) || CustomData != null && other.CustomData != null && CustomData.SequenceEqual(other.CustomData)) &&
                   (Meta == other.Meta && Meta != null && other.Meta != null && Meta.Equals(other.Meta)) &&
                   (Equals(MetaArray, other.MetaArray) || MetaArray != null && other.MetaArray != null && MetaArray.SequenceEqual(other.MetaArray)) &&
                   (HoverLabel == other.HoverLabel && HoverLabel != null && other.HoverLabel != null && HoverLabel.Equals(other.HoverLabel)) &&
                   (Stream == other.Stream && Stream != null && other.Stream != null && Stream.Equals(other.Stream)) &&
                   (Equals(Transforms, other.Transforms) || Transforms != null && other.Transforms != null && Transforms.SequenceEqual(other.Transforms)) &&
                   (UiRevision == other.UiRevision && UiRevision != null && other.UiRevision != null && UiRevision.Equals(other.UiRevision)) &&
                   (Equals(Labels, other.Labels) || Labels != null && other.Labels != null && Labels.SequenceEqual(other.Labels)) &&
                   (Label0 == other.Label0 && Label0 != null && other.Label0 != null && Label0.Equals(other.Label0)) &&
                   (DLabel == other.DLabel && DLabel != null && other.DLabel != null && DLabel.Equals(other.DLabel)) &&
                   (Equals(Values, other.Values) || Values != null && other.Values != null && Values.SequenceEqual(other.Values)) &&
                   (Marker == other.Marker && Marker != null && other.Marker != null && Marker.Equals(other.Marker)) &&
                   (Equals(Text, other.Text) || Text != null && other.Text != null && Text.SequenceEqual(other.Text)) &&
                   (HoverText == other.HoverText && HoverText != null && other.HoverText != null && HoverText.Equals(other.HoverText)) &&
                   (Equals(HoverTextArray, other.HoverTextArray) || HoverTextArray != null && other.HoverTextArray != null && HoverTextArray.SequenceEqual(other.HoverTextArray)) &&
                   (ScaleGroup == other.ScaleGroup && ScaleGroup != null && other.ScaleGroup != null && ScaleGroup.Equals(other.ScaleGroup)) &&
                   (TextInfo == other.TextInfo && TextInfo != null && other.TextInfo != null && TextInfo.Equals(other.TextInfo)) &&
                   (TextTemplate == other.TextTemplate && TextTemplate != null && other.TextTemplate != null && TextTemplate.Equals(other.TextTemplate)) &&
                   (Equals(TextTemplateArray, other.TextTemplateArray) || TextTemplateArray != null && other.TextTemplateArray != null && TextTemplateArray.SequenceEqual(other.TextTemplateArray)) &&
                   (HoverInfo == other.HoverInfo && HoverInfo != null && other.HoverInfo != null && HoverInfo.Equals(other.HoverInfo)) &&
                   (Equals(HoverInfoArray, other.HoverInfoArray) || HoverInfoArray != null && other.HoverInfoArray != null && HoverInfoArray.SequenceEqual(other.HoverInfoArray)) &&
                   (HoverTemplate == other.HoverTemplate && HoverTemplate != null && other.HoverTemplate != null && HoverTemplate.Equals(other.HoverTemplate)) &&
                   (Equals(HoverTemplateArray, other.HoverTemplateArray) ||
                    HoverTemplateArray != null && other.HoverTemplateArray != null && HoverTemplateArray.SequenceEqual(other.HoverTemplateArray)) &&
                   (TextPosition == other.TextPosition && TextPosition != null && other.TextPosition != null && TextPosition.Equals(other.TextPosition)) &&
                   (Equals(TextPositionArray, other.TextPositionArray) || TextPositionArray != null && other.TextPositionArray != null && TextPositionArray.SequenceEqual(other.TextPositionArray)) &&
                   (TextFont == other.TextFont && TextFont != null && other.TextFont != null && TextFont.Equals(other.TextFont)) &&
                   (InsideTextFont == other.InsideTextFont && InsideTextFont != null && other.InsideTextFont != null && InsideTextFont.Equals(other.InsideTextFont)) &&
                   (Title == other.Title && Title != null && other.Title != null && Title.Equals(other.Title)) &&
                   (Domain == other.Domain && Domain != null && other.Domain != null && Domain.Equals(other.Domain)) &&
                   (AspectRatio == other.AspectRatio && AspectRatio != null && other.AspectRatio != null && AspectRatio.Equals(other.AspectRatio)) &&
                   (BaseRatio == other.BaseRatio && BaseRatio != null && other.BaseRatio != null && BaseRatio.Equals(other.BaseRatio)) &&
                   (IdsSrc == other.IdsSrc && IdsSrc != null && other.IdsSrc != null && IdsSrc.Equals(other.IdsSrc)) &&
                   (CustomDataSrc == other.CustomDataSrc && CustomDataSrc != null && other.CustomDataSrc != null && CustomDataSrc.Equals(other.CustomDataSrc)) &&
                   (MetaSrc == other.MetaSrc && MetaSrc != null && other.MetaSrc != null && MetaSrc.Equals(other.MetaSrc)) &&
                   (LabelsSrc == other.LabelsSrc && LabelsSrc != null && other.LabelsSrc != null && LabelsSrc.Equals(other.LabelsSrc)) &&
                   (ValuesSrc == other.ValuesSrc && ValuesSrc != null && other.ValuesSrc != null && ValuesSrc.Equals(other.ValuesSrc)) &&
                   (TextSrc == other.TextSrc && TextSrc != null && other.TextSrc != null && TextSrc.Equals(other.TextSrc)) &&
                   (HoverTextSrc == other.HoverTextSrc && HoverTextSrc != null && other.HoverTextSrc != null && HoverTextSrc.Equals(other.HoverTextSrc)) &&
                   (TextTemplateSrc == other.TextTemplateSrc && TextTemplateSrc != null && other.TextTemplateSrc != null && TextTemplateSrc.Equals(other.TextTemplateSrc)) &&
                   (HoverInfoSrc == other.HoverInfoSrc && HoverInfoSrc != null && other.HoverInfoSrc != null && HoverInfoSrc.Equals(other.HoverInfoSrc)) &&
                   (HoverTemplateSrc == other.HoverTemplateSrc && HoverTemplateSrc != null && other.HoverTemplateSrc != null && HoverTemplateSrc.Equals(other.HoverTemplateSrc)) &&
                   (TextPositionSrc == other.TextPositionSrc && TextPositionSrc != null && other.TextPositionSrc != null && TextPositionSrc.Equals(other.TextPositionSrc)));
        }
        /// <summary>
        /// Initializes the new component.
        /// </summary>
        public override void InitializeNewComponent()
        {
            base.InitializeNewComponent();

            CustomData = new CustomData();

            // Static row
            CustomData.DataRowHierarchy = new DataHierarchy();
            CustomData.DataRowHierarchy.DataMembers.Add(new DataMember());

            // Static column
            CustomData.DataColumnHierarchy = new DataHierarchy();
            CustomData.DataColumnHierarchy.DataMembers.Add(new DataMember());

            // Store text in rows
            CustomData.DataRows.Add(new DataRow());
            CustomData.DataRows[0].Add(new DataCell());
            CustomData.DataRows[0][0].Add(NewDataValue("Text", ""));
        }
Esempio n. 24
0
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;

                if (Type != null)
                {
                    hashCode = hashCode * 59 + Type.GetHashCode();
                }

                if (Visible != null)
                {
                    hashCode = hashCode * 59 + Visible.GetHashCode();
                }

                if (ShowLegend != null)
                {
                    hashCode = hashCode * 59 + ShowLegend.GetHashCode();
                }

                if (LegendGroup != null)
                {
                    hashCode = hashCode * 59 + LegendGroup.GetHashCode();
                }

                if (Opacity != null)
                {
                    hashCode = hashCode * 59 + Opacity.GetHashCode();
                }

                if (Name != null)
                {
                    hashCode = hashCode * 59 + Name.GetHashCode();
                }

                if (UId != null)
                {
                    hashCode = hashCode * 59 + UId.GetHashCode();
                }

                if (Ids != null)
                {
                    hashCode = hashCode * 59 + Ids.GetHashCode();
                }

                if (CustomData != null)
                {
                    hashCode = hashCode * 59 + CustomData.GetHashCode();
                }

                if (Meta != null)
                {
                    hashCode = hashCode * 59 + Meta.GetHashCode();
                }

                if (MetaArray != null)
                {
                    hashCode = hashCode * 59 + MetaArray.GetHashCode();
                }

                if (HoverLabel != null)
                {
                    hashCode = hashCode * 59 + HoverLabel.GetHashCode();
                }

                if (Stream != null)
                {
                    hashCode = hashCode * 59 + Stream.GetHashCode();
                }

                if (Transforms != null)
                {
                    hashCode = hashCode * 59 + Transforms.GetHashCode();
                }

                if (UiRevision != null)
                {
                    hashCode = hashCode * 59 + UiRevision.GetHashCode();
                }

                if (Labels != null)
                {
                    hashCode = hashCode * 59 + Labels.GetHashCode();
                }

                if (Label0 != null)
                {
                    hashCode = hashCode * 59 + Label0.GetHashCode();
                }

                if (DLabel != null)
                {
                    hashCode = hashCode * 59 + DLabel.GetHashCode();
                }

                if (Values != null)
                {
                    hashCode = hashCode * 59 + Values.GetHashCode();
                }

                if (Marker != null)
                {
                    hashCode = hashCode * 59 + Marker.GetHashCode();
                }

                if (Text != null)
                {
                    hashCode = hashCode * 59 + Text.GetHashCode();
                }

                if (HoverText != null)
                {
                    hashCode = hashCode * 59 + HoverText.GetHashCode();
                }

                if (HoverTextArray != null)
                {
                    hashCode = hashCode * 59 + HoverTextArray.GetHashCode();
                }

                if (ScaleGroup != null)
                {
                    hashCode = hashCode * 59 + ScaleGroup.GetHashCode();
                }

                if (TextInfo != null)
                {
                    hashCode = hashCode * 59 + TextInfo.GetHashCode();
                }

                if (TextTemplate != null)
                {
                    hashCode = hashCode * 59 + TextTemplate.GetHashCode();
                }

                if (TextTemplateArray != null)
                {
                    hashCode = hashCode * 59 + TextTemplateArray.GetHashCode();
                }

                if (HoverInfo != null)
                {
                    hashCode = hashCode * 59 + HoverInfo.GetHashCode();
                }

                if (HoverInfoArray != null)
                {
                    hashCode = hashCode * 59 + HoverInfoArray.GetHashCode();
                }

                if (HoverTemplate != null)
                {
                    hashCode = hashCode * 59 + HoverTemplate.GetHashCode();
                }

                if (HoverTemplateArray != null)
                {
                    hashCode = hashCode * 59 + HoverTemplateArray.GetHashCode();
                }

                if (TextPosition != null)
                {
                    hashCode = hashCode * 59 + TextPosition.GetHashCode();
                }

                if (TextPositionArray != null)
                {
                    hashCode = hashCode * 59 + TextPositionArray.GetHashCode();
                }

                if (TextFont != null)
                {
                    hashCode = hashCode * 59 + TextFont.GetHashCode();
                }

                if (InsideTextFont != null)
                {
                    hashCode = hashCode * 59 + InsideTextFont.GetHashCode();
                }

                if (Title != null)
                {
                    hashCode = hashCode * 59 + Title.GetHashCode();
                }

                if (Domain != null)
                {
                    hashCode = hashCode * 59 + Domain.GetHashCode();
                }

                if (AspectRatio != null)
                {
                    hashCode = hashCode * 59 + AspectRatio.GetHashCode();
                }

                if (BaseRatio != null)
                {
                    hashCode = hashCode * 59 + BaseRatio.GetHashCode();
                }

                if (IdsSrc != null)
                {
                    hashCode = hashCode * 59 + IdsSrc.GetHashCode();
                }

                if (CustomDataSrc != null)
                {
                    hashCode = hashCode * 59 + CustomDataSrc.GetHashCode();
                }

                if (MetaSrc != null)
                {
                    hashCode = hashCode * 59 + MetaSrc.GetHashCode();
                }

                if (LabelsSrc != null)
                {
                    hashCode = hashCode * 59 + LabelsSrc.GetHashCode();
                }

                if (ValuesSrc != null)
                {
                    hashCode = hashCode * 59 + ValuesSrc.GetHashCode();
                }

                if (TextSrc != null)
                {
                    hashCode = hashCode * 59 + TextSrc.GetHashCode();
                }

                if (HoverTextSrc != null)
                {
                    hashCode = hashCode * 59 + HoverTextSrc.GetHashCode();
                }

                if (TextTemplateSrc != null)
                {
                    hashCode = hashCode * 59 + TextTemplateSrc.GetHashCode();
                }

                if (HoverInfoSrc != null)
                {
                    hashCode = hashCode * 59 + HoverInfoSrc.GetHashCode();
                }

                if (HoverTemplateSrc != null)
                {
                    hashCode = hashCode * 59 + HoverTemplateSrc.GetHashCode();
                }

                if (TextPositionSrc != null)
                {
                    hashCode = hashCode * 59 + TextPositionSrc.GetHashCode();
                }

                return(hashCode);
            }
        }
Esempio n. 25
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (Visible != null)
         {
             hashCode = hashCode * 59 + Visible.GetHashCode();
         }
         if (ShowLegend != null)
         {
             hashCode = hashCode * 59 + ShowLegend.GetHashCode();
         }
         if (LegendGroup != null)
         {
             hashCode = hashCode * 59 + LegendGroup.GetHashCode();
         }
         if (Opacity != null)
         {
             hashCode = hashCode * 59 + Opacity.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (UId != null)
         {
             hashCode = hashCode * 59 + UId.GetHashCode();
         }
         if (Ids != null)
         {
             hashCode = hashCode * 59 + Ids.GetHashCode();
         }
         if (CustomData != null)
         {
             hashCode = hashCode * 59 + CustomData.GetHashCode();
         }
         if (Meta != null)
         {
             hashCode = hashCode * 59 + Meta.GetHashCode();
         }
         if (MetaArray != null)
         {
             hashCode = hashCode * 59 + MetaArray.GetHashCode();
         }
         if (HoverInfo != null)
         {
             hashCode = hashCode * 59 + HoverInfo.GetHashCode();
         }
         if (HoverInfoArray != null)
         {
             hashCode = hashCode * 59 + HoverInfoArray.GetHashCode();
         }
         if (HoverLabel != null)
         {
             hashCode = hashCode * 59 + HoverLabel.GetHashCode();
         }
         if (Stream != null)
         {
             hashCode = hashCode * 59 + Stream.GetHashCode();
         }
         if (Transforms != null)
         {
             hashCode = hashCode * 59 + Transforms.GetHashCode();
         }
         if (UiRevision != null)
         {
             hashCode = hashCode * 59 + UiRevision.GetHashCode();
         }
         if (X != null)
         {
             hashCode = hashCode * 59 + X.GetHashCode();
         }
         if (Y != null)
         {
             hashCode = hashCode * 59 + Y.GetHashCode();
         }
         if (Z != null)
         {
             hashCode = hashCode * 59 + Z.GetHashCode();
         }
         if (Marker != null)
         {
             hashCode = hashCode * 59 + Marker.GetHashCode();
         }
         if (HistNorm != null)
         {
             hashCode = hashCode * 59 + HistNorm.GetHashCode();
         }
         if (HistFunc != null)
         {
             hashCode = hashCode * 59 + HistFunc.GetHashCode();
         }
         if (NBinsX != null)
         {
             hashCode = hashCode * 59 + NBinsX.GetHashCode();
         }
         if (XBins != null)
         {
             hashCode = hashCode * 59 + XBins.GetHashCode();
         }
         if (NBinsY != null)
         {
             hashCode = hashCode * 59 + NBinsY.GetHashCode();
         }
         if (YBins != null)
         {
             hashCode = hashCode * 59 + YBins.GetHashCode();
         }
         if (AutoBinX != null)
         {
             hashCode = hashCode * 59 + AutoBinX.GetHashCode();
         }
         if (AutoBinY != null)
         {
             hashCode = hashCode * 59 + AutoBinY.GetHashCode();
         }
         if (BinGroup != null)
         {
             hashCode = hashCode * 59 + BinGroup.GetHashCode();
         }
         if (XBinGroup != null)
         {
             hashCode = hashCode * 59 + XBinGroup.GetHashCode();
         }
         if (YBinGroup != null)
         {
             hashCode = hashCode * 59 + YBinGroup.GetHashCode();
         }
         if (AutoContour != null)
         {
             hashCode = hashCode * 59 + AutoContour.GetHashCode();
         }
         if (NContours != null)
         {
             hashCode = hashCode * 59 + NContours.GetHashCode();
         }
         if (Contours != null)
         {
             hashCode = hashCode * 59 + Contours.GetHashCode();
         }
         if (Line != null)
         {
             hashCode = hashCode * 59 + Line.GetHashCode();
         }
         if (ZHoverFormat != null)
         {
             hashCode = hashCode * 59 + ZHoverFormat.GetHashCode();
         }
         if (HoverTemplate != null)
         {
             hashCode = hashCode * 59 + HoverTemplate.GetHashCode();
         }
         if (HoverTemplateArray != null)
         {
             hashCode = hashCode * 59 + HoverTemplateArray.GetHashCode();
         }
         if (ZAuto != null)
         {
             hashCode = hashCode * 59 + ZAuto.GetHashCode();
         }
         if (ZMin != null)
         {
             hashCode = hashCode * 59 + ZMin.GetHashCode();
         }
         if (ZMax != null)
         {
             hashCode = hashCode * 59 + ZMax.GetHashCode();
         }
         if (ZMid != null)
         {
             hashCode = hashCode * 59 + ZMid.GetHashCode();
         }
         if (ColorScale != null)
         {
             hashCode = hashCode * 59 + ColorScale.GetHashCode();
         }
         if (AutoColorScale != null)
         {
             hashCode = hashCode * 59 + AutoColorScale.GetHashCode();
         }
         if (ReverseScale != null)
         {
             hashCode = hashCode * 59 + ReverseScale.GetHashCode();
         }
         if (ShowScale != null)
         {
             hashCode = hashCode * 59 + ShowScale.GetHashCode();
         }
         if (ColorBar != null)
         {
             hashCode = hashCode * 59 + ColorBar.GetHashCode();
         }
         if (ColorAxis != null)
         {
             hashCode = hashCode * 59 + ColorAxis.GetHashCode();
         }
         if (XCalendar != null)
         {
             hashCode = hashCode * 59 + XCalendar.GetHashCode();
         }
         if (YCalendar != null)
         {
             hashCode = hashCode * 59 + YCalendar.GetHashCode();
         }
         if (XAxis != null)
         {
             hashCode = hashCode * 59 + XAxis.GetHashCode();
         }
         if (YAxis != null)
         {
             hashCode = hashCode * 59 + YAxis.GetHashCode();
         }
         if (IdsSrc != null)
         {
             hashCode = hashCode * 59 + IdsSrc.GetHashCode();
         }
         if (CustomDataSrc != null)
         {
             hashCode = hashCode * 59 + CustomDataSrc.GetHashCode();
         }
         if (MetaSrc != null)
         {
             hashCode = hashCode * 59 + MetaSrc.GetHashCode();
         }
         if (HoverInfoSrc != null)
         {
             hashCode = hashCode * 59 + HoverInfoSrc.GetHashCode();
         }
         if (XSrc != null)
         {
             hashCode = hashCode * 59 + XSrc.GetHashCode();
         }
         if (YSrc != null)
         {
             hashCode = hashCode * 59 + YSrc.GetHashCode();
         }
         if (ZSrc != null)
         {
             hashCode = hashCode * 59 + ZSrc.GetHashCode();
         }
         if (HoverTemplateSrc != null)
         {
             hashCode = hashCode * 59 + HoverTemplateSrc.GetHashCode();
         }
         return(hashCode);
     }
 }
Esempio n. 26
0
        public void ApplyEffects(NWCreature user, NWItem item, NWObject target, Location targetLocation, CustomData customData)
        {
            int lootTableID = GetLootTable(targetLocation);

            if (lootTableID <= 0)
            {
                return;
            }

            NWArea area       = _.GetAreaFromLocation(targetLocation);
            var    items      = DataService.Where <LootTableItem>(x => x.LootTableID == lootTableID).OrderByDescending(o => o.Weight);
            string sector     = BaseService.GetSectorOfLocation(targetLocation);
            string sectorName = "Unknown";

            switch (sector)
            {
            case "NW": sectorName = "Northwest"; break;

            case "NE": sectorName = "Northeast"; break;

            case "SW": sectorName = "Southwest"; break;

            case "SE": sectorName = "Southeast"; break;
            }

            user.SendMessage(area.Name + "(" + sectorName + ")");
            user.SendMessage("Scanning results: ");

            foreach (var lti in items)
            {
                string name = ItemService.GetNameByResref(lti.Resref);
                user.SendMessage(name + " [Density: " + lti.Weight + "]");
            }

            DurabilityService.RunItemDecay(user.Object, item, RandomService.RandomFloat(0.02f, 0.08f));
        }
Esempio n. 27
0
        public float Seconds(NWCreature user, NWItem item, NWObject target, Location targetLocation, CustomData customData)
        {
            if (RandomService.Random(100) + 1 <= PerkService.GetCreaturePerkLevel(user.Object, PerkType.SpeedyFirstAid) * 10)
            {
                return(0.1f);
            }

            int   rank    = SkillService.GetPCSkillRank(user.Object, SkillType.Medicine);
            float seconds = 6.0f - (rank * 0.2f);

            if (seconds < 1.0f)
            {
                seconds = 1.0f;
            }
            return(seconds);
        }
Esempio n. 28
0
        public float Seconds(NWCreature user, NWItem item, NWObject target, Location targetLocation, CustomData customData)
        {
            const float BaseScanningTime = 16.0f;
            float       scanningTime     = BaseScanningTime;

            if (user.IsPlayer)
            {
                var player = (user.Object);
                scanningTime = BaseScanningTime - BaseScanningTime * (PerkService.GetCreaturePerkLevel(player, PerkType.SpeedyResourceScanner) * 0.1f);
            }
            return(scanningTime);
        }
Esempio n. 29
0
 public DialogPage()
 {
     Responses  = new List <DialogResponse>();
     Header     = string.Empty;
     CustomData = new CustomData();
 }
Esempio n. 30
0
 /// <summary>
 /// Create a heartbeat request.
 /// </summary>
 /// <param name="CustomData">An optional custom data object to allow to store any kind of customer specific data.</param>
 public HeartbeatRequest(CustomData CustomData = null)
 {
     this.CustomData = CustomData;
 }
Esempio n. 31
0
        public void ApplyEffects(NWCreature user, NWItem modItem, NWObject target, Location targetLocation, CustomData customData)
        {
            NWPlayer player                = (user.Object);
            NWItem   targetItem            = (target.Object);
            ModSlots slots                 = _mod.GetModSlots(targetItem);
            CustomItemPropertyType modType = _mod.GetModType(modItem);
            int modID = modItem.GetLocalInt("RUNE_ID");

            string[] modArgs       = modItem.GetLocalString("RUNE_VALUE").Split(',');
            int      modLevel      = modItem.RecommendedLevel;
            int      levelIncrease = modItem.LevelIncrease;

            var dbMod = _data.Single <Data.Entity.Mod>(x => x.ID == modID && x.IsActive);

            App.ResolveByInterface <IMod>("Mod." + dbMod.Script, mod =>
            {
                mod.Apply(player, targetItem, modArgs);

                string description = mod.Description(player, targetItem, modArgs);
                bool usePrismatic  = false;
                switch (modType)
                {
                case CustomItemPropertyType.RedMod:
                    if (slots.FilledRedSlots < slots.RedSlots)
                    {
                        targetItem.SetLocalInt("MOD_SLOT_RED_" + (slots.FilledRedSlots + 1), modID);
                        targetItem.SetLocalString("MOD_SLOT_RED_DESC_" + (slots.FilledRedSlots + 1), description);
                        player.SendMessage("Mod installed into " + _color.Red("red") + " slot #" + (slots.FilledRedSlots + 1));
                    }
                    else
                    {
                        usePrismatic = true;
                    }
                    break;

                case CustomItemPropertyType.BlueMod:
                    if (slots.FilledBlueSlots < slots.BlueSlots)
                    {
                        targetItem.SetLocalInt("MOD_SLOT_BLUE_" + (slots.FilledBlueSlots + 1), modID);
                        targetItem.SetLocalString("MOD_SLOT_BLUE_DESC_" + (slots.FilledBlueSlots + 1), description);
                        player.SendMessage("Mod installed into " + _color.Blue("blue") + " slot #" + (slots.FilledBlueSlots + 1));
                    }
                    else
                    {
                        usePrismatic = true;
                    }
                    break;

                case CustomItemPropertyType.GreenMod:
                    if (slots.FilledBlueSlots < slots.GreenSlots)
                    {
                        targetItem.SetLocalInt("MOD_SLOT_GREEN_" + (slots.FilledGreenSlots + 1), modID);
                        targetItem.SetLocalString("MOD_SLOT_GREEN_DESC_" + (slots.FilledGreenSlots + 1), description);
                        player.SendMessage("Mod installed into " + _color.Green("green") + " slot #" + (slots.FilledGreenSlots + 1));
                    }
                    else
                    {
                        usePrismatic = true;
                    }
                    break;

                case CustomItemPropertyType.YellowMod:
                    if (slots.FilledBlueSlots < slots.YellowSlots)
                    {
                        targetItem.SetLocalInt("MOD_SLOT_YELLOW_" + (slots.FilledYellowSlots + 1), modID);
                        targetItem.SetLocalString("MOD_SLOT_YELLOW_DESC_" + (slots.FilledYellowSlots + 1), description);
                        player.SendMessage("Mod installed into " + _color.Yellow("yellow") + " slot #" + (slots.FilledYellowSlots + 1));
                    }
                    else
                    {
                        usePrismatic = true;
                    }
                    break;
                }

                if (usePrismatic)
                {
                    string prismaticText = _mod.PrismaticString();
                    targetItem.SetLocalInt("MOD_SLOT_PRISMATIC_" + (slots.FilledPrismaticSlots + 1), modID);
                    targetItem.SetLocalString("MOD_SLOT_PRISMATIC_DESC_" + (slots.FilledPrismaticSlots + 1), description);
                    player.SendMessage("Mod installed into " + prismaticText + " slot #" + (slots.FilledPrismaticSlots + 1));
                }

                targetItem.RecommendedLevel += levelIncrease;
                modItem.Destroy();

                SkillType skillType;
                if (_item.ArmorBaseItemTypes.Contains(targetItem.BaseItemType))
                {
                    skillType = SkillType.Armorsmith;
                }
                else if (_item.WeaponBaseItemTypes.Contains(targetItem.BaseItemType))
                {
                    skillType = SkillType.Weaponsmith;
                }
                else
                {
                    return;
                }

                int rank = _skill.GetPCSkillRank(player, skillType);
                int xp   = (int)_skill.CalculateRegisteredSkillLevelAdjustedXP(400, modLevel, rank);
                _skill.GiveSkillXP(player, skillType, xp);
            });
        }
Esempio n. 32
0
        /// <inheritdoc />
        public bool Equals([AllowNull] Sankey other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                     ) &&
                 (
                     Visible == other.Visible ||
                     Visible != null &&
                     Visible.Equals(other.Visible)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     UId == other.UId ||
                     UId != null &&
                     UId.Equals(other.UId)
                 ) &&
                 (
                     Equals(Ids, other.Ids) ||
                     Ids != null && other.Ids != null &&
                     Ids.SequenceEqual(other.Ids)
                 ) &&
                 (
                     Equals(CustomData, other.CustomData) ||
                     CustomData != null && other.CustomData != null &&
                     CustomData.SequenceEqual(other.CustomData)
                 ) &&
                 (
                     Meta == other.Meta ||
                     Meta != null &&
                     Meta.Equals(other.Meta)
                 ) &&
                 (
                     Equals(MetaArray, other.MetaArray) ||
                     MetaArray != null && other.MetaArray != null &&
                     MetaArray.SequenceEqual(other.MetaArray)
                 ) &&
                 (
                     SelectedPoints == other.SelectedPoints ||
                     SelectedPoints != null &&
                     SelectedPoints.Equals(other.SelectedPoints)
                 ) &&
                 (
                     Stream == other.Stream ||
                     Stream != null &&
                     Stream.Equals(other.Stream)
                 ) &&
                 (
                     UiRevision == other.UiRevision ||
                     UiRevision != null &&
                     UiRevision.Equals(other.UiRevision)
                 ) &&
                 (
                     HoverInfo == other.HoverInfo ||
                     HoverInfo != null &&
                     HoverInfo.Equals(other.HoverInfo)
                 ) &&
                 (
                     HoverLabel == other.HoverLabel ||
                     HoverLabel != null &&
                     HoverLabel.Equals(other.HoverLabel)
                 ) &&
                 (
                     Domain == other.Domain ||
                     Domain != null &&
                     Domain.Equals(other.Domain)
                 ) &&
                 (
                     Orientation == other.Orientation ||
                     Orientation != null &&
                     Orientation.Equals(other.Orientation)
                 ) &&
                 (
                     ValueFormat == other.ValueFormat ||
                     ValueFormat != null &&
                     ValueFormat.Equals(other.ValueFormat)
                 ) &&
                 (
                     ValueSuffix == other.ValueSuffix ||
                     ValueSuffix != null &&
                     ValueSuffix.Equals(other.ValueSuffix)
                 ) &&
                 (
                     Arrangement == other.Arrangement ||
                     Arrangement != null &&
                     Arrangement.Equals(other.Arrangement)
                 ) &&
                 (
                     TextFont == other.TextFont ||
                     TextFont != null &&
                     TextFont.Equals(other.TextFont)
                 ) &&
                 (
                     Node == other.Node ||
                     Node != null &&
                     Node.Equals(other.Node)
                 ) &&
                 (
                     Link == other.Link ||
                     Link != null &&
                     Link.Equals(other.Link)
                 ) &&
                 (
                     IdsSrc == other.IdsSrc ||
                     IdsSrc != null &&
                     IdsSrc.Equals(other.IdsSrc)
                 ) &&
                 (
                     CustomDataSrc == other.CustomDataSrc ||
                     CustomDataSrc != null &&
                     CustomDataSrc.Equals(other.CustomDataSrc)
                 ) &&
                 (
                     MetaSrc == other.MetaSrc ||
                     MetaSrc != null &&
                     MetaSrc.Equals(other.MetaSrc)
                 ));
        }
Esempio n. 33
0
        public void ApplyEffects(NWCreature user, NWItem item, NWObject target, Location targetLocation, CustomData customData)
        {
            NWArea area            = user.Area;
            bool   farmingDisabled = area.GetLocalInt("FARMING_DISABLED") == 1;

            if (farmingDisabled)
            {
                user.SendMessage("You cannot dig a hole in this area.");
                return;
            }

            user.SetLocalObject("SHOVEL_ITEM", item.Object);
            user.SetLocalLocation("SHOVEL_TARGET_LOCATION", targetLocation);
            user.SetLocalObject("SHOVEL_TARGET_OBJECT", target.Object);
            user.ClearAllActions();
            DialogService.StartConversation(user, user, "Shovel");
        }
Esempio n. 34
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (Visible != null)
         {
             hashCode = hashCode * 59 + Visible.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (UId != null)
         {
             hashCode = hashCode * 59 + UId.GetHashCode();
         }
         if (Ids != null)
         {
             hashCode = hashCode * 59 + Ids.GetHashCode();
         }
         if (CustomData != null)
         {
             hashCode = hashCode * 59 + CustomData.GetHashCode();
         }
         if (Meta != null)
         {
             hashCode = hashCode * 59 + Meta.GetHashCode();
         }
         if (MetaArray != null)
         {
             hashCode = hashCode * 59 + MetaArray.GetHashCode();
         }
         if (SelectedPoints != null)
         {
             hashCode = hashCode * 59 + SelectedPoints.GetHashCode();
         }
         if (Stream != null)
         {
             hashCode = hashCode * 59 + Stream.GetHashCode();
         }
         if (UiRevision != null)
         {
             hashCode = hashCode * 59 + UiRevision.GetHashCode();
         }
         if (HoverInfo != null)
         {
             hashCode = hashCode * 59 + HoverInfo.GetHashCode();
         }
         if (HoverLabel != null)
         {
             hashCode = hashCode * 59 + HoverLabel.GetHashCode();
         }
         if (Domain != null)
         {
             hashCode = hashCode * 59 + Domain.GetHashCode();
         }
         if (Orientation != null)
         {
             hashCode = hashCode * 59 + Orientation.GetHashCode();
         }
         if (ValueFormat != null)
         {
             hashCode = hashCode * 59 + ValueFormat.GetHashCode();
         }
         if (ValueSuffix != null)
         {
             hashCode = hashCode * 59 + ValueSuffix.GetHashCode();
         }
         if (Arrangement != null)
         {
             hashCode = hashCode * 59 + Arrangement.GetHashCode();
         }
         if (TextFont != null)
         {
             hashCode = hashCode * 59 + TextFont.GetHashCode();
         }
         if (Node != null)
         {
             hashCode = hashCode * 59 + Node.GetHashCode();
         }
         if (Link != null)
         {
             hashCode = hashCode * 59 + Link.GetHashCode();
         }
         if (IdsSrc != null)
         {
             hashCode = hashCode * 59 + IdsSrc.GetHashCode();
         }
         if (CustomDataSrc != null)
         {
             hashCode = hashCode * 59 + CustomDataSrc.GetHashCode();
         }
         if (MetaSrc != null)
         {
             hashCode = hashCode * 59 + MetaSrc.GetHashCode();
         }
         return(hashCode);
     }
 }
Esempio n. 35
0
 public bool ReducesItemCharge(NWCreature user, NWItem item, NWObject target, Location targetLocation, CustomData customData)
 {
     return(false);
 }
Esempio n. 36
0
        /// <inheritdoc />
        public bool Equals([AllowNull] ParCoords other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                     ) &&
                 (
                     Visible == other.Visible ||
                     Visible != null &&
                     Visible.Equals(other.Visible)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     UId == other.UId ||
                     UId != null &&
                     UId.Equals(other.UId)
                 ) &&
                 (
                     Equals(Ids, other.Ids) ||
                     Ids != null && other.Ids != null &&
                     Ids.SequenceEqual(other.Ids)
                 ) &&
                 (
                     Equals(CustomData, other.CustomData) ||
                     CustomData != null && other.CustomData != null &&
                     CustomData.SequenceEqual(other.CustomData)
                 ) &&
                 (
                     Meta == other.Meta ||
                     Meta != null &&
                     Meta.Equals(other.Meta)
                 ) &&
                 (
                     Equals(MetaArray, other.MetaArray) ||
                     MetaArray != null && other.MetaArray != null &&
                     MetaArray.SequenceEqual(other.MetaArray)
                 ) &&
                 (
                     Stream == other.Stream ||
                     Stream != null &&
                     Stream.Equals(other.Stream)
                 ) &&
                 (
                     Equals(Transforms, other.Transforms) ||
                     Transforms != null && other.Transforms != null &&
                     Transforms.SequenceEqual(other.Transforms)
                 ) &&
                 (
                     UiRevision == other.UiRevision ||
                     UiRevision != null &&
                     UiRevision.Equals(other.UiRevision)
                 ) &&
                 (
                     Domain == other.Domain ||
                     Domain != null &&
                     Domain.Equals(other.Domain)
                 ) &&
                 (
                     LabelAngle == other.LabelAngle ||
                     LabelAngle != null &&
                     LabelAngle.Equals(other.LabelAngle)
                 ) &&
                 (
                     LabelSide == other.LabelSide ||
                     LabelSide != null &&
                     LabelSide.Equals(other.LabelSide)
                 ) &&
                 (
                     LabelFont == other.LabelFont ||
                     LabelFont != null &&
                     LabelFont.Equals(other.LabelFont)
                 ) &&
                 (
                     TickFont == other.TickFont ||
                     TickFont != null &&
                     TickFont.Equals(other.TickFont)
                 ) &&
                 (
                     RangeFont == other.RangeFont ||
                     RangeFont != null &&
                     RangeFont.Equals(other.RangeFont)
                 ) &&
                 (
                     Equals(Dimensions, other.Dimensions) ||
                     Dimensions != null && other.Dimensions != null &&
                     Dimensions.SequenceEqual(other.Dimensions)
                 ) &&
                 (
                     Line == other.Line ||
                     Line != null &&
                     Line.Equals(other.Line)
                 ) &&
                 (
                     IdsSrc == other.IdsSrc ||
                     IdsSrc != null &&
                     IdsSrc.Equals(other.IdsSrc)
                 ) &&
                 (
                     CustomDataSrc == other.CustomDataSrc ||
                     CustomDataSrc != null &&
                     CustomDataSrc.Equals(other.CustomDataSrc)
                 ) &&
                 (
                     MetaSrc == other.MetaSrc ||
                     MetaSrc != null &&
                     MetaSrc.Equals(other.MetaSrc)
                 ));
        }
Esempio n. 37
0
        /// <inheritdoc />
        public bool Equals([AllowNull] ContourCarpet other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                     ) &&
                 (
                     Visible == other.Visible ||
                     Visible != null &&
                     Visible.Equals(other.Visible)
                 ) &&
                 (
                     ShowLegend == other.ShowLegend ||
                     ShowLegend != null &&
                     ShowLegend.Equals(other.ShowLegend)
                 ) &&
                 (
                     LegendGroup == other.LegendGroup ||
                     LegendGroup != null &&
                     LegendGroup.Equals(other.LegendGroup)
                 ) &&
                 (
                     Opacity == other.Opacity ||
                     Opacity != null &&
                     Opacity.Equals(other.Opacity)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     UId == other.UId ||
                     UId != null &&
                     UId.Equals(other.UId)
                 ) &&
                 (
                     Equals(Ids, other.Ids) ||
                     Ids != null && other.Ids != null &&
                     Ids.SequenceEqual(other.Ids)
                 ) &&
                 (
                     Equals(CustomData, other.CustomData) ||
                     CustomData != null && other.CustomData != null &&
                     CustomData.SequenceEqual(other.CustomData)
                 ) &&
                 (
                     Meta == other.Meta ||
                     Meta != null &&
                     Meta.Equals(other.Meta)
                 ) &&
                 (
                     Equals(MetaArray, other.MetaArray) ||
                     MetaArray != null && other.MetaArray != null &&
                     MetaArray.SequenceEqual(other.MetaArray)
                 ) &&
                 (
                     Stream == other.Stream ||
                     Stream != null &&
                     Stream.Equals(other.Stream)
                 ) &&
                 (
                     UiRevision == other.UiRevision ||
                     UiRevision != null &&
                     UiRevision.Equals(other.UiRevision)
                 ) &&
                 (
                     Carpet == other.Carpet ||
                     Carpet != null &&
                     Carpet.Equals(other.Carpet)
                 ) &&
                 (
                     Equals(Z, other.Z) ||
                     Z != null && other.Z != null &&
                     Z.SequenceEqual(other.Z)
                 ) &&
                 (
                     Equals(A, other.A) ||
                     A != null && other.A != null &&
                     A.SequenceEqual(other.A)
                 ) &&
                 (
                     A0 == other.A0 ||
                     A0 != null &&
                     A0.Equals(other.A0)
                 ) &&
                 (
                     DA == other.DA ||
                     DA != null &&
                     DA.Equals(other.DA)
                 ) &&
                 (
                     Equals(B, other.B) ||
                     B != null && other.B != null &&
                     B.SequenceEqual(other.B)
                 ) &&
                 (
                     B0 == other.B0 ||
                     B0 != null &&
                     B0.Equals(other.B0)
                 ) &&
                 (
                     Db == other.Db ||
                     Db != null &&
                     Db.Equals(other.Db)
                 ) &&
                 (
                     Equals(Text, other.Text) ||
                     Text != null && other.Text != null &&
                     Text.SequenceEqual(other.Text)
                 ) &&
                 (
                     Equals(HoverText, other.HoverText) ||
                     HoverText != null && other.HoverText != null &&
                     HoverText.SequenceEqual(other.HoverText)
                 ) &&
                 (
                     Transpose == other.Transpose ||
                     Transpose != null &&
                     Transpose.Equals(other.Transpose)
                 ) &&
                 (
                     AType == other.AType ||
                     AType != null &&
                     AType.Equals(other.AType)
                 ) &&
                 (
                     BType == other.BType ||
                     BType != null &&
                     BType.Equals(other.BType)
                 ) &&
                 (
                     FillColor == other.FillColor ||
                     FillColor != null &&
                     FillColor.Equals(other.FillColor)
                 ) &&
                 (
                     AutoContour == other.AutoContour ||
                     AutoContour != null &&
                     AutoContour.Equals(other.AutoContour)
                 ) &&
                 (
                     NContours == other.NContours ||
                     NContours != null &&
                     NContours.Equals(other.NContours)
                 ) &&
                 (
                     Contours == other.Contours ||
                     Contours != null &&
                     Contours.Equals(other.Contours)
                 ) &&
                 (
                     Line == other.Line ||
                     Line != null &&
                     Line.Equals(other.Line)
                 ) &&
                 (
                     ZAuto == other.ZAuto ||
                     ZAuto != null &&
                     ZAuto.Equals(other.ZAuto)
                 ) &&
                 (
                     ZMin == other.ZMin ||
                     ZMin != null &&
                     ZMin.Equals(other.ZMin)
                 ) &&
                 (
                     ZMax == other.ZMax ||
                     ZMax != null &&
                     ZMax.Equals(other.ZMax)
                 ) &&
                 (
                     ZMid == other.ZMid ||
                     ZMid != null &&
                     ZMid.Equals(other.ZMid)
                 ) &&
                 (
                     ColorScale == other.ColorScale ||
                     ColorScale != null &&
                     ColorScale.Equals(other.ColorScale)
                 ) &&
                 (
                     AutoColorScale == other.AutoColorScale ||
                     AutoColorScale != null &&
                     AutoColorScale.Equals(other.AutoColorScale)
                 ) &&
                 (
                     ReverseScale == other.ReverseScale ||
                     ReverseScale != null &&
                     ReverseScale.Equals(other.ReverseScale)
                 ) &&
                 (
                     ShowScale == other.ShowScale ||
                     ShowScale != null &&
                     ShowScale.Equals(other.ShowScale)
                 ) &&
                 (
                     ColorBar == other.ColorBar ||
                     ColorBar != null &&
                     ColorBar.Equals(other.ColorBar)
                 ) &&
                 (
                     ColorAxis == other.ColorAxis ||
                     ColorAxis != null &&
                     ColorAxis.Equals(other.ColorAxis)
                 ) &&
                 (
                     XAxis == other.XAxis ||
                     XAxis != null &&
                     XAxis.Equals(other.XAxis)
                 ) &&
                 (
                     YAxis == other.YAxis ||
                     YAxis != null &&
                     YAxis.Equals(other.YAxis)
                 ) &&
                 (
                     IdsSrc == other.IdsSrc ||
                     IdsSrc != null &&
                     IdsSrc.Equals(other.IdsSrc)
                 ) &&
                 (
                     CustomDataSrc == other.CustomDataSrc ||
                     CustomDataSrc != null &&
                     CustomDataSrc.Equals(other.CustomDataSrc)
                 ) &&
                 (
                     MetaSrc == other.MetaSrc ||
                     MetaSrc != null &&
                     MetaSrc.Equals(other.MetaSrc)
                 ) &&
                 (
                     ZSrc == other.ZSrc ||
                     ZSrc != null &&
                     ZSrc.Equals(other.ZSrc)
                 ) &&
                 (
                     ASrc == other.ASrc ||
                     ASrc != null &&
                     ASrc.Equals(other.ASrc)
                 ) &&
                 (
                     BSrc == other.BSrc ||
                     BSrc != null &&
                     BSrc.Equals(other.BSrc)
                 ) &&
                 (
                     TextSrc == other.TextSrc ||
                     TextSrc != null &&
                     TextSrc.Equals(other.TextSrc)
                 ) &&
                 (
                     HoverTextSrc == other.HoverTextSrc ||
                     HoverTextSrc != null &&
                     HoverTextSrc.Equals(other.HoverTextSrc)
                 ));
        }
Esempio n. 38
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (Visible != null)
         {
             hashCode = hashCode * 59 + Visible.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (UId != null)
         {
             hashCode = hashCode * 59 + UId.GetHashCode();
         }
         if (Ids != null)
         {
             hashCode = hashCode * 59 + Ids.GetHashCode();
         }
         if (CustomData != null)
         {
             hashCode = hashCode * 59 + CustomData.GetHashCode();
         }
         if (Meta != null)
         {
             hashCode = hashCode * 59 + Meta.GetHashCode();
         }
         if (MetaArray != null)
         {
             hashCode = hashCode * 59 + MetaArray.GetHashCode();
         }
         if (Stream != null)
         {
             hashCode = hashCode * 59 + Stream.GetHashCode();
         }
         if (Transforms != null)
         {
             hashCode = hashCode * 59 + Transforms.GetHashCode();
         }
         if (UiRevision != null)
         {
             hashCode = hashCode * 59 + UiRevision.GetHashCode();
         }
         if (Domain != null)
         {
             hashCode = hashCode * 59 + Domain.GetHashCode();
         }
         if (LabelAngle != null)
         {
             hashCode = hashCode * 59 + LabelAngle.GetHashCode();
         }
         if (LabelSide != null)
         {
             hashCode = hashCode * 59 + LabelSide.GetHashCode();
         }
         if (LabelFont != null)
         {
             hashCode = hashCode * 59 + LabelFont.GetHashCode();
         }
         if (TickFont != null)
         {
             hashCode = hashCode * 59 + TickFont.GetHashCode();
         }
         if (RangeFont != null)
         {
             hashCode = hashCode * 59 + RangeFont.GetHashCode();
         }
         if (Dimensions != null)
         {
             hashCode = hashCode * 59 + Dimensions.GetHashCode();
         }
         if (Line != null)
         {
             hashCode = hashCode * 59 + Line.GetHashCode();
         }
         if (IdsSrc != null)
         {
             hashCode = hashCode * 59 + IdsSrc.GetHashCode();
         }
         if (CustomDataSrc != null)
         {
             hashCode = hashCode * 59 + CustomDataSrc.GetHashCode();
         }
         if (MetaSrc != null)
         {
             hashCode = hashCode * 59 + MetaSrc.GetHashCode();
         }
         return(hashCode);
     }
 }
Esempio n. 39
0
        /// <inheritdoc />
        public bool Equals([AllowNull] ScatterPolarGl other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                     ) &&
                 (
                     Visible == other.Visible ||
                     Visible != null &&
                     Visible.Equals(other.Visible)
                 ) &&
                 (
                     ShowLegend == other.ShowLegend ||
                     ShowLegend != null &&
                     ShowLegend.Equals(other.ShowLegend)
                 ) &&
                 (
                     LegendGroup == other.LegendGroup ||
                     LegendGroup != null &&
                     LegendGroup.Equals(other.LegendGroup)
                 ) &&
                 (
                     Opacity == other.Opacity ||
                     Opacity != null &&
                     Opacity.Equals(other.Opacity)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     UId == other.UId ||
                     UId != null &&
                     UId.Equals(other.UId)
                 ) &&
                 (
                     Equals(Ids, other.Ids) ||
                     Ids != null && other.Ids != null &&
                     Ids.SequenceEqual(other.Ids)
                 ) &&
                 (
                     Equals(CustomData, other.CustomData) ||
                     CustomData != null && other.CustomData != null &&
                     CustomData.SequenceEqual(other.CustomData)
                 ) &&
                 (
                     Meta == other.Meta ||
                     Meta != null &&
                     Meta.Equals(other.Meta)
                 ) &&
                 (
                     Equals(MetaArray, other.MetaArray) ||
                     MetaArray != null && other.MetaArray != null &&
                     MetaArray.SequenceEqual(other.MetaArray)
                 ) &&
                 (
                     SelectedPoints == other.SelectedPoints ||
                     SelectedPoints != null &&
                     SelectedPoints.Equals(other.SelectedPoints)
                 ) &&
                 (
                     HoverLabel == other.HoverLabel ||
                     HoverLabel != null &&
                     HoverLabel.Equals(other.HoverLabel)
                 ) &&
                 (
                     Stream == other.Stream ||
                     Stream != null &&
                     Stream.Equals(other.Stream)
                 ) &&
                 (
                     Equals(Transforms, other.Transforms) ||
                     Transforms != null && other.Transforms != null &&
                     Transforms.SequenceEqual(other.Transforms)
                 ) &&
                 (
                     UiRevision == other.UiRevision ||
                     UiRevision != null &&
                     UiRevision.Equals(other.UiRevision)
                 ) &&
                 (
                     Mode == other.Mode ||
                     Mode != null &&
                     Mode.Equals(other.Mode)
                 ) &&
                 (
                     Equals(R, other.R) ||
                     R != null && other.R != null &&
                     R.SequenceEqual(other.R)
                 ) &&
                 (
                     Equals(Theta, other.Theta) ||
                     Theta != null && other.Theta != null &&
                     Theta.SequenceEqual(other.Theta)
                 ) &&
                 (
                     R0 == other.R0 ||
                     R0 != null &&
                     R0.Equals(other.R0)
                 ) &&
                 (
                     Dr == other.Dr ||
                     Dr != null &&
                     Dr.Equals(other.Dr)
                 ) &&
                 (
                     Theta0 == other.Theta0 ||
                     Theta0 != null &&
                     Theta0.Equals(other.Theta0)
                 ) &&
                 (
                     DTheta == other.DTheta ||
                     DTheta != null &&
                     DTheta.Equals(other.DTheta)
                 ) &&
                 (
                     ThetaUnit == other.ThetaUnit ||
                     ThetaUnit != null &&
                     ThetaUnit.Equals(other.ThetaUnit)
                 ) &&
                 (
                     Text == other.Text ||
                     Text != null &&
                     Text.Equals(other.Text)
                 ) &&
                 (
                     Equals(TextArray, other.TextArray) ||
                     TextArray != null && other.TextArray != null &&
                     TextArray.SequenceEqual(other.TextArray)
                 ) &&
                 (
                     TextTemplate == other.TextTemplate ||
                     TextTemplate != null &&
                     TextTemplate.Equals(other.TextTemplate)
                 ) &&
                 (
                     Equals(TextTemplateArray, other.TextTemplateArray) ||
                     TextTemplateArray != null && other.TextTemplateArray != null &&
                     TextTemplateArray.SequenceEqual(other.TextTemplateArray)
                 ) &&
                 (
                     HoverText == other.HoverText ||
                     HoverText != null &&
                     HoverText.Equals(other.HoverText)
                 ) &&
                 (
                     Equals(HoverTextArray, other.HoverTextArray) ||
                     HoverTextArray != null && other.HoverTextArray != null &&
                     HoverTextArray.SequenceEqual(other.HoverTextArray)
                 ) &&
                 (
                     HoverTemplate == other.HoverTemplate ||
                     HoverTemplate != null &&
                     HoverTemplate.Equals(other.HoverTemplate)
                 ) &&
                 (
                     Equals(HoverTemplateArray, other.HoverTemplateArray) ||
                     HoverTemplateArray != null && other.HoverTemplateArray != null &&
                     HoverTemplateArray.SequenceEqual(other.HoverTemplateArray)
                 ) &&
                 (
                     Line == other.Line ||
                     Line != null &&
                     Line.Equals(other.Line)
                 ) &&
                 (
                     ConnectGaps == other.ConnectGaps ||
                     ConnectGaps != null &&
                     ConnectGaps.Equals(other.ConnectGaps)
                 ) &&
                 (
                     Marker == other.Marker ||
                     Marker != null &&
                     Marker.Equals(other.Marker)
                 ) &&
                 (
                     Fill == other.Fill ||
                     Fill != null &&
                     Fill.Equals(other.Fill)
                 ) &&
                 (
                     FillColor == other.FillColor ||
                     FillColor != null &&
                     FillColor.Equals(other.FillColor)
                 ) &&
                 (
                     TextPosition == other.TextPosition ||
                     TextPosition != null &&
                     TextPosition.Equals(other.TextPosition)
                 ) &&
                 (
                     Equals(TextPositionArray, other.TextPositionArray) ||
                     TextPositionArray != null && other.TextPositionArray != null &&
                     TextPositionArray.SequenceEqual(other.TextPositionArray)
                 ) &&
                 (
                     TextFont == other.TextFont ||
                     TextFont != null &&
                     TextFont.Equals(other.TextFont)
                 ) &&
                 (
                     HoverInfo == other.HoverInfo ||
                     HoverInfo != null &&
                     HoverInfo.Equals(other.HoverInfo)
                 ) &&
                 (
                     Equals(HoverInfoArray, other.HoverInfoArray) ||
                     HoverInfoArray != null && other.HoverInfoArray != null &&
                     HoverInfoArray.SequenceEqual(other.HoverInfoArray)
                 ) &&
                 (
                     Selected == other.Selected ||
                     Selected != null &&
                     Selected.Equals(other.Selected)
                 ) &&
                 (
                     Unselected == other.Unselected ||
                     Unselected != null &&
                     Unselected.Equals(other.Unselected)
                 ) &&
                 (
                     Subplot == other.Subplot ||
                     Subplot != null &&
                     Subplot.Equals(other.Subplot)
                 ) &&
                 (
                     IdsSrc == other.IdsSrc ||
                     IdsSrc != null &&
                     IdsSrc.Equals(other.IdsSrc)
                 ) &&
                 (
                     CustomDataSrc == other.CustomDataSrc ||
                     CustomDataSrc != null &&
                     CustomDataSrc.Equals(other.CustomDataSrc)
                 ) &&
                 (
                     MetaSrc == other.MetaSrc ||
                     MetaSrc != null &&
                     MetaSrc.Equals(other.MetaSrc)
                 ) &&
                 (
                     RSrc == other.RSrc ||
                     RSrc != null &&
                     RSrc.Equals(other.RSrc)
                 ) &&
                 (
                     ThetaSrc == other.ThetaSrc ||
                     ThetaSrc != null &&
                     ThetaSrc.Equals(other.ThetaSrc)
                 ) &&
                 (
                     TextSrc == other.TextSrc ||
                     TextSrc != null &&
                     TextSrc.Equals(other.TextSrc)
                 ) &&
                 (
                     TextTemplateSrc == other.TextTemplateSrc ||
                     TextTemplateSrc != null &&
                     TextTemplateSrc.Equals(other.TextTemplateSrc)
                 ) &&
                 (
                     HoverTextSrc == other.HoverTextSrc ||
                     HoverTextSrc != null &&
                     HoverTextSrc.Equals(other.HoverTextSrc)
                 ) &&
                 (
                     HoverTemplateSrc == other.HoverTemplateSrc ||
                     HoverTemplateSrc != null &&
                     HoverTemplateSrc.Equals(other.HoverTemplateSrc)
                 ) &&
                 (
                     TextPositionSrc == other.TextPositionSrc ||
                     TextPositionSrc != null &&
                     TextPositionSrc.Equals(other.TextPositionSrc)
                 ) &&
                 (
                     HoverInfoSrc == other.HoverInfoSrc ||
                     HoverInfoSrc != null &&
                     HoverInfoSrc.Equals(other.HoverInfoSrc)
                 ));
        }
Esempio n. 40
0
        public CalcResult Compute()
        {
            CalcResult res = new CalcResult();

            try
            {
                // INITIALIZATION OF STUFF
                Lexer         lexer         = new Lexer(rawExpression);
                TokenList     tokenList     = lexer.GenerateTokens();
                Parser        parser        = new Parser(tokenList);
                PostTokenList postTokenList = parser.Parse();
                postTokenList.Freeze();
                MathPreprocessor mathPreprocessor = new MathPreprocessor(postTokenList);
                mathPreprocessor.Process();
                MajorSegmentList         majorSegmentList   = mathPreprocessor.GetSegments();
                List <ExpressionSegment> expressionSegments = new List <ExpressionSegment>();
                expressionSegments.Add(
                    (ExpressionSegment)majorSegmentList.Select("expression").Item()
                    );

                // PROCESSING SOME `WHERE` AND `FOR` TOKENS
                for (int i = majorSegmentList.Count - 1; i >= 0; i--)
                {
                    if (majorSegmentList[i] is ExpressionSegment)
                    {
                        break;
                    }
                    if (majorSegmentList[i] is EqKeyword
                        &&
                        (((EqKeyword)majorSegmentList[i]).Type == Keyword.Type.WHERE ||
                         ((EqKeyword)majorSegmentList[i]).Type == Keyword.Type.FOR)
                        &&
                        FixedKeyword.IsVariable(((EqKeyword)majorSegmentList[i]).GetBeforeEq())
                        &&
                        (CustomData.GetType(((EqKeyword)majorSegmentList[i]).GetAfterEq()) == CustomData.Type.FIXED))
                    {
                        string v    = ((EqKeyword)majorSegmentList[i]).GetBeforeEq();
                        string expr = ((EqKeyword)majorSegmentList[i]).GetAfterEq();
                        expressionSegments[0].Substitute(v, expr);
                    }
                    else
                    {
                        majorSegmentList[i].Ignored = true;
                    }
                }

                MajorSegmentList newExpression = majorSegmentList.CutTill(expressionSegments[0]);
                res.InterpretedAs.Add(expressionSegments[0].Build());
                List <MajorSegmentList> list = DivideByField(newExpression);
                var simplOpt = new MajorSegmentList();
                simplOpt.Add(new FieldSegment("simplify", "", Field.Type.SIMPLIFICATION));
                list.Insert(0, simplOpt);

                // SEQUENTIAL PROCESSING
                list.Reverse();
                foreach (var fieldOpts in list)
                {
                    bool isLast = fieldOpts == list[list.Count - 1];

                    // PROCESSING SOME `WHERE` AND `FOR` TOKENS
                    foreach (var expressionSegment in expressionSegments)
                    {
                        for (int i = 1; i < fieldOpts.Count; i++)
                        {
                            if (fieldOpts[i] is EqKeyword &&
                                ((fieldOpts[i] as EqKeyword).Type == Keyword.Type.WHERE ||
                                 (fieldOpts[i] as EqKeyword).Type == Keyword.Type.FOR) &&
                                CustomData.GetType((fieldOpts[i] as EqKeyword).GetAfterEq()) == CustomData.Type.FIXED &&
                                CustomData.GetType((fieldOpts[i] as EqKeyword).GetBeforeEq()) == CustomData.Type.FIXED &&
                                FixedKeyword.IsVariable((fieldOpts[i] as EqKeyword).GetBeforeEq()))
                            {
                                expressionSegment.Substitute((fieldOpts[i] as EqKeyword).GetBeforeEq(), (fieldOpts[i] as EqKeyword).GetAfterEq());
                            }
                        }
                        res.InterpretedAs.Add(fieldOpts.Build() + " " + expressionSegment.Build());
                    }

                    var fieldType = FindField(fieldOpts[0].Keyname);

                    List <string> newExprs      = new List <string>();
                    List <string> newLatexExprs = new List <string>();
                    bool          quickExit     = false;
                    foreach (var expressionSegment in expressionSegments)
                    {
                        if (fieldType == FieldType.BOOL)
                        {
                            var vars = expressionSegment.tokens.ExtractVariables();
                            vars = Functions.MakeUnique(vars);
                            foreach (var v in vars)
                            {
                                if (v.Length > 1)
                                {
                                    throw new ParsingException("Multi-symbol vars are forbidden in boolean mode");
                                }
                            }
                            var    be = new BoolEng(expressionSegment.Build());
                            string newExpr;
                            newExpr = be.CompileTable();
                            string line = "{";
                            foreach (var onevar in vars)
                            {
                                line += ": " + onevar + " %";
                            }
                            line   += ": F %}\n";
                            newExpr = line + newExpr;
                            newExprs.Add(newExpr);
                            {
                                newExpr = newExpr.Replace(":", "<th>");
                                newExpr = newExpr.Replace("%", "</th>");
                                newExpr = newExpr.Replace("{", "<tr>");
                                newExpr = newExpr.Replace("}", "</tr>");
                                newExpr = newExpr.Replace("[", "<td class=\"cellbool-res\">");
                                newExpr = newExpr.Replace("]", "</td>");
                                newExpr = newExpr.Replace("\n", "");
                                newExpr = "<table id=\"bool-res\">" + newExpr + "</table>";
                            }
                            newLatexExprs.Add(newExpr);
                            quickExit = true;
                            break;
                        }
                        else if (AscCalc.MathAnalysis.Contains(fieldType))
                        {
                            expressionSegment.tokens.AddOmittedOps();
                            var    vars = expressionSegment.tokens.ExtractVariables();
                            string diffVar;
                            vars = Functions.MakeUnique(vars);
                            if (fieldOpts.Select(Names.FOR).Count == 0)
                            {
                                if (vars.Contains("x") || vars.Count == 0)
                                {
                                    diffVar = "x";
                                }
                                else if (vars.Contains("y"))
                                {
                                    diffVar = "y";
                                }
                                else
                                {
                                    diffVar = vars[0];
                                }
                                res.InterpretedAs.Add("Interpreted as `" + Names.FOR + " " + diffVar + "`");
                            }
                            else if (fieldOpts.Select(Names.FOR).Count == 1)
                            {
                                diffVar = (fieldOpts.Select(Names.FOR).Item() as FixedKeyword).GetVariable();
                            }
                            else
                            {
                                diffVar = (fieldOpts.Select(Names.FOR)[0] as FixedKeyword).GetVariable();
                            }
                            vars.Add(diffVar);
                            vars = Functions.MakeUnique(vars);
                            string req = expressionSegment.Build();
                            if (fieldType == FieldType.DERIVATIVE)
                            {
                                newExprs.Add(MathS.FromString(req).Derive(MathS.Var(diffVar)).ToString());
                                if (isLast && latex)
                                {
                                    newLatexExprs.Add("$$" + MathS.FromString(req).Derive(MathS.Var(diffVar)).Latexise().ToString() + "$$");
                                }
                            }
                            else if (fieldType == FieldType.SOLVE)
                            {
                                expressionSegment.tokens.AddOmittedOps();
                                if (vars.Count > 1)
                                {
                                    throw new InvalidRequestException();
                                }
                                var roots = MathS.FromString(req).SolveNt(MathS.Var(diffVar), precision: 400);
                                foreach (var root in roots)
                                {
                                    newExprs.Add(root.ToString());
                                }
                                if (isLast && latex)
                                {
                                    foreach (var root in roots)
                                    {
                                        newExprs.Add("$$" + root.ToString() + "$$");
                                    }
                                }
                            }
                        }

                        else if (fieldType == FieldType.SIMPLIFICATION)
                        {
                            expressionSegment.tokens.AddOmittedOps();
                            var vars = expressionSegment.tokens.ExtractVariables();
                            vars = Functions.MakeUnique(vars);
                            string req = expressionSegment.Build();
                            string newExpr;
                            newExpr = MathS.FromString(req).SimplifyIntelli().ToString();
                            newExprs.Add(newExpr);
                            if (isLast && latex)
                            {
                                newExpr = MathS.FromString(req).SimplifyIntelli().Latexise();
                                newLatexExprs.Add("$$" + newExpr + "$$");
                            }
                        }
                    }
                    if (newExprs.Count == 0)
                    {
                        res.Result = "No answer";
                        break;
                    }
                    if (!isLast && !quickExit)
                    {
                        expressionSegments = new List <ExpressionSegment>();
                        foreach (var nexp in newExprs)
                        {
                            expressionSegments.Add(new ExpressionSegment("expression", nexp));
                        }
                    }
                    else
                    {
                        res.Result = "";
                        foreach (var segm in newExprs)
                        {
                            res.Result += segm + " ";
                        }
                        res.LatexResult = "";
                        foreach (var segm in newLatexExprs)
                        {
                            res.LatexResult += segm + " ";
                        }
                        break; // For quickExit case
                    }
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            return(res);
        }
Esempio n. 41
0
        /// <inheritdoc />
        public bool Equals([AllowNull] TreeMap other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                     ) &&
                 (
                     Visible == other.Visible ||
                     Visible != null &&
                     Visible.Equals(other.Visible)
                 ) &&
                 (
                     Opacity == other.Opacity ||
                     Opacity != null &&
                     Opacity.Equals(other.Opacity)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     UId == other.UId ||
                     UId != null &&
                     UId.Equals(other.UId)
                 ) &&
                 (
                     Equals(Ids, other.Ids) ||
                     Ids != null && other.Ids != null &&
                     Ids.SequenceEqual(other.Ids)
                 ) &&
                 (
                     Equals(CustomData, other.CustomData) ||
                     CustomData != null && other.CustomData != null &&
                     CustomData.SequenceEqual(other.CustomData)
                 ) &&
                 (
                     Meta == other.Meta ||
                     Meta != null &&
                     Meta.Equals(other.Meta)
                 ) &&
                 (
                     Equals(MetaArray, other.MetaArray) ||
                     MetaArray != null && other.MetaArray != null &&
                     MetaArray.SequenceEqual(other.MetaArray)
                 ) &&
                 (
                     HoverLabel == other.HoverLabel ||
                     HoverLabel != null &&
                     HoverLabel.Equals(other.HoverLabel)
                 ) &&
                 (
                     Stream == other.Stream ||
                     Stream != null &&
                     Stream.Equals(other.Stream)
                 ) &&
                 (
                     Equals(Transforms, other.Transforms) ||
                     Transforms != null && other.Transforms != null &&
                     Transforms.SequenceEqual(other.Transforms)
                 ) &&
                 (
                     UiRevision == other.UiRevision ||
                     UiRevision != null &&
                     UiRevision.Equals(other.UiRevision)
                 ) &&
                 (
                     Equals(Labels, other.Labels) ||
                     Labels != null && other.Labels != null &&
                     Labels.SequenceEqual(other.Labels)
                 ) &&
                 (
                     Equals(Parents, other.Parents) ||
                     Parents != null && other.Parents != null &&
                     Parents.SequenceEqual(other.Parents)
                 ) &&
                 (
                     Equals(Values, other.Values) ||
                     Values != null && other.Values != null &&
                     Values.SequenceEqual(other.Values)
                 ) &&
                 (
                     BranchValues == other.BranchValues ||
                     BranchValues != null &&
                     BranchValues.Equals(other.BranchValues)
                 ) &&
                 (
                     Count == other.Count ||
                     Count != null &&
                     Count.Equals(other.Count)
                 ) &&
                 (
                     Level == other.Level ||
                     Level != null &&
                     Level.Equals(other.Level)
                 ) &&
                 (
                     MaxDepth == other.MaxDepth ||
                     MaxDepth != null &&
                     MaxDepth.Equals(other.MaxDepth)
                 ) &&
                 (
                     Tiling == other.Tiling ||
                     Tiling != null &&
                     Tiling.Equals(other.Tiling)
                 ) &&
                 (
                     Marker == other.Marker ||
                     Marker != null &&
                     Marker.Equals(other.Marker)
                 ) &&
                 (
                     PathBar == other.PathBar ||
                     PathBar != null &&
                     PathBar.Equals(other.PathBar)
                 ) &&
                 (
                     Equals(Text, other.Text) ||
                     Text != null && other.Text != null &&
                     Text.SequenceEqual(other.Text)
                 ) &&
                 (
                     TextInfo == other.TextInfo ||
                     TextInfo != null &&
                     TextInfo.Equals(other.TextInfo)
                 ) &&
                 (
                     TextTemplate == other.TextTemplate ||
                     TextTemplate != null &&
                     TextTemplate.Equals(other.TextTemplate)
                 ) &&
                 (
                     Equals(TextTemplateArray, other.TextTemplateArray) ||
                     TextTemplateArray != null && other.TextTemplateArray != null &&
                     TextTemplateArray.SequenceEqual(other.TextTemplateArray)
                 ) &&
                 (
                     HoverText == other.HoverText ||
                     HoverText != null &&
                     HoverText.Equals(other.HoverText)
                 ) &&
                 (
                     Equals(HoverTextArray, other.HoverTextArray) ||
                     HoverTextArray != null && other.HoverTextArray != null &&
                     HoverTextArray.SequenceEqual(other.HoverTextArray)
                 ) &&
                 (
                     HoverInfo == other.HoverInfo ||
                     HoverInfo != null &&
                     HoverInfo.Equals(other.HoverInfo)
                 ) &&
                 (
                     Equals(HoverInfoArray, other.HoverInfoArray) ||
                     HoverInfoArray != null && other.HoverInfoArray != null &&
                     HoverInfoArray.SequenceEqual(other.HoverInfoArray)
                 ) &&
                 (
                     HoverTemplate == other.HoverTemplate ||
                     HoverTemplate != null &&
                     HoverTemplate.Equals(other.HoverTemplate)
                 ) &&
                 (
                     Equals(HoverTemplateArray, other.HoverTemplateArray) ||
                     HoverTemplateArray != null && other.HoverTemplateArray != null &&
                     HoverTemplateArray.SequenceEqual(other.HoverTemplateArray)
                 ) &&
                 (
                     TextFont == other.TextFont ||
                     TextFont != null &&
                     TextFont.Equals(other.TextFont)
                 ) &&
                 (
                     InsideTextFont == other.InsideTextFont ||
                     InsideTextFont != null &&
                     InsideTextFont.Equals(other.InsideTextFont)
                 ) &&
                 (
                     OutsideTextFont == other.OutsideTextFont ||
                     OutsideTextFont != null &&
                     OutsideTextFont.Equals(other.OutsideTextFont)
                 ) &&
                 (
                     TextPosition == other.TextPosition ||
                     TextPosition != null &&
                     TextPosition.Equals(other.TextPosition)
                 ) &&
                 (
                     Sort == other.Sort ||
                     Sort != null &&
                     Sort.Equals(other.Sort)
                 ) &&
                 (
                     Root == other.Root ||
                     Root != null &&
                     Root.Equals(other.Root)
                 ) &&
                 (
                     Domain == other.Domain ||
                     Domain != null &&
                     Domain.Equals(other.Domain)
                 ) &&
                 (
                     IdsSrc == other.IdsSrc ||
                     IdsSrc != null &&
                     IdsSrc.Equals(other.IdsSrc)
                 ) &&
                 (
                     CustomDataSrc == other.CustomDataSrc ||
                     CustomDataSrc != null &&
                     CustomDataSrc.Equals(other.CustomDataSrc)
                 ) &&
                 (
                     MetaSrc == other.MetaSrc ||
                     MetaSrc != null &&
                     MetaSrc.Equals(other.MetaSrc)
                 ) &&
                 (
                     LabelsSrc == other.LabelsSrc ||
                     LabelsSrc != null &&
                     LabelsSrc.Equals(other.LabelsSrc)
                 ) &&
                 (
                     ParentsSrc == other.ParentsSrc ||
                     ParentsSrc != null &&
                     ParentsSrc.Equals(other.ParentsSrc)
                 ) &&
                 (
                     ValuesSrc == other.ValuesSrc ||
                     ValuesSrc != null &&
                     ValuesSrc.Equals(other.ValuesSrc)
                 ) &&
                 (
                     TextSrc == other.TextSrc ||
                     TextSrc != null &&
                     TextSrc.Equals(other.TextSrc)
                 ) &&
                 (
                     TextTemplateSrc == other.TextTemplateSrc ||
                     TextTemplateSrc != null &&
                     TextTemplateSrc.Equals(other.TextTemplateSrc)
                 ) &&
                 (
                     HoverTextSrc == other.HoverTextSrc ||
                     HoverTextSrc != null &&
                     HoverTextSrc.Equals(other.HoverTextSrc)
                 ) &&
                 (
                     HoverInfoSrc == other.HoverInfoSrc ||
                     HoverInfoSrc != null &&
                     HoverInfoSrc.Equals(other.HoverInfoSrc)
                 ) &&
                 (
                     HoverTemplateSrc == other.HoverTemplateSrc ||
                     HoverTemplateSrc != null &&
                     HoverTemplateSrc.Equals(other.HoverTemplateSrc)
                 ));
        }
Esempio n. 42
0
        /// <inheritdoc />
        public bool Equals([AllowNull] Choropleth other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                     ) &&
                 (
                     Visible == other.Visible ||
                     Visible != null &&
                     Visible.Equals(other.Visible)
                 ) &&
                 (
                     LegendGroup == other.LegendGroup ||
                     LegendGroup != null &&
                     LegendGroup.Equals(other.LegendGroup)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     UId == other.UId ||
                     UId != null &&
                     UId.Equals(other.UId)
                 ) &&
                 (
                     Equals(Ids, other.Ids) ||
                     Ids != null && other.Ids != null &&
                     Ids.SequenceEqual(other.Ids)
                 ) &&
                 (
                     Equals(CustomData, other.CustomData) ||
                     CustomData != null && other.CustomData != null &&
                     CustomData.SequenceEqual(other.CustomData)
                 ) &&
                 (
                     Meta == other.Meta ||
                     Meta != null &&
                     Meta.Equals(other.Meta)
                 ) &&
                 (
                     Equals(MetaArray, other.MetaArray) ||
                     MetaArray != null && other.MetaArray != null &&
                     MetaArray.SequenceEqual(other.MetaArray)
                 ) &&
                 (
                     SelectedPoints == other.SelectedPoints ||
                     SelectedPoints != null &&
                     SelectedPoints.Equals(other.SelectedPoints)
                 ) &&
                 (
                     HoverLabel == other.HoverLabel ||
                     HoverLabel != null &&
                     HoverLabel.Equals(other.HoverLabel)
                 ) &&
                 (
                     Stream == other.Stream ||
                     Stream != null &&
                     Stream.Equals(other.Stream)
                 ) &&
                 (
                     Equals(Transforms, other.Transforms) ||
                     Transforms != null && other.Transforms != null &&
                     Transforms.SequenceEqual(other.Transforms)
                 ) &&
                 (
                     UiRevision == other.UiRevision ||
                     UiRevision != null &&
                     UiRevision.Equals(other.UiRevision)
                 ) &&
                 (
                     Equals(Locations, other.Locations) ||
                     Locations != null && other.Locations != null &&
                     Locations.SequenceEqual(other.Locations)
                 ) &&
                 (
                     LocationMode == other.LocationMode ||
                     LocationMode != null &&
                     LocationMode.Equals(other.LocationMode)
                 ) &&
                 (
                     Equals(Z, other.Z) ||
                     Z != null && other.Z != null &&
                     Z.SequenceEqual(other.Z)
                 ) &&
                 (
                     GeoJson == other.GeoJson ||
                     GeoJson != null &&
                     GeoJson.Equals(other.GeoJson)
                 ) &&
                 (
                     FeatureIdKey == other.FeatureIdKey ||
                     FeatureIdKey != null &&
                     FeatureIdKey.Equals(other.FeatureIdKey)
                 ) &&
                 (
                     Text == other.Text ||
                     Text != null &&
                     Text.Equals(other.Text)
                 ) &&
                 (
                     Equals(TextArray, other.TextArray) ||
                     TextArray != null && other.TextArray != null &&
                     TextArray.SequenceEqual(other.TextArray)
                 ) &&
                 (
                     HoverText == other.HoverText ||
                     HoverText != null &&
                     HoverText.Equals(other.HoverText)
                 ) &&
                 (
                     Equals(HoverTextArray, other.HoverTextArray) ||
                     HoverTextArray != null && other.HoverTextArray != null &&
                     HoverTextArray.SequenceEqual(other.HoverTextArray)
                 ) &&
                 (
                     Marker == other.Marker ||
                     Marker != null &&
                     Marker.Equals(other.Marker)
                 ) &&
                 (
                     Selected == other.Selected ||
                     Selected != null &&
                     Selected.Equals(other.Selected)
                 ) &&
                 (
                     Unselected == other.Unselected ||
                     Unselected != null &&
                     Unselected.Equals(other.Unselected)
                 ) &&
                 (
                     HoverInfo == other.HoverInfo ||
                     HoverInfo != null &&
                     HoverInfo.Equals(other.HoverInfo)
                 ) &&
                 (
                     Equals(HoverInfoArray, other.HoverInfoArray) ||
                     HoverInfoArray != null && other.HoverInfoArray != null &&
                     HoverInfoArray.SequenceEqual(other.HoverInfoArray)
                 ) &&
                 (
                     HoverTemplate == other.HoverTemplate ||
                     HoverTemplate != null &&
                     HoverTemplate.Equals(other.HoverTemplate)
                 ) &&
                 (
                     Equals(HoverTemplateArray, other.HoverTemplateArray) ||
                     HoverTemplateArray != null && other.HoverTemplateArray != null &&
                     HoverTemplateArray.SequenceEqual(other.HoverTemplateArray)
                 ) &&
                 (
                     ShowLegend == other.ShowLegend ||
                     ShowLegend != null &&
                     ShowLegend.Equals(other.ShowLegend)
                 ) &&
                 (
                     ZAuto == other.ZAuto ||
                     ZAuto != null &&
                     ZAuto.Equals(other.ZAuto)
                 ) &&
                 (
                     ZMin == other.ZMin ||
                     ZMin != null &&
                     ZMin.Equals(other.ZMin)
                 ) &&
                 (
                     ZMax == other.ZMax ||
                     ZMax != null &&
                     ZMax.Equals(other.ZMax)
                 ) &&
                 (
                     ZMid == other.ZMid ||
                     ZMid != null &&
                     ZMid.Equals(other.ZMid)
                 ) &&
                 (
                     ColorScale == other.ColorScale ||
                     ColorScale != null &&
                     ColorScale.Equals(other.ColorScale)
                 ) &&
                 (
                     AutoColorScale == other.AutoColorScale ||
                     AutoColorScale != null &&
                     AutoColorScale.Equals(other.AutoColorScale)
                 ) &&
                 (
                     ReverseScale == other.ReverseScale ||
                     ReverseScale != null &&
                     ReverseScale.Equals(other.ReverseScale)
                 ) &&
                 (
                     ShowScale == other.ShowScale ||
                     ShowScale != null &&
                     ShowScale.Equals(other.ShowScale)
                 ) &&
                 (
                     ColorBar == other.ColorBar ||
                     ColorBar != null &&
                     ColorBar.Equals(other.ColorBar)
                 ) &&
                 (
                     ColorAxis == other.ColorAxis ||
                     ColorAxis != null &&
                     ColorAxis.Equals(other.ColorAxis)
                 ) &&
                 (
                     Geo == other.Geo ||
                     Geo != null &&
                     Geo.Equals(other.Geo)
                 ) &&
                 (
                     IdsSrc == other.IdsSrc ||
                     IdsSrc != null &&
                     IdsSrc.Equals(other.IdsSrc)
                 ) &&
                 (
                     CustomDataSrc == other.CustomDataSrc ||
                     CustomDataSrc != null &&
                     CustomDataSrc.Equals(other.CustomDataSrc)
                 ) &&
                 (
                     MetaSrc == other.MetaSrc ||
                     MetaSrc != null &&
                     MetaSrc.Equals(other.MetaSrc)
                 ) &&
                 (
                     LocationsSrc == other.LocationsSrc ||
                     LocationsSrc != null &&
                     LocationsSrc.Equals(other.LocationsSrc)
                 ) &&
                 (
                     ZSrc == other.ZSrc ||
                     ZSrc != null &&
                     ZSrc.Equals(other.ZSrc)
                 ) &&
                 (
                     TextSrc == other.TextSrc ||
                     TextSrc != null &&
                     TextSrc.Equals(other.TextSrc)
                 ) &&
                 (
                     HoverTextSrc == other.HoverTextSrc ||
                     HoverTextSrc != null &&
                     HoverTextSrc.Equals(other.HoverTextSrc)
                 ) &&
                 (
                     HoverInfoSrc == other.HoverInfoSrc ||
                     HoverInfoSrc != null &&
                     HoverInfoSrc.Equals(other.HoverInfoSrc)
                 ) &&
                 (
                     HoverTemplateSrc == other.HoverTemplateSrc ||
                     HoverTemplateSrc != null &&
                     HoverTemplateSrc.Equals(other.HoverTemplateSrc)
                 ));
        }
        public void AggregatesTradeBarsWithVolumeProperly()
        {
            TradeBar consolidated = null;
            var consolidator = new DynamicDataConsolidator(3);
            consolidator.DataConsolidated += (sender, bar) =>
            {
                consolidated = bar;
            };

            var reference = DateTime.Today;
            dynamic bar1 = new CustomData();
            bar1.Symbol = "SPY";
            bar1.Time = reference;
            bar1.Open = 10;
            bar1.High = 100m;
            bar1.Low = 1m;
            bar1.Close = 50m;
            bar1.Volume = 75L;

            dynamic bar2 = new CustomData();
            bar2.Symbol = "SPY";
            bar2.Time = reference.AddHours(1);
            bar2.Open = 50m;
            bar2.High = 123m;
            bar2.Low = 35m;
            bar2.Close = 75m;
            bar2.Volume = 100L;

            dynamic bar3 = new CustomData();
            bar3.Symbol = "SPY";
            bar3.Time = reference.AddHours(1);
            bar3.Open = 75m;
            bar3.High = 100m;
            bar3.Low = 50m;
            bar3.Close = 83m;
            bar3.Volume = 125L;

            consolidator.Update(bar1);
            Assert.IsNull(consolidated);

            consolidator.Update(bar2);
            Assert.IsNull(consolidated);

            consolidator.Update(bar3);

            Assert.IsNotNull(consolidated);
            Assert.AreEqual("SPY", consolidated.Symbol.Permtick);
            Assert.AreEqual(bar1.Open, consolidated.Open);
            Assert.AreEqual(Math.Max(bar1.High, Math.Max(bar2.High, bar3.High)), consolidated.High);
            Assert.AreEqual(Math.Min(bar1.Low, Math.Min(bar2.Low, bar3.Low)), consolidated.Low);
            Assert.AreEqual(bar3.Close, consolidated.Close);
            Assert.AreEqual(bar1.Volume + bar2.Volume + bar3.Volume, consolidated.Volume);
        }
Esempio n. 44
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (Visible != null)
         {
             hashCode = hashCode * 59 + Visible.GetHashCode();
         }
         if (LegendGroup != null)
         {
             hashCode = hashCode * 59 + LegendGroup.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (UId != null)
         {
             hashCode = hashCode * 59 + UId.GetHashCode();
         }
         if (Ids != null)
         {
             hashCode = hashCode * 59 + Ids.GetHashCode();
         }
         if (CustomData != null)
         {
             hashCode = hashCode * 59 + CustomData.GetHashCode();
         }
         if (Meta != null)
         {
             hashCode = hashCode * 59 + Meta.GetHashCode();
         }
         if (MetaArray != null)
         {
             hashCode = hashCode * 59 + MetaArray.GetHashCode();
         }
         if (SelectedPoints != null)
         {
             hashCode = hashCode * 59 + SelectedPoints.GetHashCode();
         }
         if (HoverLabel != null)
         {
             hashCode = hashCode * 59 + HoverLabel.GetHashCode();
         }
         if (Stream != null)
         {
             hashCode = hashCode * 59 + Stream.GetHashCode();
         }
         if (Transforms != null)
         {
             hashCode = hashCode * 59 + Transforms.GetHashCode();
         }
         if (UiRevision != null)
         {
             hashCode = hashCode * 59 + UiRevision.GetHashCode();
         }
         if (Locations != null)
         {
             hashCode = hashCode * 59 + Locations.GetHashCode();
         }
         if (LocationMode != null)
         {
             hashCode = hashCode * 59 + LocationMode.GetHashCode();
         }
         if (Z != null)
         {
             hashCode = hashCode * 59 + Z.GetHashCode();
         }
         if (GeoJson != null)
         {
             hashCode = hashCode * 59 + GeoJson.GetHashCode();
         }
         if (FeatureIdKey != null)
         {
             hashCode = hashCode * 59 + FeatureIdKey.GetHashCode();
         }
         if (Text != null)
         {
             hashCode = hashCode * 59 + Text.GetHashCode();
         }
         if (TextArray != null)
         {
             hashCode = hashCode * 59 + TextArray.GetHashCode();
         }
         if (HoverText != null)
         {
             hashCode = hashCode * 59 + HoverText.GetHashCode();
         }
         if (HoverTextArray != null)
         {
             hashCode = hashCode * 59 + HoverTextArray.GetHashCode();
         }
         if (Marker != null)
         {
             hashCode = hashCode * 59 + Marker.GetHashCode();
         }
         if (Selected != null)
         {
             hashCode = hashCode * 59 + Selected.GetHashCode();
         }
         if (Unselected != null)
         {
             hashCode = hashCode * 59 + Unselected.GetHashCode();
         }
         if (HoverInfo != null)
         {
             hashCode = hashCode * 59 + HoverInfo.GetHashCode();
         }
         if (HoverInfoArray != null)
         {
             hashCode = hashCode * 59 + HoverInfoArray.GetHashCode();
         }
         if (HoverTemplate != null)
         {
             hashCode = hashCode * 59 + HoverTemplate.GetHashCode();
         }
         if (HoverTemplateArray != null)
         {
             hashCode = hashCode * 59 + HoverTemplateArray.GetHashCode();
         }
         if (ShowLegend != null)
         {
             hashCode = hashCode * 59 + ShowLegend.GetHashCode();
         }
         if (ZAuto != null)
         {
             hashCode = hashCode * 59 + ZAuto.GetHashCode();
         }
         if (ZMin != null)
         {
             hashCode = hashCode * 59 + ZMin.GetHashCode();
         }
         if (ZMax != null)
         {
             hashCode = hashCode * 59 + ZMax.GetHashCode();
         }
         if (ZMid != null)
         {
             hashCode = hashCode * 59 + ZMid.GetHashCode();
         }
         if (ColorScale != null)
         {
             hashCode = hashCode * 59 + ColorScale.GetHashCode();
         }
         if (AutoColorScale != null)
         {
             hashCode = hashCode * 59 + AutoColorScale.GetHashCode();
         }
         if (ReverseScale != null)
         {
             hashCode = hashCode * 59 + ReverseScale.GetHashCode();
         }
         if (ShowScale != null)
         {
             hashCode = hashCode * 59 + ShowScale.GetHashCode();
         }
         if (ColorBar != null)
         {
             hashCode = hashCode * 59 + ColorBar.GetHashCode();
         }
         if (ColorAxis != null)
         {
             hashCode = hashCode * 59 + ColorAxis.GetHashCode();
         }
         if (Geo != null)
         {
             hashCode = hashCode * 59 + Geo.GetHashCode();
         }
         if (IdsSrc != null)
         {
             hashCode = hashCode * 59 + IdsSrc.GetHashCode();
         }
         if (CustomDataSrc != null)
         {
             hashCode = hashCode * 59 + CustomDataSrc.GetHashCode();
         }
         if (MetaSrc != null)
         {
             hashCode = hashCode * 59 + MetaSrc.GetHashCode();
         }
         if (LocationsSrc != null)
         {
             hashCode = hashCode * 59 + LocationsSrc.GetHashCode();
         }
         if (ZSrc != null)
         {
             hashCode = hashCode * 59 + ZSrc.GetHashCode();
         }
         if (TextSrc != null)
         {
             hashCode = hashCode * 59 + TextSrc.GetHashCode();
         }
         if (HoverTextSrc != null)
         {
             hashCode = hashCode * 59 + HoverTextSrc.GetHashCode();
         }
         if (HoverInfoSrc != null)
         {
             hashCode = hashCode * 59 + HoverInfoSrc.GetHashCode();
         }
         if (HoverTemplateSrc != null)
         {
             hashCode = hashCode * 59 + HoverTemplateSrc.GetHashCode();
         }
         return(hashCode);
     }
 }
Esempio n. 45
0
 // GET: Customization
 public ActionResult Customization()
 {
     ViewBag.datasource = CustomData.GetData();
     return(View());
 }
        private CustomData GetCustomData()
        {
            var customData = new CustomData("Reference", "SqlSchema");

            return customData;
        }