mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
Restructuring, some sorting into folders
This commit is contained in:
parent
ac1fdc99be
commit
31e96bd5e3
36 changed files with 80 additions and 65 deletions
70
Source/Genes/Life_Force/UI/Alert_LowFertilin.cs
Normal file
70
Source/Genes/Life_Force/UI/Alert_LowFertilin.cs
Normal file
|
@ -0,0 +1,70 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using RimWorld.Planet;
|
||||
using Verse;
|
||||
using RimWorld;
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Alert_CriticalFertilin : Alert
|
||||
{
|
||||
private List<GlobalTargetInfo> Targets
|
||||
{
|
||||
get
|
||||
{
|
||||
this.CalculateTargets();
|
||||
return this.targets;
|
||||
}
|
||||
}
|
||||
|
||||
public override string GetLabel()
|
||||
{
|
||||
if (this.Targets.Count == 1)
|
||||
{
|
||||
return "AlertLowFertilin".Translate() + ": " + this.targetLabels[0];
|
||||
}
|
||||
return "AlertLowFertilin".Translate();
|
||||
}
|
||||
|
||||
private void CalculateTargets()
|
||||
{
|
||||
this.targets.Clear();
|
||||
this.targetLabels.Clear();
|
||||
if (!ModsConfig.BiotechActive)
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (Pawn pawn in PawnsFinder.AllMapsCaravansAndTravelingTransportPods_Alive)
|
||||
{
|
||||
if (pawn.RaceProps.Humanlike && pawn.Faction == Faction.OfPlayer)
|
||||
{
|
||||
Pawn_GeneTracker genes = pawn.genes;
|
||||
Gene_LifeForce gene_Lifeforce = (genes != null) ? genes.GetFirstGeneOfType<Gene_LifeForce>() : null;
|
||||
if (gene_Lifeforce != null && gene_Lifeforce.Value < gene_Lifeforce.MinLevelForAlert)
|
||||
{
|
||||
this.targets.Add(pawn);
|
||||
this.targetLabels.Add(pawn.NameShortColored.Resolve());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override TaggedString GetExplanation()
|
||||
{
|
||||
return "AlertLowFertilinDesc".Translate() + ":\n" + this.targetLabels.ToLineList(" - ");
|
||||
}
|
||||
|
||||
public override AlertReport GetReport()
|
||||
{
|
||||
return AlertReport.CulpritsAre(this.Targets);
|
||||
}
|
||||
|
||||
// Token: 0x04004B5C RID: 19292
|
||||
private List<GlobalTargetInfo> targets = new List<GlobalTargetInfo>();
|
||||
|
||||
// Token: 0x04004B5D RID: 19293
|
||||
private List<string> targetLabels = new List<string>();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue