Example #1
0
        private static Factory LoadFactory(XmlTextReader xml)
        {
            int     x, y;
            string  type;
            Factory factory = null;

            x    = Int32.Parse(xml.GetAttribute("x"));
            y    = Int32.Parse(xml.GetAttribute("y"));
            type = xml.GetAttribute("type");

            if (type.Equals("AntiGravChassis"))
            {
                factory = new AntiGravChassisFactory(x, y);
            }
            else if (type.Equals("BipodChassis"))
            {
                factory = new BipodChassisFactory(x, y);
            }
            else if (type.Equals("TrackedChassis"))
            {
                factory = new TrackedChassisFactory(x, y);
            }
            else if (type.Equals("CannonWeapon"))
            {
                factory = new CannonWeaponFactory(x, y);
            }
            else if (type.Equals("MissilesWeapon"))
            {
                factory = new MissilesWeaponFactory(x, y);
            }
            else if (type.Equals("NuclearWeapon"))
            {
                factory = new NuclearWeaponFactory(x, y);
            }
            else if (type.Equals("PhasersWeapon"))
            {
                factory = new PhasersWeaponFactory(x, y);
            }
            else if (type.Equals("Electronics"))
            {
                factory = new ElectronicsFactory(x, y);
            }

            return(factory);
        }
Example #2
0
        private static Factory LoadFactory(XmlTextReader xml)
        {
            int x, y;
            string type;
            Factory factory = null;

            x = Int32.Parse(xml.GetAttribute("x"));
            y = Int32.Parse(xml.GetAttribute("y"));
            type = xml.GetAttribute("type");

            if (type.Equals("AntiGravChassis"))
                factory = new AntiGravChassisFactory(x, y);
            else if (type.Equals("BipodChassis"))
                factory = new BipodChassisFactory(x, y);
            else if (type.Equals("TrackedChassis"))
                factory = new TrackedChassisFactory(x, y);
            else if (type.Equals("CannonWeapon"))
                factory = new CannonWeaponFactory(x, y);
            else if (type.Equals("MissilesWeapon"))
                factory = new MissilesWeaponFactory(x, y);
            else if (type.Equals("NuclearWeapon"))
                factory = new NuclearWeaponFactory(x, y);
            else if (type.Equals("PhasersWeapon"))
                factory = new PhasersWeaponFactory(x, y);
            else if (type.Equals("Electronics"))
                factory = new ElectronicsFactory(x, y);

            return factory;
        }