Exemplo n.º 1
0
        //public List<string> AbilityPackagesTrained { get; set; }

        public override int GetHashCode()
        {
            int hash = Name.GetHashCode();

            if (Title != null)
            {
                hash ^= Title.GetHashCode();
            }
            hash ^= ClassSpec.Id.GetHashCode();
            hash ^= MinLevel.GetHashCode();
            hash ^= MaxLevel.GetHashCode();
            hash ^= Faction.GetHashCode();
            hash ^= Toughness.GetHashCode();
            hash ^= DifficultyFlags.GetHashCode();
            if (Codex != null)
            {
                hash ^= Codex.Id.GetHashCode();
            }
            hash ^= ProfessionTrained.GetHashCode();
            if (ConversationFqn != null)
            {
                hash ^= ConversationFqn.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 2
0
        public override int GetHashCode()
        {
            var hashCode = -1823152004;

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(DisplayName);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(ShortName);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(StringId);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Description);

            hashCode = hashCode * -1521134295 + SetType.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Image);

            hashCode = hashCode * -1521134295 + MinLevel.GetHashCode();
            hashCode = hashCode * -1521134295 + MaxLevel.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <int[]> .Default.GetHashCode(Enhancements);

            hashCode = hashCode * -1521134295 + EqualityComparer <Bonus[]> .Default.GetHashCode(Bonuses);

            hashCode = hashCode * -1521134295 + EqualityComparer <SpecialBonus[]> .Default.GetHashCode(SpecialBonuses);

            return(hashCode);
        }
Exemplo n.º 3
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (MinLevel != 0)
            {
                hash ^= MinLevel.GetHashCode();
            }
            if (MaxLevel != 0)
            {
                hash ^= MaxLevel.GetHashCode();
            }
            if (AnchorScale != 0F)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(AnchorScale);
            }
            hash ^= aspectRatios_.GetHashCode();
            if (ScalesPerOctave != 0)
            {
                hash ^= ScalesPerOctave.GetHashCode();
            }
            if (NormalizeCoordinates != false)
            {
                hash ^= NormalizeCoordinates.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 4
0
        public RouteValueDictionary GetRouteValues(string memberName)
        {
            var prefix = String.IsNullOrWhiteSpace(memberName)
                ? null
                : memberName + '.';
            var result = new RouteValueDictionary();

            if (Source != null)
            {
                foreach (var item in Source.GetRouteValues(nameof(Source)))
                {
                    result.Add(prefix + item.Key, item.Value);
                }
            }
            if (MinLevel != null && MinLevel.Value != DefaultMinLevel)
            {
                foreach (var item in MinLevel.GetRouteValues(nameof(MinLevel)))
                {
                    result.Add(prefix + item.Key, item.Value);
                }
            }
            if (!String.IsNullOrWhiteSpace(Logger))
            {
                result.Add(prefix + nameof(Logger), Logger);
            }
            if (!String.IsNullOrWhiteSpace(Thread))
            {
                result.Add(prefix + nameof(Thread), Thread);
            }
            if (MinTime > DefaultMinTime)
            {
                result.Add(prefix + nameof(MinTime), MinTime.ToString(DateFormat));
            }
            if (MaxTime < DefaultMaxTime)
            {
                result.Add(prefix + nameof(MaxTime), MaxTime.ToString(DateFormat));
            }
            if (!String.IsNullOrWhiteSpace(Message))
            {
                result.Add(prefix + nameof(Message), Message);
            }
            if (!String.IsNullOrWhiteSpace(Throwable))
            {
                result.Add(prefix + nameof(Throwable), Throwable);
            }
            if (Quantity != null && Quantity.Value != DefaultQuantity)
            {
                foreach (var item in Quantity.GetRouteValues(nameof(Quantity)))
                {
                    result.Add(prefix + item.Key, item.Value);
                }
            }
            if (Offset > DefaultOffset)
            {
                result.Add(prefix + nameof(Offset), Offset);
            }

            return(result);
        }
Exemplo n.º 5
0
        private string LevelBoundsString()
        {
            if (MinLevel == 0 && MaxLevel == 0)
            {
                return(string.Empty);
            }

            string min = MinLevel == 0 ? string.Empty : MinLevel.ToString();
            string max = MaxLevel == 0 ? string.Empty : MaxLevel.ToString();

            return($"({min}-{max}) ");
        }
Exemplo n.º 6
0
 public IObservable <Space> Generate <TSource>(IObservable <TSource> source)
 {
     return(source.Select(xs =>
     {
         Engine.Init();
         Engine.AllocateDataForThread(AllocateDataFlags.CollisionData);
         var space = new HashSpace();
         space.Cleanup = false;
         space.MinLevel = MinLevel.GetValueOrDefault(space.MinLevel);
         space.MaxLevel = MaxLevel.GetValueOrDefault(space.MaxLevel);
         return space;
     }));
 }
Exemplo n.º 7
0
    public string GetSaveString()
    {
        string data = "";

        data += Name + (char)14;
        data += Description + (char)14;
        data += Nickname + (char)14;
        data += MinLevel.ToString() + (char)14;
        data += Affinity + (char)14;
        data += Identifier + (char)14;
        string skillString = "";

        foreach (Skill skill in skills)
        {
            skillString += skill.SkillName + "," + skill.SkillExperience + "," + skill.GetSkillLevelUnboosted() + "," + skill.IsBlocked.ToString() + "/";
        }
        skillString = skillString.Remove(skillString.Length - 1);
        return(data + (char)15 + skillString);
    }
Exemplo n.º 8
0
        protected override void WriteDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            ele.TryPathTo("IsTrait", true, out subEle);
            subEle.Value = IsTrait.ToString();

            ele.TryPathTo("MinLevel", true, out subEle);
            subEle.Value = MinLevel.ToString();

            ele.TryPathTo("Ranks", true, out subEle);
            subEle.Value = Ranks.ToString();

            ele.TryPathTo("IsPlayable", true, out subEle);
            subEle.Value = IsPlayable.ToString();

            ele.TryPathTo("IsHidden", true, out subEle);
            subEle.Value = IsHidden.ToString();
        }
