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 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; }
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 } }
private bool IsTextCurrent(DisplayTargetID displayTgtID, Player player, StarReport starReport, PlanetoidReport[] planetoidReports, bool includeUnknown) { return displayTgtID == _currentTextLabelID && includeUnknown == LabelFormatter.IncludeUnknown && IsReportCurrent(player, starReport, planetoidReports); }
public string GetCursorHudText(StarReport starReport, PlanetoidReport[] planetoidReports, bool includeUnknown = true) { return GetText(DisplayTargetID.CursorHud, _gameMgr.UserPlayer, starReport, planetoidReports, includeUnknown); }
protected SystemReport GenerateReport(Player player, StarReport starReport, PlanetoidReport[] planetoidReports) { return new SystemReport(player, _data, starReport, planetoidReports); }
private bool IsReportCurrent(Player player, StarReport starReport, PlanetoidReport[] planetoidReports) { return _report != null && _report.Player == player && !_data.IsChanged && starReport == _starReport && !planetoidReports.Except(_planetoidReports).Any(); }
public void Show(Vector3 position, StarReport starReport, PlanetoidReport[] planetoidReports) { _starReport = starReport; _planetoidReports = planetoidReports; ShowHud(true, position); }