예제 #1
0
        private RectangleF[] testGetRectangle(Matrix matrix)
        {
            Matrix matrix1 = new Matrix();

            matrix1.Scale(10, 10);
            return(AreaRegion.GetRegionScans(matrix1));
        }
예제 #2
0
        protected override bool PointInObject(Point point)
        {
            CreateObjects();

            point.X = (int)Math.Round(point.X / Ratio);
            point.Y = (int)Math.Round(point.Y / Ratio);

            return(AreaRegion.IsVisible(point));
        }
 /// <summary>
 /// Initializes a new instance of the LocationExtension class
 /// </summary>
 /// <param name="ad">Address object</param>
 /// <param name="cross">AddressCrossStreet Object</param>
 /// <param name="grid">AddressGrid</param>
 /// <param name="mgrs">MGRS Coordinate</param>
 /// <param name="utm">UTM Coordinate</param>
 /// <param name="ar">Area Region</param>
 /// <param name="intersect">Intersection Boolean</param>
 public LocationExtension(Address ad, AddressCrossStreet cross, AddressGrid grid, MGRSCoordinate mgrs, UTMCoordinate utm,
                          AreaRegion ar, bool intersect)
 {
     this.Address            = ad;
     this.AddressCrossStreet = cross;
     this.AreaRegion         = ar;
     this.MGRSCoordinate     = mgrs;
     this.UTMCoordinate      = utm;
     AddressGrid             = grid;
 }
예제 #4
0
 /// <summary>
 /// Hit test if dataPoint is in gate, only used for user operation like mouse operation
 /// </summary>
 /// <param name="nIndex">gate index</param>
 /// <param name="dataPoint"></param>
 /// <returns></returns>
 public override bool HitTest(int nIndex, PointF dataPoint)
 {
     try
     {
         return(nIndex == 0 && AreaRegion != null && AreaRegion.IsVisible(dataPoint));
     }
     catch (System.Exception)
     {
     }
     return(false);
 }
예제 #5
0
        public override bool IntersectsWith(Rectangle rectangle)
        {
            CreateObjects();

            rectangle.X      = (int)Math.Round((rectangle.X - Origin.X) / Ratio);
            rectangle.Y      = (int)Math.Round((rectangle.Y - Origin.Y) / Ratio);
            rectangle.Width  = (int)Math.Round(rectangle.Width / Ratio);
            rectangle.Height = (int)Math.Round(rectangle.Height / Ratio);

            return(AreaRegion.IsVisible(rectangle));
        }
예제 #6
0
 protected override bool PointInObject(Point point)
 {
     {
         CreateObjects();
         if (AreaRegion != null)
         {
             return(AreaRegion.IsVisible(point));
         }
     }
     return(true);
 }
예제 #7
0
/* Evandro
 *      public override void SaveToStream(System.Runtime.Serialization.SerializationInfo info, int orderNumber)
 *      {
 *          info.AddValue(
 *              String.Format(CultureInfo.InvariantCulture,
 *              "{0}{1}",
 *              entryStart, orderNumber),
 *              startPoint);
 *
 *          info.AddValue(
 *              String.Format(CultureInfo.InvariantCulture,
 *              "{0}{1}",
 *              entryEnd, orderNumber),
 *              endPoint);
 *
 *          base.SaveToStream (info, orderNumber);
 *      }
 *
 *      public override void LoadFromStream(SerializationInfo info, int orderNumber)
 *      {
 *          startPoint = (Point)info.GetValue(
 *              String.Format(CultureInfo.InvariantCulture,
 *              "{0}{1}",
 *              entryStart, orderNumber),
 *              typeof(Point));
 *
 *          endPoint = (Point)info.GetValue(
 *              String.Format(CultureInfo.InvariantCulture,
 *              "{0}{1}",
 *              entryEnd, orderNumber),
 *              typeof(Point));
 *
 *          base.LoadFromStream (info, orderNumber);
 *      }
 */

        /// <summary>
        /// Invalidate object.
        /// When object is invalidated, path used for hit test
        /// is released and should be created again.
        /// </summary>
        protected void Invalidate()
        {
            if (AreaPath != null)
            {
                AreaPath.Dispose();
                AreaPath = null;
            }

            if (AreaPen != null)
            {
                AreaPen.Dispose();
                AreaPen = null;
            }

            if (AreaRegion != null)
            {
                AreaRegion.Dispose();
                AreaRegion = null;
            }
        }
