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(); }
public FleetReport GetReport(Player player, AIntel intel, ShipReport[] elementReports) { if (!IsReportCurrent(player, intel.CurrentCoverage, elementReports)) { D.Log("{0} generating new {1} for Player {2}.", GetType().Name, typeof(FleetReport).Name, player.LeaderName); _elementReports = elementReports; _report = GenerateReport(player, intel, elementReports); _data.AcceptChanges(); } return _report; }
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 } }
public string GetCursorHudText(AIntel intel, ShipReport[] elementReports, bool includeUnknown = true) { return GetText(DisplayTargetID.CursorHud, _gameMgr.UserPlayer, intel, elementReports, includeUnknown); }
protected FleetReport GenerateReport(Player player, AIntel intel, ShipReport[] elementReports) { return new FleetReport(_data, player, intel, elementReports); }
protected SettlementReport GenerateReport(Player player, AIntel intel, FacilityReport[] elementReports) { return new SettlementReport(_data, player, intel, elementReports); }
/// <summary> /// Copy Constructor. Initializes a new instance of the <see cref="AIntel"/> class, /// a copy of <c>intelToCopy</c>. /// </summary> /// <param name="intelToCopy">The intel to copy.</param> public AIntel(AIntel intelToCopy) { _currentCoverage = intelToCopy.CurrentCoverage; }
private string ConstructIntelText(AIntel intel) { string intelMsg = intel.CurrentCoverage.GetValueName(); string addendum = ". Intel is current."; var intelWithDatedCoverage = intel as Intel; if (intelWithDatedCoverage != null && intelWithDatedCoverage.IsDatedCoverageValid) { //D.Log("DateStamp = {0}, CurrentDate = {1}.", intelWithDatedCoverage.DateStamp, GameTime.Instance.CurrentDate); GameTimeDuration intelAge = new GameTimeDuration(intelWithDatedCoverage.DateStamp, GameTime.Instance.CurrentDate); addendum = String.Format(". Intel age {0}.", intelAge.ToString()); } intelMsg = intelMsg + addendum; D.Log(intelMsg); return intelMsg; }
public ColoredTextList_Intel(AIntel intel) { string intelText_formatted = ConstructIntelText(intel); _list.Add(new ColoredText(intelText_formatted)); }