rimworld-animations-patch_m.../Source/Scripts/Defs/RimNudeData.cs
AbstractConcept 8e6918ae70 First commit
2022-09-09 20:22:08 -05:00

60 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using RimWorld;
namespace Rimworld_Animations_Patch
{
public class RimNudeData : IExposable
{
public string thingDef = "Invalid";
public bool coversGroin = false;
public bool coversBelly = false;
public bool coversChest = false;
public bool sexWear = false;
public RimNudeData() { }
public RimNudeData(ThingDef thingDef)
{
this.thingDef = thingDef.defName;
if (thingDef.apparel.bodyPartGroups.Contains(BodyPartGroupDefOf.Legs) || thingDef.apparel.bodyPartGroups.Contains(PatchBodyPartGroupDefOf.GenitalsBPG))
{ coversGroin = true; }
if (thingDef.apparel.bodyPartGroups.Contains(BodyPartGroupDefOf.Torso))
{ coversBelly = true; }
if (thingDef.apparel.bodyPartGroups.Contains(BodyPartGroupDefOf.Torso) || thingDef.apparel.bodyPartGroups.Contains(PatchBodyPartGroupDefOf.ChestBPG))
{ coversChest = true; }
this.sexWear = false;
}
public RimNudeData(string thingDef, bool coversGroin, bool coversBelly, bool coversChest, bool sexWear)
{
this.thingDef = thingDef;
this.coversGroin = coversGroin;
this.coversBelly = coversBelly;
this.coversChest = coversChest;
this.sexWear = sexWear;
}
public bool EquivalentTo(RimNudeData other)
{
return (thingDef == other.thingDef);
}
public void ExposeData()
{
Scribe_Values.Look(ref this.thingDef, "thingDef", "Invalid");
Scribe_Values.Look(ref this.coversGroin, "coversGroin", false);
Scribe_Values.Look(ref this.coversBelly, "coversBelly", false);
Scribe_Values.Look(ref this.coversChest, "coversChest", false);
Scribe_Values.Look(ref this.sexWear, "sexWear", false);
}
}
}