public void AddEllipse(RadarObject radarObject, Point point, double x, double y)
        {
            var elipse = new EllipseGeometry
            {
                Center  = point,
                RadiusX = x,
                RadiusY = y,
            };

            var key = new Tuple <int, int>((int)point.X, (int)point.Y);

            var hit = new HitContainer
            {
                Geometry    = elipse,
                Bounds      = elipse.Bounds,
                RadarObject = radarObject
            };

            if (!HitStorage.ContainsKey(key))
            {
                HitStorage.Add(key, hit);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Returns a base color for actor based on type and stuff
        /// </summary>
        public static ResourceSet GetActorResourceSet(RadarObject radarObject)
        {
            ResourceSet res = new ResourceSet();

            res.Brush = ActorDefaultBrush;

            try
            {
                switch (radarObject.Actor.Type)
                {
                case TrinityObjectType.Avoidance:
                    res.Brush = AvoidanceBrush;
                    res.Pen   = AvoidanceLightPen;
                    break;

                case TrinityObjectType.Portal:
                case TrinityObjectType.Container:
                case TrinityObjectType.CursedChest:
                case TrinityObjectType.CursedShrine:
                case TrinityObjectType.Shrine:
                case TrinityObjectType.HealthWell:
                case TrinityObjectType.Interactable:
                case TrinityObjectType.Barricade:
                case TrinityObjectType.Destructible:
                    res.Brush = GizmoBrush;
                    res.Pen   = GizmoLightPen;
                    break;

                case TrinityObjectType.ProgressionGlobe:
                case TrinityObjectType.PowerGlobe:
                case TrinityObjectType.HealthGlobe:
                case TrinityObjectType.Gold:
                case TrinityObjectType.Item:
                    res.Brush = ItemBrush;
                    res.Pen   = ItemLightPen;
                    break;

                case TrinityObjectType.Player:
                    res.Brush = PlayerBrush;
                    res.Pen   = PlayerLightPen;
                    break;

                case TrinityObjectType.Unit:

                    if (radarObject.Actor.IsElite)
                    {
                        res.Brush = EliteBrush;
                        res.Pen   = EliteLightPen;
                    }
                    else if (radarObject.Actor.IsHostile)
                    {
                        res.Brush = HostileUnitBrush;
                        res.Pen   = HostileUnitLightPen;
                    }
                    else
                    {
                        res.Brush = UnitBrush;
                    }
                    res.Pen = UnitLightPen;
                    break;

                default:
                    res.Brush = TransparentBrush;
                    res.Pen   = TransparentPen;
                    break;
                }

                if (radarObject.Actor.IsBlacklisted)
                {
                    res.Pen = BlacklistedPen;
                }
            }
            catch (Exception ex)
            {
                Core.Logger.Log("Exception in RadarUI.GetActorColor(). {0} {1}", ex.Message, ex.InnerException);
            }
            return(res);
        }