public void DrawGuyGroup(GuyGroup gg) { int size = Math.Min(10 * (int)(gg.Guys.Count), 40); var square = new Rectangle(); int numTotalTicks = (int)distance(gg.SourceFort.Location, gg.DestinationFort.Location) / gg.Guys[0].Speed; double tickRatio = (numTotalTicks - gg.TicksTillFinished) / (double)numTotalTicks; double xDistanceMoved = (int)((gg.DestinationFort.Location.X - gg.SourceFort.Location.X) * tickRatio); double xLocation = gg.SourceFort.Location.X + xDistanceMoved; double yDistanceMoved = (int)((gg.DestinationFort.Location.Y - gg.SourceFort.Location.Y) * tickRatio); double yLocation = gg.SourceFort.Location.Y + yDistanceMoved; square.SetValue(Canvas.TopProperty, yLocation * SCALINGFACTOR); square.SetValue(Canvas.LeftProperty, xLocation * SCALINGFACTOR); square.Height = size; square.Width = square.Height; square.StrokeThickness = 3; square.Stroke = m_playerColorMapping[gg.GroupOwner]; Canvas.Children.Add(square); DrawText(xLocation * SCALINGFACTOR, yLocation * SCALINGFACTOR - size / 2 - 15, "->: " + gg.Guys.Sum(g => g.Strength).ToString(), Colors.Black); DrawText(xLocation * SCALINGFACTOR, yLocation * SCALINGFACTOR - size / 2, "+: " + gg.Guys.Sum(g => g.Health).ToString(), Colors.Black); }
public void DrawGuyGroup(GuyGroup gg) { }