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(); }
/// <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); }
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)); }