예제 #1
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();
 }
예제 #2
0
 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;
 }
예제 #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
 public string GetCursorHudText(AIntel intel, ShipReport[] elementReports, bool includeUnknown = true) {
     return GetText(DisplayTargetID.CursorHud, _gameMgr.UserPlayer, intel, elementReports, includeUnknown);
 }
예제 #5
0
 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);
 }
예제 #7
0
 /// <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;
 }
예제 #8
0
 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;
 }
예제 #9
0
 public ColoredTextList_Intel(AIntel intel) {
     string intelText_formatted = ConstructIntelText(intel);
     _list.Add(new ColoredText(intelText_formatted));
 }