Browse Source

IResourceObjects are now tagged with their type.

improved_timing
Ian Burgmyer 7 years ago
parent
commit
34be27be97
  1. 2
      DotSDL/Graphics/SdlWindow.cs
  2. 5
      DotSDL/IResourceObject.cs
  3. 10
      DotSDL/ResourceManager.cs
  4. 2
      DotSDL/ResourceType.cs

2
DotSDL/Graphics/SdlWindow.cs

@ -22,6 +22,8 @@ namespace DotSDL.Graphics {
/// <summary><c>true</c> if this <see cref="SdlWindow"/> instance has been destroyed, othersize <c>false</c>.</summary>
public bool IsDestroyed { get; set; }
public ResourceType ResourceType => ResourceType.Window;
/// <summary>The width of the user window.</summary>
public int WindowWidth { get; }
/// <summary>The height of the user window.</summary>

5
DotSDL/IResourceObject.cs

@ -8,6 +8,11 @@
/// </summary>
bool IsDestroyed { get; set; }
/// <summary>
/// The type of resource contained in this instance.
/// </summary>
ResourceType ResourceType { get; }
/// <summary>
/// Destroys this <see cref="IResourceObject"/>.
/// </summary>

10
DotSDL/ResourceManager.cs

@ -27,16 +27,6 @@ namespace DotSDL {
return _resources.FirstOrDefault(e => e.GetResourceId() == id);
}
/// <summary>
/// Retrieves all resources matching a given type.
/// </summary>
/// <param name="type">The <see cref="ResourceType"/> that should be returned.</param>
/// <returns>A collection of <see cref="Resource"/>s matching the type given in <paramref name="type"/>.</returns>
internal IEnumerable<IResourceObject> GetResourceByType(string type) {
//return _resources.Where(e => e is typeof(type));
throw new NotImplementedException();
}
/// <summary>
/// Registers a resource with the <see cref="ResourceManager"/>.
/// </summary>

2
DotSDL/ResourceType.cs

@ -2,7 +2,7 @@
/// <summary>
/// Indicates a specific type of resource.
/// </summary>
internal enum ResourceType {
public enum ResourceType {
/// <summary>
/// An SDL_Window resource.
/// </summary>

Loading…
Cancel
Save