Exemplo n.º 9
0
        void bw_DoWork(object sender, DoWorkEventArgs e)
        {
            string directoryName = Path.GetDirectoryName(ImageFile);
            string imageName     = Path.GetFileNameWithoutExtension(ImageFile);

            Directory.CreateDirectory(directoryName + "/" + imageName);

            int    width    = SourceImage.Width;
            int    height   = SourceImage.Height;
            int    size     = Math.Max(width, height);
            double numTiles = size / 256.0;

            for (int level = MinLevel; level <= MaxLevel; level++)
            {
                int logTileSize = (OrgLevel > level) ? 256 << (OrgLevel - level) : 256 >> (level - OrgLevel);
                int numTilesX   = (width % logTileSize == 0) ? width / logTileSize : width / logTileSize + 1;
                int numTilesY   = (height % logTileSize == 0) ? height / logTileSize : height / logTileSize + 1;

                for (int tx = 0; tx < numTilesX; tx++)
                {
                    for (int ty = 0; ty < numTilesY; ty++)
                    {
                        using (var tileImg = new Bitmap(256, 256))
                            using (var graphcis = Graphics.FromImage(tileImg))
                            {
                                graphcis.FillRectangle(new SolidBrush(BackgroundColor), 0, 0, 256, 256);
                                graphcis.DrawImage(SourceImage, new Rectangle(0, 0, 256, 256),
                                                   new Rectangle(tx * logTileSize, ty * logTileSize, logTileSize, logTileSize),
                                                   GraphicsUnit.Pixel);

                                tileImg.Save(string.Format("{0}/{1}/{2}-{3}-{4}.jpg", directoryName, imageName, level, tx, ty),
                                             System.Drawing.Imaging.ImageFormat.Jpeg);

                                bw.ReportProgress(0, new SendFeedbackEventArgs {
                                    Level = level, X = tx, Y = ty, Image = tileImg.Clone() as Bitmap
                                });
                            }
                    }
                }
            }

            string template;

            using (var reader = new StreamReader(Application.StartupPath + "\\Template.html"))
            {
                template = reader.ReadToEnd();
                reader.Close();
            }

            template = template.Replace("//image//", imageName);

            template = template.Replace("//width//", width.ToString());
            template = template.Replace("//height//", height.ToString());

            template = template.Replace("//maxLevel//", MaxLevel.ToString());
            template = template.Replace("//minLevel//", MinLevel.ToString());
            template = template.Replace("//orgLevel//", OrgLevel.ToString());

            template = template.Replace("//bgColor//", ColorTranslator.ToHtml(BackgroundColor));

            string htmlFile = directoryName + "/" + imageName + ".html";

            using (var writer = new StreamWriter(htmlFile))
            {
                writer.Write(template);
                writer.Close();
            }

            e.Result = htmlFile;
        }
 public void SetUp()
 {
     mSut = new MinLevel(new ReadOnlyCollection <IProperty>(new List <IProperty>()));
 }
Exemplo n.º 11
0
 public override int GetHashCode() => MinLevel.GetHashCode() + FileDirectoryPath.GetHashCode() + FileNameTemplate.GetHashCode();
