AcademySquad.cs

Partial MatchController that completes the starting lineup with academy players. Guards the action with a CanCallAcademy check, sets a localized Russian or English club notice, then refreshes the lineup, bumps the revision and saves the career.

using Socer;

public sealed partial class MatchController
{
    public bool CanCallAcademy => Career!=null && ClubOpen && CanEditStartingLineup && !Career.HasRelegationChoice
        && !MediaLeagueActive && !QuickMatchRunning && !IsRulesPreview && !MatchTutorialActive;

    public void CompleteLineupFromAcademy()
    {
        if(!CanCallAcademy)return;
        bool completed=Career.CompleteAcademyLineup(BeforeKickoff);
        ClubNotice=completed
            ?GamePreferences.Russian?(Career.AcademyLoanCount>0?"Состав укомплектован. Воспитанники доступны бесплатно до замены своими игроками.":"Состав укомплектован вашими игроками.")
                :(Career.AcademyLoanCount>0?"Lineup completed. Academy players are free until replaced by your own players.":"Lineup completed with your players.")
            :GamePreferences.Russian?"Сейчас нельзя укомплектовать состав.":"The lineup cannot be completed right now.";
        if(completed){RefreshStartingLineup();Revision++;SaveCareer();}
    }
}