Remove some more code warnings

This commit is contained in:
amevarashi 2022-04-03 22:20:14 +05:00
parent 99d3d18d8a
commit 89439d1f32
6 changed files with 207 additions and 216 deletions

View file

@ -1,12 +1,6 @@
using System; using HarmonyLib;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection; using System.Reflection;
using Verse; using Verse;
using HarmonyLib;
namespace RJWSexperience namespace RJWSexperience
{ {

View file

@ -1,11 +1,11 @@
using RimWorld; using RimWorld;
using RJWSexperience.ExtensionMethods;
using Verse; using Verse;
namespace RJWSexperience namespace RJWSexperience
{ {
public class CumOutcomeDoers : IngestionOutcomeDoer public class CumOutcomeDoers : IngestionOutcomeDoer
{ {
[System.Diagnostics.CodeAnalysis.SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
public float unitAmount = 1.0f; public float unitAmount = 1.0f;
protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested) protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested)

View file

@ -282,8 +282,7 @@ namespace RJWSexperience
foreach (KeyValuePair<string, SexPartnerHistoryRecord> element in histories) foreach (KeyValuePair<string, SexPartnerHistoryRecord> element in histories)
{ {
element.Value.parent = this; element.Value.PartnerID = element.Key;
element.Value.partnerID = element.Key;
} }
} }
base.PostExposeData(); base.PostExposeData();

View file

@ -1,20 +1,15 @@
using System; using RimWorld;
using rjw;
using RJWSexperience.ExtensionMethods;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RimWorld;
using Verse; using Verse;
using rjw;
using UnityEngine;
using RJWSexperience.ExtensionMethods;
namespace RJWSexperience namespace RJWSexperience
{ {
public class SexPartnerHistoryRecord : IExposable public class SexPartnerHistoryRecord : IExposable
{ {
public SexPartnerHistory parent; public string PartnerID { get; set; }
public string partnerID;
protected Pawn partner = null; protected Pawn partner = null;
protected string namecache; protected string namecache;
@ -70,7 +65,7 @@ namespace RJWSexperience
{ {
if (!cannotLoadPawnData && partner == null) if (!cannotLoadPawnData && partner == null)
{ {
LoadPartnerPawn(partnerID); LoadPartnerPawn(PartnerID);
if (partner == null) cannotLoadPawnData = true; if (partner == null) cannotLoadPawnData = true;
} }
return partner; return partner;

View file

@ -8,7 +8,7 @@ namespace RJWSexperience
{ {
get get
{ {
if (pawn?.health?.hediffSet?.HasHediff(VariousDefOf.CumAddiction) ?? false) return minimumValueforStage.Count; if (pawn?.health?.hediffSet?.HasHediff(VariousDefOf.CumAddiction) ?? false) return MinimumValueforStage.Count;
return base.CurStageIndex; return base.CurStageIndex;
} }
} }

View file

@ -1,5 +1,6 @@
using RimWorld; using RimWorld;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
namespace RJWSexperience namespace RJWSexperience
{ {
@ -8,7 +9,9 @@ namespace RJWSexperience
/// </summary> /// </summary>
public class ThoughtDef_Recordbased : ThoughtDef public class ThoughtDef_Recordbased : ThoughtDef
{ {
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
public RecordDef recordDef; public RecordDef recordDef;
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
public List<float> minimumValueforStage = new List<float>(); public List<float> minimumValueforStage = new List<float>();
} }
@ -18,17 +21,17 @@ namespace RJWSexperience
public class Thought_Recordbased : Thought_Memory public class Thought_Recordbased : Thought_Memory
{ {
protected ThoughtDef_Recordbased Def => (ThoughtDef_Recordbased)def; protected ThoughtDef_Recordbased Def => (ThoughtDef_Recordbased)def;
protected RecordDef recordDef => Def.recordDef; protected RecordDef RecordDef => Def.recordDef;
protected List<float> minimumValueforStage => Def.minimumValueforStage; protected List<float> MinimumValueforStage => Def.minimumValueforStage;
public override int CurStageIndex public override int CurStageIndex
{ {
get get
{ {
float value = pawn?.records?.GetValue(recordDef) ?? 0f; float value = pawn?.records?.GetValue(RecordDef) ?? 0f;
for (int i = minimumValueforStage.Count - 1; i > 0; i--) for (int i = MinimumValueforStage.Count - 1; i > 0; i--)
{ {
if (minimumValueforStage[i] < value) return i + 1; if (MinimumValueforStage[i] < value) return i + 1;
} }
return 0; return 0;
} }