/// <summary> /// Обновляет данные игрока /// </summary> private static IEnumerable <RapperModel> GetRatingList(PlayerInfo playerInfo) { var rappers = RappersManager.GetRappers(); var ratingList = new RapperModel[rappers.Count + 1]; rappers.CopyTo(ratingList); ratingList[rappers.Count] = new RapperModel { Name = playerInfo.Name, Fans = playerInfo.Fans }; return(ratingList); }
/// <summary> /// Вычисляет согласие рэппера на фит или батл /// </summary> public static bool IsAgree(RapperModel rapper, int playerFans) { var percentage = (float)playerFans / rapper.Fans * 100; if (percentage < 1) { return(false); } if (percentage > 100) { return(true); } return(percentage >= Random.Range(1, 101)); }
/// <summary> /// Возвращает очки за флоу /// </summary> private static int GetFlowPoints(RapperModel rival) { var flowDifference = PlayerManager.GetSkills().Flow - rival.Flow; return(20 + flowDifference); }
/// <summary> /// Заполняет строку в рейтинге /// </summary> public void Setup(RapperModel model, int position, bool isPlayer) { PlayerIcon.gameObject.SetActive(isPlayer); Name.text = $"{position}. {model.Name}"; Fans.text = $"{NumberFormatter.FormatValue(model.Fans)}"; }