mirror of
https://github.com/9ParsonsB/Pulsar.git
synced 2025-04-05 17:39:39 -04:00
Some invalid journal data is now handled Journals now use polymorphic deserialization Added Event names to all journal events Remove unused controllers
47 lines
1.1 KiB
C#
47 lines
1.1 KiB
C#
namespace Observatory.Framework.Files.Journal.Startup;
|
|
|
|
public class Reputation : JournalBase
|
|
{
|
|
public override string Event => "Reputation";
|
|
public float Empire { get; init; }
|
|
|
|
public float Federation { get; init; }
|
|
|
|
public float Independent { get; init; }
|
|
|
|
public float Alliance { get; init; }
|
|
|
|
public string EmpireText()
|
|
{
|
|
return GetReputationText(Empire);
|
|
}
|
|
|
|
public string FederationText()
|
|
{
|
|
return GetReputationText(Federation);
|
|
}
|
|
|
|
public string IndependentText()
|
|
{
|
|
return GetReputationText(Independent);
|
|
}
|
|
|
|
public string AllianceText()
|
|
{
|
|
return GetReputationText(Alliance);
|
|
}
|
|
|
|
private string GetReputationText(float rep)
|
|
{
|
|
var text = rep switch
|
|
{
|
|
float r when r > 90 => "allied",
|
|
float r when r > 35 => "friendly",
|
|
float r when r > 4 => "cordial",
|
|
float r when r > -35 => "neutral",
|
|
float r when r > -90 => "unfriendly",
|
|
_ => "hostile",
|
|
};
|
|
return text;
|
|
}
|
|
} |