convenience constructors added for skin serializable.

This commit is contained in:
Harrison Deng 2019-01-26 22:11:01 -06:00
parent 6df8386841
commit cf9c27456d

View File

@ -1,4 +1,5 @@
using RecrownedAthenaeum.UI.Skin.Definitions;
using Microsoft.Xna.Framework;
using RecrownedAthenaeum.UI.Skin.Definitions;
namespace RecrownedAthenaeum.Data
{
@ -66,7 +67,21 @@ namespace RecrownedAthenaeum.Data
/// <summary>
/// RGBA data of this color.
/// </summary>
public int r, g, b, a;
public byte r, g, b, a;
/// <summary>
/// Sets values for data.
/// </summary>
/// <param name="name">the name to be referenced by.</param>
/// <param name="color">The color value <paramref name="name"/> represents.</param>
public ColorData(string name, Color color)
{
this.name = name;
r = color.R;
g = color.G;
b = color.B;
a = color.A;
}
}
/// <summary>
@ -82,6 +97,17 @@ namespace RecrownedAthenaeum.Data
/// The skin definition data.
/// </summary>
public ISkinDefinitionData skin;
/// <summary>
/// Sets values for data.
/// </summary>
/// <param name="name">The name to be referenced by.</param>
/// <param name="skinDefinitionData">The skin data.</param>
public DefinitionData(string name, ISkinDefinitionData skinDefinitionData)
{
this.name = name;
skin = skinDefinitionData;
}
}
}
}