using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using RecrownedAthenaeum.DataTypes; using RecrownedAthenaeum.UI.Skin.Definitions; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace RecrownedAthenaeum.UI.Skin { public class Skin { TextureAtlas textureAtlas; Dictionary colors; Dictionary fonts; Dictionary> definitions; public Skin(TextureAtlas textureAtlas) { this.textureAtlas = textureAtlas; colors = new Dictionary(); fonts = new Dictionary(); definitions = new Dictionary>(); } public void Draw(string texture, string color, Rectangle region) { } public void AddDefinition(string definitionName, ISkinDefinition skinDefinition) { if (!definitions.ContainsKey(skinDefinition.UIModuleType)) { definitions.Add(skinDefinition.UIModuleType, new Dictionary()); } else if (definitions[skinDefinition.UIModuleType].ContainsKey(definitionName)) throw new ArgumentException("Type of definition with that name already exists!"); definitions[skinDefinition.UIModuleType].Add(definitionName, skinDefinition); } public void RemoveDefinition(string definitionName, Type definitionType) { if (definitions.ContainsKey(definitionType) && definitions[definitionType].ContainsKey(definitionName)) { definitions[definitionType].Remove(definitionName); } else { throw new ArgumentException("a definition of type " + definitionType.Name + " with a name of " + definitionName + " does not exist."); } } } }