public override void ExposeData(ObjectSerializer serializer) { base.ExposeData(serializer); // TODO: Writing if (serializer.Reading) { DamageType damageType = DamageType.Total; int damageValue = 0; serializer.DataReadFunction("thresholdtype", DamageType.Total, type => damageType = type); serializer.DataReadFunction("thresholdvalue", 0, val => damageValue = val); Threshold = new DamageThreshold(damageType, damageValue, ThresholdType.Destruction); } }
public override void ExposeData(ObjectSerializer serializer) { base.ExposeData(serializer); serializer.DataReadFunction( "schedules", new List <ScheduledSound>(), schedules => schedules.ForEach(AddScheduledSound)); }
public override void ExposeData(ObjectSerializer serializer) { base.ExposeData(serializer); // TODO: Writing. serializer.DataReadFunction("resistanceset", "honk", name => { Resistances = ResistanceSet.GetResistanceSet(name); }); }
public override void ExposeData(ObjectSerializer serializer) { base.ExposeData(serializer); serializer.DataReadWriteFunction("keys", new List <string>(), (list) => FillConfiguration(list, _config, ""), () => _config.Keys.ToList()); serializer.DataReadFunction("validation", "^[a-zA-Z0-9 ]*$", value => _validation = new Regex("^[a-zA-Z0-9 ]*$", RegexOptions.Compiled)); }
public void ExposeData(ObjectSerializer serializer) { foreach (DamageType damageType in Enum.GetValues(typeof(DamageType))) { var resistanceName = damageType.ToString().ToLower(); serializer.DataReadFunction(resistanceName, new ResistanceSetSettings(), resistanceSetting => { _resistances[damageType] = resistanceSetting; }); } }
public override void ExposeData(ObjectSerializer serializer) { base.ExposeData(serializer); serializer.DataReadFunction <string>("seed", null, (s) => { if (!string.IsNullOrEmpty(s)) { Seed = _prototypeManager.Index <Seed>(s); } }); }
public SlotFlags SlotFlags = SlotFlags.PREVENTEQUIP; //Different from None, NONE allows equips if no slot flags are required public override void ExposeData(ObjectSerializer serializer) { base.ExposeData(serializer); // TODO: Writing. serializer.DataReadFunction("Slots", new List <string>(0), list => { foreach (var slotflagsloaded in list) { SlotFlags |= (SlotFlags)Enum.Parse(typeof(SlotFlags), slotflagsloaded.ToUpper()); } }); }
public override void ExposeData(ObjectSerializer serializer) { base.ExposeData(serializer); serializer.DataField(ref _clothingEquippedPrefix, "ClothingPrefix", null); // TODO: Writing. serializer.DataReadFunction("Slots", new List <string>(0), list => { foreach (var slotflagsloaded in list) { SlotFlags |= (SlotFlags)Enum.Parse(typeof(SlotFlags), slotflagsloaded.ToUpper()); } }); serializer.DataField(ref _quickEquipEnabled, "QuickEquip", true); serializer.DataFieldCached(ref _heatResistance, "HeatResistance", 323); }