예제 #8
0
        public override bool IntersectsWith(Rectangle rectangle)
        {
            CreateObjects();

            return(AreaRegion.IsVisible(rectangle));
        }
예제 #9
0
        protected override bool PointInObject(Point point)
        {
            CreateObjects();

            return(AreaRegion.IsVisible(point));
        }
예제 #10
0
 private void getBound(Graphics g)
 {
     Bound = AreaRegion.GetBounds(g);
 }
예제 #11
0
        /// <summary>
        /// Creates the Location to be set for the Aid Request
        /// </summary>
        /// <param name="add">Address object</param>
        /// <param name="cross">(Optional) AddressCrossStreet Object</param>
        /// <param name="grid">(Optional) AddressGrid</param>
        /// <param name="mgrs">(Optional) MGRS Coordinate</param>
        /// <param name="utm">(Optional) UTM Coordinate</param>
        /// <param name="ar">(Optional) Area Region</param>
        /// <param name="intersect">(Optional) Intersection Boolean</param>
        public void SetLocation(Address add, AddressCrossStreet cross = null, AddressGrid grid = null, MGRSCoordinate mgrs = null, UTMCoordinate utm = null, AreaRegion ar = null, bool?intersect = null)
        {
            LocationExtension e = null;

            if (intersect != null)
            {
                e = new LocationExtension(add, cross, grid, mgrs, utm, ar, (bool)intersect);
            }
            else
            {
                e = new LocationExtension(add, cross, grid, mgrs, utm, ar, false);
            }

            SetLocation(e);
        }
