コード例 #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 SystemReport GetReport(Player player, StarReport starReport, PlanetoidReport[] planetoidReports) {
     if (!IsReportCurrent(player, starReport, planetoidReports)) {
         D.Log("{0} generating new {1} for Player {2}.", GetType().Name, typeof(SystemReport).Name, player.LeaderName);
         _starReport = starReport;
         _planetoidReports = planetoidReports;
         _report = GenerateReport(player, starReport, planetoidReports);
         _data.AcceptChanges();
     }
     return _report;
 }
コード例 #3
0
 private void GenerateText(DisplayTargetID displayTgtID, Player player, StarReport starReport, PlanetoidReport[] planetoidReports, bool includeUnknown) {
     _stringBuilder.Clear();
     _currentTextLabelID = displayTgtID;
     LabelFormatter.IncludeUnknown = includeUnknown;
     LabelFormatter.Report = GetReport(player, starReport, planetoidReports);
     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
 private bool IsTextCurrent(DisplayTargetID displayTgtID, Player player, StarReport starReport, PlanetoidReport[] planetoidReports, bool includeUnknown) {
     return displayTgtID == _currentTextLabelID && includeUnknown == LabelFormatter.IncludeUnknown && IsReportCurrent(player, starReport, planetoidReports);
 }
コード例 #5
0
 public string GetCursorHudText(StarReport starReport, PlanetoidReport[] planetoidReports, bool includeUnknown = true) {
     return GetText(DisplayTargetID.CursorHud, _gameMgr.UserPlayer, starReport, planetoidReports, includeUnknown);
 }
コード例 #6
0
 protected SystemReport GenerateReport(Player player, StarReport starReport, PlanetoidReport[] planetoidReports) {
     return new SystemReport(player, _data, starReport, planetoidReports);
 }
コード例 #7
0
 private bool IsReportCurrent(Player player, StarReport starReport, PlanetoidReport[] planetoidReports) {
     return _report != null && _report.Player == player && !_data.IsChanged && starReport == _starReport && !planetoidReports.Except(_planetoidReports).Any();
 }
コード例 #8
0
 public void Show(Vector3 position, StarReport starReport, PlanetoidReport[] planetoidReports) {
     _starReport = starReport;
     _planetoidReports = planetoidReports;
     ShowHud(true, position);
 }