Even more documentation.

This commit is contained in:
2019-01-14 01:26:46 -06:00
parent 40c7772559
commit b019b7cf10
16 changed files with 368 additions and 46 deletions

View File

@@ -27,9 +27,9 @@ namespace RecrownedAthenaeum.UI.Skin
Dictionary<Type, Dictionary<string, ISkinDefinition>> definitions;
/// <summary>
///
/// Creates a basic unfilled skin.
/// </summary>
/// <param name="textureAtlas"></param>
/// <param name="textureAtlas">The texture atlas to use for this skin.</param>
public Skin(TextureAtlas textureAtlas)
{
this.textureAtlas = textureAtlas;
@@ -38,7 +38,16 @@ namespace RecrownedAthenaeum.UI.Skin
definitions = new Dictionary<Type, Dictionary<string, ISkinDefinition>>();
}
public void Draw(string regionName, string color, SpriteBatch batch, Rectangle destination, Type type, float rotation = 0, Vector2 origin = default(Vector2))
/// <summary>
/// Draws a region from the texture atlas.
/// </summary>
/// <param name="regionName">Region to draw.</param>
/// <param name="color">The color to tint the region.</param>
/// <param name="batch">The batch to use.</param>
/// <param name="destination">The destination to draw to.</param>
/// <param name="rotation">The rotation to use in radians.</param>
/// <param name="origin">The origin for the rotation.</param>
public void Draw(string regionName, string color, SpriteBatch batch, Rectangle destination, float rotation = 0, Vector2 origin = default(Vector2))
{
textureAtlas.Draw(regionName, batch, destination, colors[color], rotation, origin);
}
@@ -90,6 +99,11 @@ namespace RecrownedAthenaeum.UI.Skin
return ObtainDefinition<T>(null, type);
}
/// <summary>
/// Adds the definition.
/// </summary>
/// <param name="definitionName">The name of the definition.</param>
/// <param name="skinDefinition">The definition itself.</param>
public void AddDefinition(string definitionName, ISkinDefinition skinDefinition)
{
if (!definitions.ContainsKey(skinDefinition.UIModuleType))
@@ -100,6 +114,11 @@ namespace RecrownedAthenaeum.UI.Skin
definitions[skinDefinition.UIModuleType].Add(definitionName, skinDefinition);
}
/// <summary>
/// Removes the definition.
/// </summary>
/// <param name="definitionName">The name of the definition.</param>
/// <param name="definitionType">The type of the definition.</param>
public void RemoveDefinition(string definitionName, Type definitionType)
{
if (definitions.ContainsKey(definitionType) && definitions[definitionType].ContainsKey(definitionName))