コード例 #1
0
 public static DraftCard ToData(this DraftCardViewModel viewModel)
 {
     return(new DraftCard()
     {
         ContractSalary = viewModel.WeeklySalary,
         ContractYears = viewModel.ContractLength,
         Round = viewModel.RoundNumber,
         MaxCurrentAbility = viewModel.MaximumAbility,
         MaxAge = viewModel.MaximumAge,
         TeamType = viewModel.TeamType,
         Team = viewModel.Team
     });
 }
コード例 #2
0
        private DraftCardViewModel GenerateBasicDraftCard(int pickNumber, int weeklySalary, int? maxAge = null, TeamType teamType = TeamType.Senior)
        {
            var vm = new DraftCardViewModel(core)
            {
                RoundNumber = pickNumber,
                ContractLength = 5,
                WeeklySalary = weeklySalary,
                TeamType = teamType
            };

            if (maxAge.HasValue)
            {
                vm.MaximumAge = maxAge.Value;
            }

            return vm;
        }