コード例 #1
0
ファイル: Product.cs プロジェクト: ruche7/VoiCeUtil_OLD
 /// <summary>
 /// 静的コンストラクタ。
 /// </summary>
 static ProductExtension()
 {
     // Infos に全列挙値が含まれているか確認
     Debug.Assert(
         ((Product[])Enum.GetValues(typeof(Product)))
         .All(p => Infos.ContainsKey(p)));
 }
コード例 #2
0
        /// <summary>
        /// Recursively Populates the new order.
        /// </summary>
        /// <param name="newOrder">The new order.</param>
        /// <param name="type">The type.</param>
        /// <exception cref="System.ArgumentException">Cyclic dependency found.</exception>
        private void PopulateNewOrder(LinkedList <EntityDependencyNodeInfo> newOrder, EntityDependencyNodeInfo type)
        {
            if (newOrder.Contains(type))
            {
                // Already visited
                if (type.IsCurrentlyBeingProcessed)
                {
                    throw new ArgumentException("Cyclic dependency found.");
                }
                return;
            }

            type.IsCurrentlyBeingProcessed = true;

            foreach (var dependency in type.Dependencies.
                     Where(d => Infos.ContainsKey(d.Key)).
                     Select(d => new { Type = Infos[d.Key], DependentAttributes = d.Value }).
                     OrderByDescending(d => d.Type.Dependencies.Values.Any(v => v.IsRequired)).
                     ThenBy(d => d.Type.LogicalName))
            {
                if (dependency.Type.IsCurrentlyBeingProcessed)
                {
                    // Already Visited
                    dependency.DependentAttributes.IsCurrentlyCyclic = true;
                }
                else
                {
                    PopulateNewOrder(newOrder, dependency.Type);
                }
            }

            type.IsCurrentlyBeingProcessed = false;
            type.Node = newOrder.AddLast(type);
        }
コード例 #3
0
        /// <summary>
        /// 静的コンストラクタ。
        /// </summary>
        static ParameterIdExtension()
        {
            // Infos に全列挙値が含まれているか確認
            Debug.Assert(AllValues.All(p => Infos.ContainsKey(p)));

            // 全列挙値がマスター設定またはボイスプリセット設定であることを確認
            Debug.Assert(AllValues.All(p => p.IsMaster() || p.IsPreset()));
        }
コード例 #4
0
ファイル: ParameterId.cs プロジェクト: ruche7/VoiCeUtil_OLD
        /// <summary>
        /// 静的コンストラクタ。
        /// </summary>
        static ParameterIdExtension()
        {
            // Infos に全列挙値が含まれているか確認
            Debug.Assert(AllValues.All(p => Infos.ContainsKey(p)));

            // 全列挙値が音声効果設定またはボイスプリセット設定であることを確認
            Debug.Assert(AllValues.All(p => p.IsEffect() || p.IsPause()));
        }
コード例 #5
0
        /// <summary>
        /// 静的コンストラクタ。
        /// </summary>
        static ParameterIdExtension()
        {
            // Infos に全列挙値が含まれているか確認
            Debug.Assert(AllValues.All(p => Infos.ContainsKey(p)));

            // 全列挙値が音声効果関連または感情関連であることを確認
            Debug.Assert(AllValues.All(p => p.IsEffect() || p.IsEmotion()));
        }
コード例 #6
0
        public static AmmoInfo GetAmmoInfo(Type ammoType)
        {
            if (ammoType != null && Infos.ContainsKey(ammoType))
            {
                return(Infos[ammoType]);
            }

            return(null);
        }
コード例 #7
0
        /// <summary>
        /// Adds the specified logical name to the collection of entities that are mapped.  Entities are cached so no work is performed when an entity type is added a second time
        /// </summary>
        /// <param name="logicalName">Name of the logical.</param>
        public void Add(string logicalName)
        {
            lock (_readWriteLock)
            {
                if (Infos.ContainsKey(logicalName))
                {
                    // Already added Id type, nothing to do.
                    return;
                }

                CurrentVersion++;
                SingleThreadAdd(logicalName);
            }
        }
コード例 #8
0
        /// <summary>
        /// Adds the specified logical name to the collection of entities that are mapped.  Entities are cached so no work is performed when an entity type is added a second time
        /// </summary>
        /// <param name="logicalName">Name of the logical.</param>
        public void Add(string logicalName)
        {
            lock (_readWriteLock)
            {
                if (Infos.ContainsKey(logicalName))
                {
                    // Already added Id type, nothing to do.
                    return;
                }

                CurrentVersion++;
                SingleThreadAdd(logicalName);
                DependencyOrderLog.Enqueue($"Order: {string.Join(", ", Types.Select(t => t.LogicalName))}");
            }
        }
コード例 #9
0
        static void assertAllChunksHaveMatchingScene()
        {
#if !DEADLINE_APPROACHING
            bool ok = true;
            foreach (ChunkID c in Enum.GetValues(typeof(ChunkID)))
            {
                if (!Infos.ContainsKey(c))
                {
                    ok = false;
                    Debug.LogError("ChunkID " + c + " does NOT have a matching scene name!");
                }
            }
            Exit.If(!ok, "All ChunkIDs must have a matching scene name!");
#endif
        }
コード例 #10
0
        private void GenerateExceptions()
        {
            foreach (BuildInformation info in Aggregator.Informations.Values)
            {
                ExceptionInformation exception;
                if (Infos.ContainsKey(info.Name))
                {
                    exception = Infos[info.Name];
                    Generate(info.Name, exception);

                    if (info.Name == ComponentType.Core.ToString())
                    {
                        exception = Infos["BaseException"];
                        Generate(info.Name, exception);
                    }
                }
            }
        }
コード例 #11
0
ファイル: Cast.cs プロジェクト: ruche7/VoiCeUtil_OLD
 /// <summary>
 /// 静的コンストラクタ。
 /// </summary>
 static CastExtension()
 {
     // Infos に全列挙値が含まれているか確認
     Debug.Assert(AllValues.All(p => Infos.ContainsKey(p)));
 }