public static List <EntitySlot.Type> GetEntitySlotTypes(IEntitySlot entitySlot) { if (entitySlot is EntitySlot) { return(((EntitySlot)entitySlot).allowedTypes); } else if (entitySlot is EntitySlotData) { return(ConvertSlotTypes(((EntitySlotData)entitySlot).allowedTypes)); } throw new System.Exception("Unknown EntitySlotType " + entitySlot.GetType()); }