Ejemplo n.º 1
0
        public static List<DataCards.Facility> getFacilitiesFromXML()
        {
            List<DataCards.Facility> rtnFacilities = new List<DataCards.Facility>();

            //Pulls from the XML
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(_DataPath + _FacilitiesXMLPath);

            XmlNodeList xmlTerrainNodes = xmlDoc.GetElementsByTagName("Facility");

            foreach (XmlNode curNode in xmlTerrainNodes)
            {
                DataCards.Facility curFacility = new DataCards.Facility();

                //curFacility.ID = curNode.Attributes["ID"].InnerText;
                curFacility.Name = curNode.Attributes["Name"].InnerText;
                curFacility.HeaderText = curNode.Attributes["HeaderText"].InnerText;
                curFacility.Type = curNode.Attributes["Type"].InnerText;

                //////////////////////////////////////////////////
                //Get Manufacturing details. Make this a function when you need it for the next thing like ships..
                //////////////////////////////////////////////////////////////////////////////////////////////////////////
                GameEngine.Manufacturing curManu = new GameEngine.Manufacturing();

                XmlNodeList xmlChildNodes = curNode.ChildNodes;

                foreach (XmlNode curChildNodes in xmlChildNodes)
                {
                    //curWidgetData.addObjImage(new System.Drawing.Bitmap(curImgNode.Attributes["src"].InnerText));

                    if (curChildNodes.Name == "Manufacture")
                    {

                        XmlNodeList xmlChildNodes1 = curChildNodes.ChildNodes;

                        foreach (XmlNode curChildNodes1 in xmlChildNodes1)
                        {

                            if (curChildNodes1.Name == "Resources")
                            {
                                curManu.ResourceCost = Utilities.getIntOrN(curChildNodes1.InnerText, 0);
                            }
                            else if (curChildNodes1.Name == "ConstructionTime")
                            {
                                curManu.BaseConstructionTime = Utilities.getIntOrN(curChildNodes1.InnerText, 1);
                            }
                        }
                    }
                }

                //////////////////////////////////////////////////////////////////////////////////////////////////////////

                curFacility.baseManufactureCost = curManu;

                rtnFacilities.Add(curFacility);

            }

            return rtnFacilities;
        }
Ejemplo n.º 2
0
 public InvUnit()
 {
     startingLocation = "";
         invUnitType = new Model.DataCardType();
         iuFacility = new DataCards.Facility();
         _underConstruction = false;
         transitObj = new GameEngine.GalacticComponents.TravelObj();
         _remainingConstructionDays = 0;
 }
Ejemplo n.º 3
0
 public InvUnit()
 {
     startingLocation           = "";
     invUnitType                = new Model.DataCardType();
     iuFacility                 = new DataCards.Facility();
     _underConstruction         = false;
     transitObj                 = new GameEngine.GalacticComponents.TravelObj();
     _remainingConstructionDays = 0;
 }
Ejemplo n.º 4
0
 public InvUnit(DataCards.Facility invUnitFacility, string _startingPlanetName)
 {
     startingLocation = _startingPlanetName;
         invUnitType = Model.DataCardType.Facility;
         iuFacility = invUnitFacility;
         _underConstruction = false;
         transitObj = new GameEngine.GalacticComponents.TravelObj();
         _remainingConstructionDays = 0;
         id = getID();
 }
Ejemplo n.º 5
0
 public void startEntityConstruction(DataCards.Facility invUnitFacility, string _startingPlanetName)
 {
     startingLocation           = _startingPlanetName;
     invUnitType                = Model.DataCardType.Facility;
     iuFacility                 = invUnitFacility;
     _underConstruction         = true;
     transitObj                 = new GameEngine.GalacticComponents.TravelObj();
     _remainingConstructionDays = iuFacility.baseManufactureCost.BaseConstructionTime;
     id = getID();
 }
