コード例 #1
0
 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();
 }
コード例 #2
0
 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();
 }
コード例 #3
0
 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
     }
 }
コード例 #4
0
ファイル: ALabelText.cs プロジェクト: Maxii/CodeEnv.Master
 /// <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;
 }
コード例 #5
0
 private bool IsTextCurrent(DisplayTargetID displayTgtID, Player player, IntelCoverage intelCoverage, ShipReport[] elementReports, bool includeUnknown) {
     return displayTgtID == _currentTextLabelID && includeUnknown == LabelFormatter.IncludeUnknown && IsReportCurrent(player, intelCoverage, elementReports);
 }
コード例 #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;
 }
コード例 #7
0
ファイル: LabelText.cs プロジェクト: Maxii/CodeEnv.Master
 /// <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) {
 }
コード例 #8
0
 private bool IsTextCurrent(DisplayTargetID displayTgtID, Player player, StarReport starReport, PlanetoidReport[] planetoidReports, bool includeUnknown) {
     return displayTgtID == _currentTextLabelID && includeUnknown == LabelFormatter.IncludeUnknown && IsReportCurrent(player, starReport, planetoidReports);
 }
コード例 #9
0
 public abstract bool TryUpdateLabelTextContent(DisplayTargetID displayTgtID, LabelContentID contentID, AElementItemReport[] elementReports, out IColoredTextList content);
コード例 #10
0
 public abstract IntelLabelText GetLabelText(DisplayTargetID displayTgtID, AElementItemReport[] elementReports);
コード例 #11
0
 /// <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);
コード例 #12
0
 /// <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);