Files
Nitrox/NitroxServer-Subnautica/GameLogic/Entities/Spawning/SlotsHelper.cs
2025-07-06 00:23:46 +02:00

35 lines
1.3 KiB
C#

using System.Collections.Generic;
namespace NitroxServer_Subnautica.GameLogic.Entities.Spawning
{
public static class SlotsHelper
{
private static Dictionary<EntitySlotData.EntitySlotType, EntitySlot.Type> typeMapping = new Dictionary<EntitySlotData.EntitySlotType, EntitySlot.Type>
{
{ EntitySlotData.EntitySlotType.Small, EntitySlot.Type.Small },
{ EntitySlotData.EntitySlotType.Medium, EntitySlot.Type.Medium },
{ EntitySlotData.EntitySlotType.Large, EntitySlot.Type.Large },
{ EntitySlotData.EntitySlotType.Tall, EntitySlot.Type.Tall },
{ EntitySlotData.EntitySlotType.Creature, EntitySlot.Type.Creature }
};
public static List<EntitySlot.Type> ConvertSlotTypes(EntitySlotData.EntitySlotType entitySlotType)
{
List<EntitySlot.Type> slotsTypes = new List<EntitySlot.Type>();
foreach (KeyValuePair<EntitySlotData.EntitySlotType, EntitySlot.Type> mapping in typeMapping)
{
EntitySlotData.EntitySlotType slotType = mapping.Key;
EntitySlot.Type type = mapping.Value;
if ((entitySlotType & slotType) == slotType)
{
slotsTypes.Add(type);
}
}
return slotsTypes;
}
}
}