/// <summary> /// 静的コンストラクタ。 /// </summary> static ProductExtension() { // Infos に全列挙値が含まれているか確認 Debug.Assert( ((Product[])Enum.GetValues(typeof(Product))) .All(p => Infos.ContainsKey(p))); }
/// <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); }
/// <summary> /// 静的コンストラクタ。 /// </summary> static ParameterIdExtension() { // Infos に全列挙値が含まれているか確認 Debug.Assert(AllValues.All(p => Infos.ContainsKey(p))); // 全列挙値がマスター設定またはボイスプリセット設定であることを確認 Debug.Assert(AllValues.All(p => p.IsMaster() || p.IsPreset())); }
/// <summary> /// 静的コンストラクタ。 /// </summary> static ParameterIdExtension() { // Infos に全列挙値が含まれているか確認 Debug.Assert(AllValues.All(p => Infos.ContainsKey(p))); // 全列挙値が音声効果設定またはボイスプリセット設定であることを確認 Debug.Assert(AllValues.All(p => p.IsEffect() || p.IsPause())); }
/// <summary> /// 静的コンストラクタ。 /// </summary> static ParameterIdExtension() { // Infos に全列挙値が含まれているか確認 Debug.Assert(AllValues.All(p => Infos.ContainsKey(p))); // 全列挙値が音声効果関連または感情関連であることを確認 Debug.Assert(AllValues.All(p => p.IsEffect() || p.IsEmotion())); }
public static AmmoInfo GetAmmoInfo(Type ammoType) { if (ammoType != null && Infos.ContainsKey(ammoType)) { return(Infos[ammoType]); } return(null); }
/// <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); } }
/// <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))}"); } }
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 }
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); } } } }
/// <summary> /// 静的コンストラクタ。 /// </summary> static CastExtension() { // Infos に全列挙値が含まれているか確認 Debug.Assert(AllValues.All(p => Infos.ContainsKey(p))); }