mirror of
https://github.com/amevarashi/RJW-Sexperience.git
synced 2024-08-14 23:54:08 +00:00
Move PreceptComp_KnowsMemoryThoughtTagged to a separate file
This commit is contained in:
parent
53ece7a513
commit
5a3a700535
2 changed files with 41 additions and 35 deletions
|
@ -0,0 +1,41 @@
|
|||
using RimWorld;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Verse;
|
||||
|
||||
namespace RJWSexperience.Ideology.Precepts
|
||||
{
|
||||
public class PreceptComp_KnowsMemoryThoughtTagged : PreceptComp_KnowsMemoryThought
|
||||
{
|
||||
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
|
||||
public string tag;
|
||||
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
|
||||
public bool exclusive = false;
|
||||
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
|
||||
public bool applyonpartner = false;
|
||||
|
||||
public PreceptComp_KnowsMemoryThoughtTagged() { }
|
||||
|
||||
public override void Notify_MemberWitnessedAction(HistoryEvent ev, Precept precept, Pawn member)
|
||||
{
|
||||
if (!applyonpartner && ev.args.TryGetArg(HistoryEventArgsNamesCustom.Partner, out Pawn pawn) && pawn == member)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (tag != null)
|
||||
{
|
||||
if (ev.args.TryGetArg(HistoryEventArgsNamesCustom.Tag, out string tags))
|
||||
{
|
||||
if (IdeoUtility.ContainAll(tags, tag.Replace(" ", "").Split(',')) ^ exclusive) base.Notify_MemberWitnessedAction(ev, precept, member);
|
||||
}
|
||||
else if (exclusive)
|
||||
{
|
||||
base.Notify_MemberWitnessedAction(ev, precept, member);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
base.Notify_MemberWitnessedAction(ev, precept, member);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -62,39 +62,4 @@ namespace RJWSexperience.Ideology.Precepts
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class PreceptComp_KnowsMemoryThoughtTagged : PreceptComp_KnowsMemoryThought
|
||||
{
|
||||
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
|
||||
public string tag;
|
||||
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
|
||||
public bool exclusive = false;
|
||||
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
|
||||
public bool applyonpartner = false;
|
||||
|
||||
public PreceptComp_KnowsMemoryThoughtTagged() { }
|
||||
|
||||
public override void Notify_MemberWitnessedAction(HistoryEvent ev, Precept precept, Pawn member)
|
||||
{
|
||||
if (!applyonpartner && ev.args.TryGetArg(HistoryEventArgsNamesCustom.Partner, out Pawn pawn) && pawn == member)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (tag != null)
|
||||
{
|
||||
if (ev.args.TryGetArg(HistoryEventArgsNamesCustom.Tag, out string tags))
|
||||
{
|
||||
if (IdeoUtility.ContainAll(tags, tag.Replace(" ", "").Split(',')) ^ exclusive) base.Notify_MemberWitnessedAction(ev, precept, member);
|
||||
}
|
||||
else if (exclusive)
|
||||
{
|
||||
base.Notify_MemberWitnessedAction(ev, precept, member);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
base.Notify_MemberWitnessedAction(ev, precept, member);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue