worldbox-observer-mod/IdleSpectator/ChronicleCharacterSummary.cs

46 lines
1,004 B
C#

namespace IdleSpectator;
/// <summary>One row in the Lore panel Character History tab.</summary>
public sealed class ChronicleCharacterSummary
{
public long UnitId;
public string Name = "";
public string SpeciesId = "";
public int HistoryCount;
public bool IsFavorite;
public bool IsAlive;
public bool IsRecent;
public int RecentIndex = -1;
public string Title
{
get
{
if (string.IsNullOrEmpty(Name))
{
return SpeciesId ?? "creature";
}
if (string.IsNullOrEmpty(SpeciesId))
{
return Name;
}
return Name + " (" + SpeciesId + ")";
}
}
public string Detail
{
get
{
string hist = HistoryCount <= 0 ? "no history" : HistoryCount + " events";
if (IsRecent)
{
return "recent · " + hist;
}
return hist;
}
}
}