/// <summary> /// 随机1个性格 /// </summary> /// <returns></returns> public TemperamentData RandomTemperament() { //随机1个性格 int _index = RandomTool.Random(0, TemperamentDatas.Count); //返回值 return(TemperamentDatas[_index]); }
/// <summary> /// 随机[回复] /// (当Bear说话后,Bug需要回复一句话) /// </summary> /// <param name="_id">性格数据的编号</param> /// <returns>随机出来的话的编号</returns> public int RandomReply(int _id) { //首先,获取性格数据 TemperamentData _temperamentData = GetTemperament(_id); //然后,随机1个Bug的回复 int _randomIndex = RandomTool.Random(0, _temperamentData.BugStringInReply.Count); //返回值 return(_randomIndex); }
/// <summary> /// 随机[创建] /// (当创建1个Bug时,需要随机1个Bug说的话) /// </summary> /// <param name="_id">性格数据的编号</param> /// <param name="_bug">Bug说的话</param> public void RandomCreate(out int _id, out string _bug) { //随机1个性格 TemperamentData _temperamentData = RandomTemperament(); _id = _temperamentData.Id; //然后,随机1个Bug说的话 int _bugIndex = RandomTool.Random(0, _temperamentData.BugStringInCreate.Count); _bug = _temperamentData.BugStringInCreate[_bugIndex]; }