Exemplo n.º 12
0
        public void ConvertsPropertiesToSettings()
        {
            // Main - General
            ModeSetting                 = Mode.ToString();
            LockFirstSlotSetting        = LockFirstSlot.ToString();
            LockSecondSlotSetting       = LockSecondSlot.ToString();
            LockThirdSlotSetting        = LockThirdSlot.ToString();
            MinLevelSetting             = MinLevel.ToString();
            MinPetHealthSetting         = MinPetHealth.ToString();
            MaxLevelSetting             = MaxLevel.ToString();
            UseWildPetsSetting          = UseWildPets.ToString();
            OnlyBluePetsSetting         = OnlyBluePets.ToString();
            UseFavouritePetsOnlySetting = UseFavouritePetsOnly.ToString();
            UseFavouriteRingersSetting  = UseFavouriteRingers.ToString();
            if (UseFavouritePetsOnly)
            {
                UseFavouriteRingersSetting = UseFavouritePetsOnly.ToString();
            }
            MinRingerPetHealthSetting  = MinRingerPetHealth.ToString();
            CaptureRaresSetting        = CaptureRares.ToString();
            IgnoreElitesSetting        = IgnoreElites.ToString();
            CaptureNotOwnRaritySetting = CaptureNotOwnRarity.ToString();
            MovementByPlayerSetting    = MovementByPlayer.ToString();
            RecordPetsSetting          = RecordPets.ToString();
            DoNotEngageSetting         = DoNotEngage.ToString();

            Pet2_Differ_Relative_Setting  = Pet2_Differ_Relative.ToString();
            Pet3_Differ_Relative_Setting  = Pet3_Differ_Relative.ToString();
            Zone_Diff_Relative_Setting    = Zone_Diff_Relative.ToString();
            Swap1_Health_Relative_Setting = Swap1_Health_Relative.ToString();
            Swap2_Health_Relative_Setting = Swap2_Health_Relative.ToString();
            Swap3_Health_Relative_Setting = Swap3_Health_Relative.ToString();

            Pet2_Differ_Ringer_Setting  = Pet2_Differ_Ringer.ToString();
            Pet3_Differ_Ringer_Setting  = Pet3_Differ_Ringer.ToString();
            Zone_Diff_Ringer_Setting    = Zone_Diff_Ringer.ToString();
            Swap1_Health_Ringer_Setting = Swap1_Health_Ringer.ToString();
            Swap2_Health_Ringer_Setting = Swap2_Health_Ringer.ToString();
            Swap3_Health_Ringer_Setting = Swap3_Health_Ringer.ToString();

            Pet2_Differ_Ringerx2_Setting  = Pet2_Differ_Ringerx2.ToString();
            Pet3_Differ_Ringerx2_Setting  = Pet3_Differ_Ringerx2.ToString();
            Zone_Diff_Ringerx2_Setting    = Zone_Diff_Ringerx2.ToString();
            Swap1_Health_Ringerx2_Setting = Swap1_Health_Ringerx2.ToString();
            Swap2_Health_Ringerx2_Setting = Swap2_Health_Ringerx2.ToString();
            Swap3_Health_Ringerx2_Setting = Swap3_Health_Ringerx2.ToString();

            Pet2_Differ_Capture_Setting  = Pet2_Differ_Capture.ToString();
            Pet3_Differ_Capture_Setting  = Pet3_Differ_Capture.ToString();
            Zone_Diff_Capture_Setting    = Zone_Diff_Capture.ToString();
            Swap1_Health_Capture_Setting = Swap1_Health_Capture.ToString();
            Swap2_Health_Capture_Setting = Swap2_Health_Capture.ToString();
            Swap3_Health_Capture_Setting = Swap3_Health_Capture.ToString();

            Pet2_Differ_Custom_Setting  = Pet2_Differ_Custom.ToString();
            Pet3_Differ_Custom_Setting  = Pet3_Differ_Custom.ToString();
            Zone_Diff_Custom_Setting    = Zone_Diff_Custom.ToString();
            Swap1_Health_Custom_Setting = Swap1_Health_Custom.ToString();
            Swap2_Health_Custom_Setting = Swap2_Health_Custom.ToString();
            Swap3_Health_Custom_Setting = Swap3_Health_Custom.ToString();

            AutoZoneChangeSetting = AutoZoneChange.ToString();

            SetSwapByCurrentMode();  // TODO: why it is here, lol?
        }
Exemplo n.º 13
0
 public override int GetHashCode()
 {
     return(MinLevel.GetHashCode());
 }
Exemplo n.º 14
0
 public void SetUp()
 {
     mSut = new MinLevel();
 }