public TowerInfoBox(Tower target, bool isBuildInfo) : base(target.ScreenLocation) { Target = target; GenerateText(); IsBuildInfo = isBuildInfo; if (isBuildInfo) { string enters = string.Concat(Enumerable.Repeat <string>(Environment.NewLine, Lines.Count)); Lines.Add(enters + " Cost: " + target.Cost); Height += CurrentGame.font.LineSpacing; float costStringWidth = CurrentGame.font.MeasureString(" Cost: " + target.Cost).X; if (costStringWidth + TowerInfoBox.Padding * 2 > Width) { Width = (int)costStringWidth + TowerInfoBox.Padding * 2; } LineColors.Add(Color.White); } }
/// <summary> /// Modification the line color (<see cref="PlotFormat.LineColor"/>). /// </summary> public void ModLineColor(string SubKey, LineColors LineColor) { this.ModLineColor(new[] { SubKey }, new[] { LineColor }); }
static public Brush GetBrush(int index) { int i = index % LineColors.Count; return(LineColors.ElementAt(i).Key); }
public PlotFormat WithLineColor(LineColors color) { return(new PlotFormat(baseLineFormat: this, lineColor: color)); }