Load() public method

public Load ( System.Xml.Linq.XElement shipDesign, GameMain gameMain ) : void
shipDesign System.Xml.Linq.XElement
gameMain GameMain
return void
Esempio n. 1
0
        public void Load(XElement empireDoc, Empire empire, GameMain gameMain)
        {
            var currentDesigns = empireDoc.Element("CurrentShipDesigns");

            foreach (var currentDesign in currentDesigns.Elements())
            {
                var currentShip = new Ship();
                currentShip.Load(currentDesign, gameMain);
                currentShip.Owner = empire;
                CurrentDesigns.Add(currentShip);
            }

            /*var obsoleteDesigns = empireDoc.Element("ObsoleteShipDesigns");
             * foreach (var obsoleteDesign in obsoleteDesigns.Elements())
             * {
             *      var obsoleteShip = new Ship();
             *      obsoleteShip.Load(obsoleteDesign, gameMain);
             *      obsoleteShip.Owner = empire;
             *      ObsoleteDesigns.Add(obsoleteShip);
             * }*/
            var fleets = empireDoc.Element("Fleets");

            foreach (var fleet in fleets.Elements())
            {
                var newFleet = new Fleet();
                newFleet.Load(fleet, this, empire, gameMain);
                _fleets.Add(newFleet);
            }
        }
Esempio n. 2
0
 public void Load(XElement empireDoc, Empire empire, GameMain gameMain)
 {
     var currentDesigns = empireDoc.Element("CurrentShipDesigns");
     foreach (var currentDesign in currentDesigns.Elements())
     {
         var currentShip = new Ship();
         currentShip.Load(currentDesign, gameMain);
         currentShip.Owner = empire;
         CurrentDesigns.Add(currentShip);
     }
     /*var obsoleteDesigns = empireDoc.Element("ObsoleteShipDesigns");
     foreach (var obsoleteDesign in obsoleteDesigns.Elements())
     {
         var obsoleteShip = new Ship();
         obsoleteShip.Load(obsoleteDesign, gameMain);
         obsoleteShip.Owner = empire;
         ObsoleteDesigns.Add(obsoleteShip);
     }*/
     var fleets = empireDoc.Element("Fleets");
     foreach (var fleet in fleets.Elements())
     {
         var newFleet = new Fleet();
         newFleet.Load(fleet, this, empire, gameMain);
         _fleets.Add(newFleet);
     }
 }