Created
April 24, 2020 07:43
-
-
Save Neceros/d1fb04cb7362380e4f2b64e974902f14 to your computer and use it in GitHub Desktop.
Scribing IExposables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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