using System; using System.Collections.Generic; using System.Text; using Cell.Core; using System.Collections; namespace DOLC.ConfigReaders { [Serializable] public class RaceInfo { private string m_raceName; private int m_raceID; private RaceStat m_stats; public string RaceName { get { return m_raceName; } set { m_raceName = value; } } public int RaceID { get { return m_raceID; } set { m_raceID = value; } } public RaceStat Stats { get { return m_stats; } set { m_stats = value; } } } [Serializable] public class RaceStat { private int m_str = 0; private int m_con = 0; private int m_dex = 0; private int m_qui = 0; private int m_int = 0; private int m_pie = 0; private int m_emp = 0; private int m_cha = 0; public int Strength { get { return m_str; } set { m_str = value; } } public int Constitution { get { return m_con; } set { m_con = value; } } public int Dexterity { get { return m_dex; } set { m_dex = value; } } public int Quickness { get { return m_qui; } set { m_qui = value; } } public int Intelligence { get { return m_int; } set { m_int = value; } } public int Piety { get { return m_pie; } set { m_pie = value; } } public int Empathy { get { return m_emp; } set { m_emp = value; } } public int Charisma { get { return m_cha; } set { m_cha = value; } } } public class RaceConfig : XmlConfig, IEnumerable { private Dictionary m_races = new Dictionary(); public Dictionary Races { get { return m_raceName; } set { m_raceName = value; } } [NonSerialized] public RaceInfo this[int raceID] { get { return (m_races.ContainsKey(raceID) ? m_races[raceID] : null); } } [NonSerialized] public Dictionary.Enumerator GetEnumerator() { return m_races.GetEnumerator(); } /// /// Copies one derived class into another. /// /// The derived class to copy from. public override void Assign(XmlConfig cfg) { base.Assign(cfg); RaceConfig rcfg; if ((rcfg = cfg as RaceConfig) != null) { this.Races = rcfg.Races; } } } }