private Control CharacterActionBox(Statistics.CharacterAction statistics, ref Vector2 elementPosition) { Control f = new Control(); f.AddChild(HeaderText("Character actions", ref elementPosition)); var blast = new Map.Units.Blast(); int totalSlugs = statistics.ShotgunFired * blast.SlugsCount * (((Map.Units.BlastProjectile)blast.Projectile).NumberOfPenetratableUnits + 1); NewTextResults(f, "Shotgun shots", statistics.ShotgunFired.ToString(), ref elementPosition); NewProgressBarResults(f, "Shotgun accuracy", statistics.ShotgunSlugHits, totalSlugs, ref elementPosition, String.Format("{0:0.00} %", totalSlugs > 0 ? 100f * statistics.ShotgunSlugHits / totalSlugs : 0)); NewTextResults(f, "Ghost Rifle shots", statistics.GhostRifleFired.ToString(), ref elementPosition); NewProgressBarResults(f, "Ghost Rifle accuracy", statistics.GhostRifleHits, statistics.GhostRifleFired, ref elementPosition, String.Format("{0:0.00} %", statistics.GhostRifleFired > 0 ? 100f * statistics.GhostRifleHits / statistics.GhostRifleFired : 0)); f.Size = new Vector2(350f, elementPosition.Y); return(f); }
private Control CharacterActionBox(Statistics.CharacterAction statistics, ref Vector2 elementPosition) { Control f = new Control(); f.AddChild(HeaderText("Character actions", ref elementPosition)); var blast = new Map.Units.Blast(); int totalSlugs = statistics.ShotgunFired * blast.SlugsCount * (((Map.Units.BlastProjectile)blast.Projectile).NumberOfPenetratableUnits + 1); NewTextResults(f, "Shotgun shots", statistics.ShotgunFired.ToString(), ref elementPosition); NewProgressBarResults(f, "Shotgun accuracy", statistics.ShotgunSlugHits, totalSlugs, ref elementPosition, String.Format("{0:0.00} %", totalSlugs > 0 ? 100f * statistics.ShotgunSlugHits / totalSlugs : 0)); NewTextResults(f, "Ghost Rifle shots", statistics.GhostRifleFired.ToString(), ref elementPosition); NewProgressBarResults(f, "Ghost Rifle accuracy", statistics.GhostRifleHits, statistics.GhostRifleFired, ref elementPosition, String.Format("{0:0.00} %", statistics.GhostRifleFired > 0 ? 100f * statistics.GhostRifleHits / statistics.GhostRifleFired : 0)); f.Size = new Vector2(350f, elementPosition.Y); return f; }