Ejemplo n.º 6
0
 public InvUnit(DataCards.Facility invUnitFacility, string _startingPlanetName)
 {
     startingLocation           = _startingPlanetName;
     invUnitType                = Model.DataCardType.Facility;
     iuFacility                 = invUnitFacility;
     _underConstruction         = false;
     transitObj                 = new GameEngine.GalacticComponents.TravelObj();
     _remainingConstructionDays = 0;
     id = getID();
 }
Ejemplo n.º 7
0
        //Methods
        public DataCards.Facility getFacilityByName(string strFacilityName)
        {
            DataCards.Facility rtnFacility = new DataCards.Facility();

            foreach (DataCards.Facility curFacility in _facilities)
            {
                if (curFacility.Name == strFacilityName)
                {
                    rtnFacility = curFacility;
                }
            }
            return rtnFacility;
        }
Ejemplo n.º 8
0
        public bool hasFacilityMFR()
        {
            bool blnReturn = false;

            foreach (GameEngine.PlayerInvObjs.InvUnit curUnit in Facilities)
            {
                DataCards.Facility curFacility = curUnit.iuFacility;
                if (curFacility.Type == Manufacturing.FacilityMFR)
                {
                    blnReturn = true;
                }
            }
            return(blnReturn);
        }
Ejemplo n.º 9
0
        public static List <DataCards.Facility> getFacilitiesFromXML()
        {
            List <DataCards.Facility> rtnFacilities = new List <DataCards.Facility>();

            //Pulls from the XML
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load(_DataPath + _FacilitiesXMLPath);

            XmlNodeList xmlTerrainNodes = xmlDoc.GetElementsByTagName("Facility");

            foreach (XmlNode curNode in xmlTerrainNodes)
            {
                DataCards.Facility curFacility = new DataCards.Facility();


                //curFacility.ID = curNode.Attributes["ID"].InnerText;
                curFacility.Name       = curNode.Attributes["Name"].InnerText;
                curFacility.HeaderText = curNode.Attributes["HeaderText"].InnerText;
                curFacility.Type       = curNode.Attributes["Type"].InnerText;


                //////////////////////////////////////////////////
                //Get Manufacturing details. Make this a function when you need it for the next thing like ships..
                //////////////////////////////////////////////////////////////////////////////////////////////////////////
                GameEngine.Manufacturing curManu = new GameEngine.Manufacturing();


                XmlNodeList xmlChildNodes = curNode.ChildNodes;

                foreach (XmlNode curChildNodes in xmlChildNodes)
                {
                    //curWidgetData.addObjImage(new System.Drawing.Bitmap(curImgNode.Attributes["src"].InnerText));


                    if (curChildNodes.Name == "Manufacture")
                    {
                        XmlNodeList xmlChildNodes1 = curChildNodes.ChildNodes;

                        foreach (XmlNode curChildNodes1 in xmlChildNodes1)
                        {
                            if (curChildNodes1.Name == "Resources")
                            {
                                curManu.ResourceCost = Utilities.getIntOrN(curChildNodes1.InnerText, 0);
                            }
                            else if (curChildNodes1.Name == "ConstructionTime")
                            {
                                curManu.BaseConstructionTime = Utilities.getIntOrN(curChildNodes1.InnerText, 1);
                            }
                        }
                    }
                }

                //////////////////////////////////////////////////////////////////////////////////////////////////////////

                curFacility.baseManufactureCost = curManu;

                rtnFacilities.Add(curFacility);
            }


            return(rtnFacilities);
        }
Ejemplo n.º 10
0
 public void startEntityConstruction(DataCards.Facility invUnitFacility, string _startingPlanetName)
 {
     startingLocation = _startingPlanetName;
         invUnitType = Model.DataCardType.Facility;
         iuFacility = invUnitFacility;
         _underConstruction = true;
         transitObj = new GameEngine.GalacticComponents.TravelObj();
         _remainingConstructionDays = iuFacility.baseManufactureCost.BaseConstructionTime;
         id = getID();
 }