/// <summary> /// Generate a new random Hero with /// the Element. /// </summary> /// <param name="element"></param> /// <returns></returns> public static Hero GenerateHero(PlayerElement element) { Hero myHero = new Hero(); int Range1 = Convert.ToInt32( myHero.MyRes.GetString(element.ToString() + RangeStringInRes + 1)); int Range2 = Convert.ToInt32( myHero.MyRes.GetString(element.ToString() + RangeStringInRes + 2)); int nowInt = Randomic.GetRandom(Range1, Range2); myHero.SetHeroFromBlank(nowInt.ToString()); myHero.ServerIndex = Randomic.GetRandom(ServerManager.MIN_T, ServerManager.MAX_HEROES_INFO_SERVERS); return(myHero); // not completed yet. }
/// <summary> /// Generate a new random Hero with /// the Element. /// </summary> /// <param name="element"></param> /// <returns></returns> public static Hero GenerateHero(PlayerElement element) { Hero myHero = new Hero(); int Range1 = Convert.ToInt32( myHero.MyRes.GetString(element.ToString() + RangeStringInRes + 1)); int Range2 = Convert.ToInt32( myHero.MyRes.GetString(element.ToString() + RangeStringInRes + 2)); Random ran = new Random(); int nowInt = ran.Next(Range1, Range2 == Range1 ? Range2 : (Range2 + 1)); myHero.SetHeroFromBlank(nowInt.ToString()); return(myHero); // not completed yet. }