using System; using System.Collections; using System.Collections.Generic; using System.Text; using Cell.Core; namespace DOLC.ConfigReaders { [Serializable] public class RaceInfo { private string m_raceName; private int m_raceID; private Dictionary 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 Dictionary Stats { get { return m_stats; } set { m_stats = 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; } } } }