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 System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HarmonyLib;
using System.Reflection;
using Verse;
using HarmonyLib;
namespace RJWSexperience
{

View file

@ -1,11 +1,11 @@
using RimWorld;
using RJWSexperience.ExtensionMethods;
using Verse;
namespace RJWSexperience
{
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;
protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested)

View file

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

View file

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

View file

@ -8,7 +8,7 @@ namespace RJWSexperience
{
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;
}
}

View file

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