コード例 #1
0
        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);
            }
        }
コード例 #2
0
        public override void ExposeData(ObjectSerializer serializer)
        {
            base.ExposeData(serializer);

            serializer.DataReadFunction(
                "schedules",
                new List <ScheduledSound>(),
                schedules => schedules.ForEach(AddScheduledSound));
        }
コード例 #3
0
        public override void ExposeData(ObjectSerializer serializer)
        {
            base.ExposeData(serializer);

            // TODO: Writing.
            serializer.DataReadFunction("resistanceset", "honk", name =>
            {
                Resistances = ResistanceSet.GetResistanceSet(name);
            });
        }
コード例 #4
0
        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));
        }
コード例 #5
0
 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;
         });
     }
 }
コード例 #6
0
        public override void ExposeData(ObjectSerializer serializer)
        {
            base.ExposeData(serializer);

            serializer.DataReadFunction <string>("seed", null,
                                                 (s) =>
            {
                if (!string.IsNullOrEmpty(s))
                {
                    Seed = _prototypeManager.Index <Seed>(s);
                }
            });
        }
コード例 #7
0
        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());
                }
            });
        }
コード例 #8
0
        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);
        }