/// <Summary> /// Set the content of the Summary control. Depending on the type of the Item /// selected this may either be a planet (in which case the planet Summary /// control is displayed) or a fleet (which will cause the fleet Summary control /// to be displayed). /// </Summary> /// <param name="Item">The <see cref="Item"/> to display (a <see cref="Fleet"/> or <see cref="Star"/>).</param> private void SetItem(Mappable item) { if (item == null) { this.summaryFrame.Text = "Nothing Selected"; FleetSummary.Hide(); PlanetSummary.Hide(); Invalidate(); return; } if (item is FleetIntel || item is Fleet) { FleetIntel report = null; empireState.FleetReports.TryGetValue(item.Key, out report); if (report != null) { DisplayFleet(report); } else { SetItem(null); } } else { DisplayPlanet(empireState.StarReports[item.Name]); } }
/// <Summary> /// Display a planet Summary /// </Summary> /// <param name="Item"></param> private void DisplayPlanet(StarIntel report) { if (empireState.StarReports[report.Name].Year == Global.Unset) { this.summaryFrame.Text = report.Name + " is unexplored"; summaryItem = null; PlanetSummary.Hide(); FleetSummary.Hide(); Invalidate(); return; } // If we are displaying a fleet clear it out and add the planet // Summary display. if (summaryItem is FleetIntel || summaryItem == null) { PlanetSummary.Show(); FleetSummary.Hide(); Invalidate(); } summaryItem = report; this.summaryFrame.Text = "Summary of " + report.Name; PlanetSummary.Location = new Point(5, 15); PlanetSummary.Value = report; }
/// <Summary> /// Display a fleet Summary /// </Summary> /// <param name="Item">The <see cref="Item"/> to display (a <see cref="Fleet"/> or <see cref="Star"/>).</param> private void DisplayFleet(FleetIntel report) { if (summaryItem is StarIntel || summaryItem == null) { FleetSummary.Show(); PlanetSummary.Hide(); Invalidate(); } summaryItem = report; this.summaryFrame.Text = "Summary of " + report.Name; FleetSummary.Location = new Point(5, 15); FleetSummary.Value = report; }