public static StreamSubscriptionMatch[] Match(IActorSystem system, StreamIdentity stream)
        {
            var specifications = DictionaryExtensions.Find(configuration, stream.Provider)
                                 ?? Enumerable.Empty <StreamSubscriptionSpecification>();

            return(Match(system, stream.Id, specifications));
        }
Ejemplo n.º 2
0
 private static Transform[] TranslateTransforms(Transform[] sources, TransformCatalog transformCatalog)
 {
     Transform[] targets = new Transform[sources.Length];
     for (int index = 0; index < sources.Length; index++)
     {
         targets[index] = DictionaryExtensions.Find(transformCatalog, sources[index].name);
     }
     return(targets);
 }
Ejemplo n.º 3
0
    private Transform[] TranslateTransforms(Transform[] source, TransformCatalog catalog)
    {
        Transform[] newTrans = new Transform[source.Length];

        for (int i = 0; i < newTrans.Length; i++)
        {
            newTrans[i] = DictionaryExtensions.Find(catalog, source[i].name);
        }

        return(newTrans);
    }
        internal static void Register(ActorType type)
        {
            foreach (var specification in StreamSubscriptionSpecification.From(type))
            {
                var specifications = DictionaryExtensions.Find(configuration, specification.Provider);

                if (specifications == null)
                {
                    specifications = new List <StreamSubscriptionSpecification>();
                    configuration.Add(specification.Provider, specifications);
                }

                specifications.Add(specification);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Remaps the bone structure from a given Transform, returning a new array of bones.
        /// </summary>
        /// <returns>An array of bone Transforms</returns>
        /// <param name="reference_geometry_bones">Reference geometry bones.</param>
        /// <param name="destination_bones">Destination bones.</param>
        public static Transform[] RemapBones(Transform[] reference_geometry_bones, Transform reference_root_bone, BoneUtility.BoneMap destination_bones, Transform destination_root_bone)
        {
            for (int i = 0; i < reference_geometry_bones.Length; i++)
            {
                BoneUtility.cleanAllBoneNames(reference_geometry_bones[i]);
            }

            var new_bones = new Transform[reference_geometry_bones.Length];

            for (var index = 0; index < reference_geometry_bones.Length; index++)
            {
                new_bones[index] = DictionaryExtensions.Find(destination_bones, reference_geometry_bones[index].name);
            }

            return(new_bones);
        }
        public Task Init(string name, IProviderRuntime pr, IProviderConfiguration pc)
        {
            Name = name;

            system = ClusterActorSystem.Initialized
                ? ClusterActorSystem.Current
                : ClientActorSystem.Current;

            specifications = DictionaryExtensions.Find(configuration, name)
                             ?? Enumerable.Empty <StreamSubscriptionSpecification>();

            var type = Type.GetType(pc.Properties[TypeKey]);

            pc.RemoveProperty(TypeKey);
            Debug.Assert(type != null);

            provider = (IStreamProviderImpl)Activator.CreateInstance(type);
            return(provider.Init(name, pr, pc));
        }
Ejemplo n.º 7
0
 public void FindFailsWithNullThis()
 {
     Assert.Throws <ArgumentNullException>(() =>
                                           DictionaryExtensions.Find <object, object>(null, null));
 }