Skip to content

Instantly share code, notes, and snippets.

@Neceros

Neceros/file.cs

Created Apr 24, 2020
Embed
What would you like to do?
Scribing IExposables
public class StuffWeight : IExposable
{
public ThingDef stuffDef;
public float originalWeight;
public float stuffMultiplier;
public ThingDef StuffDef
{
get
{
return stuffDef;
}
set
{
stuffDef = value;
}
}
public float OriginalWeight
{
get
{
return originalWeight;
}
set
{
originalWeight = value;
}
}
public float StuffMultiplier
{
get
{
return stuffMultiplier;
}
set
{
stuffMultiplier = value;
}
}
public void ExposeData()
{
Scribe_Values.Look(ref stuffDef, "stuffDef");
Scribe_Values.Look(ref originalWeight, "stuffDef");
Scribe_Values.Look(ref stuffMultiplier, "stuffDef");
}
}
public class SRWSettings : ModSettings
{
public static List<StuffWeight> stuffDefs;
public override void ExposeData()
{
base.ExposeData();
Scribe_Deep.Look(ref stuffDefs, "stuffDefs", LookMode.Value);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment