/// <summary> /// Initializes a new instance of the <see cref="Resources{T}" /> class. /// </summary> public Resources() { Resource[] collection = null; if (typeof(T).IsEnum) { var resources = ResourceCollection.GetResources(typeof(T)); if (resources != null) { var names = Enum.GetNames(typeof(T)); var ids = new int[names.Length]; int maxId = 0; for (var i = 0; i < names.Length; i++) { var id = (int)Enum.Parse(typeof(T), names[i]); ids[i] = id; if (maxId < id) { maxId = id; } } collection = new Resource[names.Length]; for (var i = 0; i < names.Length; i++) { var name = names[i]; Resource data; if (resources.TryGetValue(name, out data)) { collection[ids[i]] = data; } } } } this.resources = collection; }
public Resources GetSimulation(Resources.ResourcesType type) { return(resourcesSimu.GetResources(type)); }
public Resources GetResources(Resources.ResourcesType type) { return(resourcesConf.GetResources(type)); }
private GFResource[] GetResources() { return(m_ResourceCollection.GetResources()); }