Ejemplo n.º 1
0
        public SystemsDamageSystemUnit(XmlNode node)
        {
            foreach (XmlAttribute attribute in node.Attributes)
            {
                switch (attribute.Name)
                {
                case "name":
                    UnitType = attribute.Value;
                    break;

                default:
                    throw new NotImplementedException("Unknown UNIT attribute: " + attribute.Name);
                }
            }

            foreach (XmlNode data in node.ChildNodes)
            {
                switch (data.NodeType)
                {
                case XmlNodeType.CDATA:
                    Settings = SystemsDamageUnitCode.Parse(data.InnerText);
                    break;

                case XmlNodeType.Element:
                    switch (data.Name)
                    {
                    default:
                        throw new NotImplementedException("Unknown element of UNIT: " + data.Name);
                    }
                }
            }
        }
        public SystemsDamageSystemUnit(XmlNode node)
        {
            foreach (XmlAttribute attribute in node.Attributes)
            {
                switch (attribute.Name)
                {
                    case "name":
                        this.unitType = attribute.Value.ToEnum<SystemsDamageSystemUnitType>();
                        break;

                    default:
                        throw new NotImplementedException("Unknown UNIT attribute: " + attribute.Name);
                }
            }

            foreach (XmlNode data in node.ChildNodes)
            {
                switch (data.NodeType)
                {
                    case XmlNodeType.CDATA:
                        this.unitSettings = SystemsDamageUnitCode.Parse(data.InnerText);
                        break;

                    case XmlNodeType.Element:
                        switch (data.Name)
                        {
                            default:
                                throw new NotImplementedException("Unknown element of UNIT: " + data.Name);
                        }
                }
            }
        }