2021-07-09 11:03:30 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Text;
|
2022-01-22 08:57:59 +01:00
|
|
|
|
using System.Globalization;
|
2021-08-25 16:36:57 +02:00
|
|
|
|
using EDJournal;
|
2021-07-09 11:03:30 +02:00
|
|
|
|
|
2021-11-10 21:24:39 +01:00
|
|
|
|
namespace EliteBGS.BGS {
|
2022-02-11 13:01:42 +01:00
|
|
|
|
public class NonaDiscordLog : DiscordLogGenerator {
|
2021-07-09 11:03:30 +02:00
|
|
|
|
private string FormatDate() {
|
2022-01-22 08:57:59 +01:00
|
|
|
|
CultureInfo cultureInfo = CultureInfo.InvariantCulture;
|
2021-07-09 11:03:30 +02:00
|
|
|
|
StringBuilder date = new StringBuilder();
|
|
|
|
|
DateTime today = DateTime.Now;
|
|
|
|
|
string suffix;
|
|
|
|
|
|
|
|
|
|
if (today.Day == 1 || today.Day == 21 || today.Day == 31) {
|
|
|
|
|
suffix = "st";
|
|
|
|
|
} else if (today.Day == 2 || today.Day == 22) {
|
|
|
|
|
suffix = "nd";
|
|
|
|
|
} else {
|
|
|
|
|
suffix = "th";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
date.AppendFormat("{0} {1}{2}, {3}",
|
2022-01-22 08:57:59 +01:00
|
|
|
|
cultureInfo.DateTimeFormat.GetMonthName(today.Month),
|
|
|
|
|
today.Day, suffix,
|
2021-07-09 11:03:30 +02:00
|
|
|
|
today.Year + EliteDangerous.YearOffset
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return date.ToString();
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-11 13:01:42 +01:00
|
|
|
|
protected override string GenerateObjectiveHeader(Objective objective) {
|
|
|
|
|
StringBuilder log = new StringBuilder();
|
2022-01-10 18:58:50 +01:00
|
|
|
|
|
2022-02-11 13:01:42 +01:00
|
|
|
|
log.AppendFormat(":globe_with_meridians: `Location:` {0}\n", objective.ToShortString());
|
|
|
|
|
log.Append(":clipboard: `Conducted:`\n");
|
|
|
|
|
log.Append("```");
|
2022-01-27 23:23:15 +01:00
|
|
|
|
|
2022-02-11 13:01:42 +01:00
|
|
|
|
return log.ToString();
|
2022-01-10 18:58:50 +01:00
|
|
|
|
}
|
2021-09-28 14:14:16 +02:00
|
|
|
|
|
2022-02-11 13:01:42 +01:00
|
|
|
|
protected override string GenerateObjectiveFooter(Objective objective) {
|
|
|
|
|
return "```";
|
2022-01-23 17:05:43 +01:00
|
|
|
|
}
|
|
|
|
|
|
2022-02-11 13:01:42 +01:00
|
|
|
|
protected override string GenerateHeader() {
|
|
|
|
|
return string.Format(":clock2: `Date:` {0}", FormatDate());
|
2022-01-26 09:58:23 +01:00
|
|
|
|
}
|
|
|
|
|
|
2022-02-11 13:01:42 +01:00
|
|
|
|
protected override string GenerateFooter() {
|
|
|
|
|
return "";
|
2021-07-09 11:03:30 +02:00
|
|
|
|
}
|
2022-01-06 16:24:20 +01:00
|
|
|
|
|
|
|
|
|
public override string ToString() {
|
|
|
|
|
return "Nova Navy Log";
|
|
|
|
|
}
|
2021-07-09 11:03:30 +02:00
|
|
|
|
}
|
|
|
|
|
}
|