public string GetText(DisplayTargetID displayTgtID, Player player, StarReport starReport, PlanetoidReport[] planetoidReports, bool includeUnknown) {
     if (!IsTextCurrent(displayTgtID, player, starReport, planetoidReports, includeUnknown)) {
         D.Log("{0} generating new text for Label {1}, Player {2}.", GetType().Name, displayTgtID.GetValueName(), player.LeaderName);
         GenerateText(displayTgtID, player, starReport, planetoidReports, includeUnknown);
     }
     return _stringBuilder.ToString();
 }
 public string GetText(DisplayTargetID displayTgtID, Player player, AIntel intel, ShipReport[] elementReports, bool includeUnknown) {
     if (!IsTextCurrent(displayTgtID, player, intel.CurrentCoverage, elementReports, includeUnknown)) {
         D.Log("{0} generating new text for Label {1}, Player {2}.", GetType().Name, displayTgtID.GetValueName(), player.LeaderName);
         GenerateText(displayTgtID, player, intel, elementReports, includeUnknown);
     }
     return _stringBuilder.ToString();
 }
 private void GenerateText(DisplayTargetID displayTgtID, Player player, AIntel intel, ShipReport[] elementReports, bool includeUnknown) {
     _stringBuilder.Clear();
     _currentTextLabelID = displayTgtID;
     LabelFormatter.IncludeUnknown = includeUnknown;
     LabelFormatter.Report = GetReport(player, intel, elementReports);
     var labelLines = LabelFormatter.GetLabelLines(displayTgtID);
     foreach (var line in labelLines) {
         _stringBuilder.AppendLine(line);
         // IMPROVE don't include a line break on the last line
     }
 }
Beispiel #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ALabelText"/> class.
 /// </summary>
 /// <param name="displayTgtID">The label identifier.</param>
 /// <param name="report">The report this LabelText is derived from.</param>
 /// <param name="isDedicatedLinePerContentID">if set to <c>true</c> the text associated with each key will be displayed on a separate line.</param>
 public ALabelText(DisplayTargetID displayTgtID, AReport report, bool isDedicatedLinePerContentID) {
     LabelID = displayTgtID;
     Report = report;
     _isDedicatedLinePerContentID = isDedicatedLinePerContentID;
 }
 private bool IsTextCurrent(DisplayTargetID displayTgtID, Player player, IntelCoverage intelCoverage, ShipReport[] elementReports, bool includeUnknown) {
     return displayTgtID == _currentTextLabelID && includeUnknown == LabelFormatter.IncludeUnknown && IsReportCurrent(player, intelCoverage, elementReports);
 }
Beispiel #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="IntelLabelText" /> class.
 /// </summary>
 /// <param name="displayTgtID">The label identifier.</param>
 /// <param name="report">The report.</param>
 /// <param name="isDedicatedLinePerContentID">if set to <c>true</c> the text associated with each key will be displayed on a separate line.</param>
 public IntelLabelText(DisplayTargetID displayTgtID, AIntelItemReport report, bool isDedicatedLinePerContentID)
     : base(displayTgtID, report, isDedicatedLinePerContentID) {
     IntelCoverage = report.IntelCoverage;
 }
Beispiel #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="IntelLabelText" /> class.
 /// </summary>
 /// <param name="displayTgtID">The label identifier.</param>
 /// <param name="report">The report.</param>
 /// <param name="isDedicatedLinePerContentID">if set to <c>true</c> the text associated with each key will be displayed on a separate line.</param>
 public LabelText(DisplayTargetID displayTgtID, AReport report, bool isDedicatedLinePerContentID)
     : base(displayTgtID, report, isDedicatedLinePerContentID) {
 }
 private bool IsTextCurrent(DisplayTargetID displayTgtID, Player player, StarReport starReport, PlanetoidReport[] planetoidReports, bool includeUnknown) {
     return displayTgtID == _currentTextLabelID && includeUnknown == LabelFormatter.IncludeUnknown && IsReportCurrent(player, starReport, planetoidReports);
 }
 public abstract bool TryUpdateLabelTextContent(DisplayTargetID displayTgtID, LabelContentID contentID, AElementItemReport[] elementReports, out IColoredTextList content);
 public abstract IntelLabelText GetLabelText(DisplayTargetID displayTgtID, AElementItemReport[] elementReports);
 /// <summary>
 /// Trys to get the override phrase to pair with the content in the LabelText. 
 /// </summary>
 /// <param name="displayTgtID">The label identifier.</param>
 /// <param name="contentID">The content identifier.</param>
 /// <param name="overridePhrase">The override phrase.</param>
 /// <returns></returns>
 protected abstract bool TryGetOverridePhrase(DisplayTargetID displayTgtID, LabelContentID contentID, out string overridePhrase);
 /// <summary>
 /// Gets the list of <c>LabelContentID</c>s to include in the LabelText.
 /// </summary>
 /// <param name="displayTgtID">The label identifier.</param>
 /// <returns></returns>
 protected abstract IEnumerable<LabelContentID> GetIncludedContentIDs(DisplayTargetID displayTgtID);