public virtual void UpdateHighlight(Highlight highlight)
 {
     this.highlight = highlight;
 }
 private void DrawHighlight(Highlight highlight)
 {
     ColorGlyph[][] drawn = Screen.GetCurrent(MapUI.RowOffset, MapUI.ColOffset, GameUniverse.MapHeight, GameUniverse.MapWidth);
     if (highlight.Type == MapHighlightType.SinglePoint)
     {
         ColorGlyph currentGlyph = drawn[GameUniverse.MapHeight - 1 - highlight.Destination.Y][highlight.Destination.X];
         ColorGlyph highlighted  = Screen.GetHighlighted(currentGlyph, HighlightType.TargetingValidFocused);
         DrawToMap(highlight.Destination.Y, highlight.Destination.X, highlighted);
     }
     else              // path or line
     {
         IList <Point> valid   = highlight.LineOrPath;
         IList <Point> invalid = null;
         if (highlight.BlockedPoint != null)
         {
             valid   = new List <Point>();
             invalid = new List <Point>();
             bool blocked = false;
             for (int i = 0; i < highlight.LineOrPath.Count; ++i)
             {
                 if (blocked)
                 {
                     invalid.Add(highlight.LineOrPath[i]);
                 }
                 else
                 {
                     valid.Add(highlight.LineOrPath[i]);
                     if (highlight.LineOrPath[i] == highlight.BlockedPoint.Value)
                     {
                         blocked = true;
                     }
                 }
             }
         }
         if (highlight.Radius != null)
         {
             if (highlight.BlockedPoint != null)
             {
                 foreach (Point p in highlight.CellsInRadius)
                 {
                     if (!valid.Contains(p))
                     {
                         invalid.Add(p);                                                // don't overwrite valid with invalid
                     }
                 }
             }
             else
             {
                 foreach (Point p in highlight.CellsInRadius)
                 {
                     if (!valid.Contains(p))
                     {
                         valid.Add(p);
                     }
                 }
             }
         }
         foreach (Point p in valid)
         {
             ColorGlyph    currentGlyph  = drawn[GameUniverse.MapHeight - 1 - p.Y][p.X];
             HighlightType highlightType = highlight.Destination == p ? HighlightType.TargetingValidFocused : HighlightType.TargetingValid;
             ColorGlyph    highlighted   = Screen.GetHighlighted(currentGlyph, highlightType);
             DrawToMap(p.Y, p.X, highlighted);
         }
         if (!valid.Contains(highlight.Destination))
         {
             Point         p             = highlight.Destination;
             ColorGlyph    currentGlyph  = drawn[GameUniverse.MapHeight - 1 - p.Y][p.X];
             HighlightType highlightType = highlight.Destination == p ? HighlightType.TargetingValidFocused : HighlightType.TargetingValid;
             ColorGlyph    highlighted   = Screen.GetHighlighted(currentGlyph, highlightType);
             DrawToMap(p.Y, p.X, highlighted);
         }
         if (invalid != null)
         {
             foreach (Point p in invalid)
             {
                 ColorGlyph    currentGlyph  = drawn[GameUniverse.MapHeight - 1 - p.Y][p.X];
                 HighlightType highlightType = highlight.Destination == p ? HighlightType.TargetingInvalidFocused : HighlightType.TargetingInvalid;
                 ColorGlyph    highlighted   = Screen.GetHighlighted(currentGlyph, highlightType);
                 DrawToMap(p.Y, p.X, highlighted);
             }
         }
     }
 }