* WiP Data Rework. * Convert stationstation to new map format. * stationstation.yml v2 * Update submodule
32 lines
1.0 KiB
C#
32 lines
1.0 KiB
C#
using SS14.Shared.Serialization;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using static Content.Shared.GameObjects.Components.Inventory.EquipmentSlotDefines;
|
|
|
|
namespace Content.Server.GameObjects
|
|
{
|
|
public class ClothingComponent : ItemComponent
|
|
{
|
|
public override string Name => "Clothing";
|
|
public SlotFlags SlotFlags = SlotFlags.PREVENTEQUIP; //Different from None, NONE allows equips if no slot flags are required
|
|
private List<string> slotstrings = new List<string>(); //serialization
|
|
|
|
public override void ExposeData(ObjectSerializer serializer)
|
|
{
|
|
base.ExposeData(serializer);
|
|
|
|
// TODO: Writing.
|
|
serializer.DataReadFunction("Slots", new List<string>(0), list =>
|
|
{
|
|
foreach (var slotflagsloaded in slotstrings)
|
|
{
|
|
SlotFlags |= (SlotFlags)Enum.Parse(typeof(SlotFlags), slotflagsloaded.ToUpper());
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|