/// <summary> /// Полное редактирование игрока с сохранением /// </summary> /// <param name="editedPl"></param> /// <param name="pl"></param> private void FullPLayerEditing(IFootballPlayer editedPl, IFootballPlayer pl) { FootballPlayerCalculator calculator = new FootballPlayerCalculator(); (pl as FootballPlayer).CountGames += editedPl.CountGames; (pl as FootballPlayer).Rating = calculator.CalculationRating(pl, editedPl.Rating); (pl as FootballPlayer).BasicPlayPosition = editedPl.BasicPlayPosition; (pl as FootballPlayer).Name = editedPl.Name; for (int i = 0; i < pl.ParameterPlayerList.Count; i++) { for (byte j = 0; j < pl.ParameterPlayerList[i].SubParameterList.Count; j++) { SubParameterPlayer subParamPL = (pl.ParameterPlayerList[i].SubParameterList[j] as SubParameterPlayer); ISubParameterPlayer subParamEditePl = editedPl.ParameterPlayerList[i].SubParameterList[j]; subParamPL.Failed += subParamEditePl.Failed; subParamPL.SuccessFully += subParamEditePl.SuccessFully; } } calculator.CalculationEfiiciencyParameters(pl); (pl as FootballPlayer).BasicPlayPositionEff = calculator.CalculationEfiiciencyPosition(pl, pl.BasicPlayPosition); _players.Loader.SavePlayer(pl); SaveDataForChart(pl, calculator); }
/// <summary> /// Редактировать под параметер /// </summary> /// <param name="subParam"></param> /// <param name="successFully"></param> /// <param name="failed"></param> public void EditSubParameter(ref ISubParameterPlayer subParam, uint successFully, uint failed) { SubParameterPlayer sParam = (subParam as SubParameterPlayer); sParam.SuccessFully = successFully; sParam.Failed = failed; CheckChanges(); }