コード例 #1
0
        public int MaximumAllowedFishesThatCanCatch(FisherMan fisherMan)
        {
            string[] blackListNames = BlakListRepository.GetAllNames();

            if (blackListNames.Contains(fisherMan.Name))
            {
                return(0);
            }

            if (fisherMan == null)
            {
                throw new ArgumentNullException(nameof(fisherMan));
            }

            if (fisherMan.Banned)
            {
                return(0);
            }

            if (fisherMan.Level == Level.Professional)
            {
                return(100);
            }

            if (fisherMan.Level == Level.Amateur)
            {
                return(50);
            }

            return(0);
        }
コード例 #2
0
        public int MaximumAllowedFishesThatCanCatch(FisherMan fisherMan)
        {
            if (fisherMan == null)
            {
                throw new ArgumentNullException(nameof(fisherMan));
            }

            if (fisherMan.Banned)
            {
                return(0);
            }

            if (fisherMan.Level == Level.Professional)
            {
                return(100);
            }

            if (fisherMan.Level == Level.Amateur)
            {
                return(50);
            }

            return(0);
        }