Example #1
0
    void UpdateText(Pos pos, eTerrain terrain, HomelandsStructure structure)
    {
        string posString =
            _posText.text = pos._gridLoc.key();

        _terrainText.text   = terrain.ToString();
        _structureText.text = structure == null ? "" : structure.Describe();
    }
Example #2
0
        /// <summary>
        /// returns all objects in a required category
        /// </summary>
        /// <param name="eSelectedCategory"></param>
        /// <returns></returns>
        public ArrayList GetAllObjectsByCategory(eTerrain eSelectedCategory)
        {
            ArrayList arrAllCategoryObjects = new ArrayList();
            ////draw a random object set
            //#if (DEBUG)
            //     Random Randomizer.rnd = new Random(1);
            //#else
            //Random Randomizer.rnd = new Random();
            //#endif

            //get all objects  ,  get a random index and pick a random object
            XmlNodeList xndlstAllSetObjects = this.GetObjectsData().SelectSingleNode(".//" + eSelectedCategory.ToString()).SelectNodes(".//Object");

            //XmlNode xndRandomObject;


            foreach (XmlNode xndCategoryObject in xndlstAllSetObjects)
            {
                arrAllCategoryObjects.Add(ConvertXMLNodeToMapObject(xndCategoryObject));
            }


            return(arrAllCategoryObjects);
        }
Example #3
0
        public MapObject GetRandomObjectByCategory(eTerrain eSelectedCategory)
        {
            ////draw a random object set
            //#if (DEBUG)
            //     Random Randomizer.rnd = new Random(1);
            //#else
            //Random Randomizer.rnd = new Random();
            //#endif

            //get all objects  ,  get a random index and pick a random object
            XmlNodeList xndlstAllSetObjects = this.GetObjectsData().SelectSingleNode(".//" + eSelectedCategory.ToString()).SelectNodes(".//Object");
            XmlNode     xndRandomObject;

            int iRandomObjectIndex = Randomizer.rnd.Next(xndlstAllSetObjects.Count);

            xndRandomObject = xndlstAllSetObjects[iRandomObjectIndex];

            return(ConvertXMLNodeToMapObject(xndRandomObject));
        }