예제 #12
0
            public void Update()
            {
                BaseItemType BaseItem = gameController.Files.BaseItemTypes.Translate(Entity.Path);
                string       ItemName = BaseItem.BaseName;

                ClassID = BaseItem.ClassName;
                MavenDetails mavenDetails = new MavenDetails();

                int packSize = 0;
                int quantity = Entity.GetComponent <Quality>()?.ItemQuality ?? 0;
                // get and evaluate mods
                var mapComponent = Entity.GetComponent <Map>() ?? null;

                Tier            = mapComponent?.Tier ?? -1;
                NeedsPadding    = Tier == -1 ? false : true;
                ZanaMissionType = ObjectiveType.None;
                Bricked         = false;
                Corrupted       = Entity.GetComponent <Base>()?.isCorrupted ?? false;

                var modsComponent = Entity.GetComponent <Mods>() ?? null;

                ModCount = modsComponent?.ItemMods.Count() ?? 0;
                if (modsComponent != null && ModCount > 0)
                {
                    // add warnings, add quant, add packsize
                    if (modsComponent != null && modsComponent.ItemRarity != ItemRarity.Unique)
                    {
                        foreach (var mod in modsComponent.ItemMods.Where(x =>
                                                                         !x.Group.Contains("MapAtlasInfluence")))
                        {
                            if (ModNameBlacklist.Any(m => mod.RawName.Contains(m)))
                            {
                                ModCount--;
                                continue;
                            }

                            #region Elder Guardian Maven Areas and Regions
                            if (mod.Group.Contains("MapElderContainsBoss"))
                            {
                                ModCount--;
                                switch (mod.Value1)
                                {
                                case 1:
                                    mavenDetails.MavenRegion = "The Twisted";
                                    mavenDetails.MavenArea   = "The Enslaver";
                                    break;

                                case 2:
                                    mavenDetails.MavenRegion = "The Twisted";
                                    mavenDetails.MavenArea   = "The Eradicator";
                                    break;

                                case 3:
                                    mavenDetails.MavenRegion = "The Twisted";
                                    mavenDetails.MavenArea   = "The Constrictor";
                                    break;

                                case 4:
                                    mavenDetails.MavenRegion = "The Twisted";
                                    mavenDetails.MavenArea   = "The Purifier";
                                    break;
                                }
                                continue;
                            }
                            #endregion
                            quantity += mod.Value1;
                            packSize += mod.Value3;
                            if (WarningDictionary.Where(x => mod.RawName.Contains(x.Key)).Any())
                            {
                                StyledText warning = WarningDictionary.Where(x => mod.RawName.Contains(x.Key)).FirstOrDefault().Value;
                                if (warning.Bricking)
                                {
                                    Bricked = true;
                                }
                                ActiveWarnings.Add(warning);
                            }
                        }
                    }


                    // Check Zana missions
                    if (!modsComponent.ItemMods.Any(x => x.RawName == "MapZanaSubAreaMissionDetails"))
                    {
                        ZanaMod = null;
                    }
                    else if (ZanaMods.TryGetValue(modsComponent.ItemMods.
                                                  FirstOrDefault(x => x.RawName == "MapZanaSubAreaMissionDetails").Value2, out string modName))
                    {
                        Vector4 textColor = new Vector4(0.9f, 0.85f, 0.65f, 1f);
                        if (modName.Contains("Elder Guardian"))
                        {
                            ZanaMissionType = ObjectiveType.ElderGuardian;
                        }
                        else if (modName.Contains("Shaper Guardian"))
                        {
                            ZanaMissionType = ObjectiveType.ShaperGuardian;
                        }
                        else if (modName.Contains("Harvest"))
                        {
                            ZanaMissionType = ObjectiveType.Harvest;
                        }
                        else if (modName.Contains("Delirium"))
                        {
                            ZanaMissionType = ObjectiveType.Delirium;
                        }
                        else if (modName.Contains("Blighted Map"))
                        {
                            ZanaMissionType = ObjectiveType.Blighted;
                        }
                        else if (modName.Contains("Blight Encounter"))
                        {
                            ZanaMissionType = ObjectiveType.BlightEncounter;
                        }
                        else if (modName.Contains("Legion"))
                        {
                            ZanaMissionType = ObjectiveType.Legion;
                        }
                        else if (modName.Contains("Metamorph"))
                        {
                            ZanaMissionType = ObjectiveType.Metamorph;
                        }
                        ZanaMod = new StyledText()
                        {
                            Color = textColor, Text = modName
                        };
                    }
                    else
                    {
                        Vector4 textColor = new Vector4(0.9f, 0.85f, 0.65f, 1f);
                        modName = $"Unknown Zana Mission: {modsComponent.ItemMods.FirstOrDefault(x => x.RawName == "MapZanaSubAreaMissionDetails").Value2}";
                        ZanaMod = new StyledText()
                        {
                            Color = textColor, Text = modName
                        };
                    }
                }
                ;
                Quantity = quantity;
                PackSize = packSize;

                if (!ClassID.Contains("HeistContract") &&
                    !ClassID.Contains("HeistBlueprint") &&
                    !ClassID.Contains("AtlasRegionUpgradeItem") &&
                    !ClassID.Contains("QuestItem") &&
                    !ClassID.Contains("MiscMapItem") &&
                    !ClassID.Contains("MapFragment"))
                {
                    WorldArea area    = mapComponent.Area;
                    string    mapTrim = Entity.GetComponent <Base>().Name.Replace(" Map", "");
                    if (modsComponent.ItemRarity == ItemRarity.Unique)
                    {
                        // normal map at inner, 0x18, 0x18
                        long mapUnique = gameController.IngameState.M.Read <long>(mapComponent.Address + 0x10, 0x10, 0x20);
                        area    = gameController.Files.WorldAreas.GetByAddress(mapUnique) ?? area;
                        mapTrim = area.Name;
                    }
                    MapName = $"[T{mapComponent.Tier}] {mapTrim}";


                    Awakened  = AwakenedAreas.Contains(area) ? true : false;
                    Bonus     = BonusAreas.Contains(area) ? true : false;
                    Completed = CompletedAreas.Contains(area) ? true : false;
                    mavenDetails.MavenCompletion = MavenAreas.Contains(area) ? true : false;

                    if (AreaRegion.TryGetValue(mapTrim, out string region))
                    {
                        MapRegion = region;
                    }
                    else
                    {
                        MapRegion = "Unknown Region";
                    }
                }

                if (Entity.Path.Contains("MavenMap"))
                {
                    mavenDetails.MavenInvitation = true;
                    MapName = ItemName;
                    mavenDetails.MavenRegion = RegionReadable.FirstOrDefault(x => Entity.Path.Contains(x.Key)).Value ?? "Uncharted";
                }
                if (ClassID.Contains("MapFragment"))
                {
                    MapName      = ItemName;
                    NeedsPadding = true;
                }

                #region Maven Regions & Areas
                if (Entity.Path.Contains("BreachFragmentPhysical"))
                {
                    mavenDetails.MavenRegion = "The Hidden";
                    mavenDetails.MavenArea   = "Uul-Netol's Domain";
                }
                else if (Entity.Path.Contains("BreachFragmentCold"))
                {
                    mavenDetails.MavenRegion = "The Hidden";
                    mavenDetails.MavenArea   = "Tul's Domain";
                }
                else if (Entity.Path.Contains("BreachFragmentFire"))
                {
                    mavenDetails.MavenRegion = "The Hidden";
                    mavenDetails.MavenArea   = "Xoph's Domain";
                }
                else if (Entity.Path.Contains("BreachFragmentLightning"))
                {
                    mavenDetails.MavenRegion = "The Hidden";
                    mavenDetails.MavenArea   = "Esh's Domain";
                }
                else if (Entity.Path.Contains("BreachFragmentChaos"))
                {
                    mavenDetails.MavenRegion = "The Feared";
                    mavenDetails.MavenArea   = "Chayula's Domain";
                }
                else if (Entity.Path.Contains("CurrencyElderFragment"))
                {
                    mavenDetails.MavenRegion = "The Feared";
                    mavenDetails.MavenArea   = "Absence of Value and Meaning";
                }
                else if (Entity.Path.Contains("ShaperFragment"))
                {
                    mavenDetails.MavenRegion = "The Feared";
                    mavenDetails.MavenArea   = "The Shaper's Realm";
                }
                else if (Entity.Path.Contains("VaalFragment2_"))
                {
                    mavenDetails.MavenRegion = "The Feared";
                    mavenDetails.MavenArea   = "The Alluring Abyss";
                }
                else if (ItemName == "Cortex")
                {
                    mavenDetails.MavenRegion = "The Feared";
                    mavenDetails.MavenArea   = "Cortex";
                }
                else if (ItemName.Contains("Lair of the Hydra") ||
                         ItemName.Contains("Maze of the Minotaur") ||
                         ItemName.Contains("Forge of the Phoenix Map") ||
                         ItemName.Contains("Pit of the Chimera Map"))
                {
                    mavenDetails.MavenRegion = "The Formed";
                    mavenDetails.MavenArea   = ItemName.Replace(" Map", "");
                }
                else if (ItemName == "Rewritten Distant Memory" ||
                         ItemName == "Augmented Distant Memory" ||
                         ItemName == "Altered Distant Memory" ||
                         ItemName == "Twisted Distant Memory")
                {
                    mavenDetails.MavenRegion = "The Forgotten";
                    mavenDetails.MavenArea   = ItemName;
                }

                if (mavenDetails.MavenInvitation || mavenDetails.MavenArea != string.Empty)
                {
                    mavenDetails.MavenUncharted = MavenAreas.Any(x => x.Name == mavenDetails.MavenArea) ? true : false;
                    mavenDetails.MavenBosses    = MavenBosses(Entity.Path, mavenDetails.MavenRegion);
                }
                #endregion
                MavenDetails = mavenDetails;

                if ((MapName ?? string.Empty) != string.Empty && LacksCompletionList.Any(x => MapName.Contains(x)))
                {
                    LacksCompletion = true;
                }

                // evaluate rarity for colouring item name
                ItemColor = GetRarityColor(modsComponent?.ItemRarity ?? ItemRarity.Normal);
            }