public Bowler GetBowler(BowlerType type)
        {
            switch (type)
            {
            case BowlerType.Parttime:
                return(new ParttimeBowler(BowlerRunGen));

            default:
                return(new Bowler(BowlerRunGen));
            }
        }
        public Bowler GetBowler(BowlerType type)
        {
            switch (type)
            {
            case BowlerType.Parttime:
                return(new ParttimeBowler(new RandGen(0, 6)));

            default:
                return(new Bowler(new RandGen(0, 6)));
            }
        }
Beispiel #3
0
        public CricketGame(int overs, int target, BatsmanType batsmanType, BowlerType bowlerType, IPlayerFactory playerFactory, IOutStrategyFactory outstrategyFactory)
        {
            BallCount = overs * 6;

            Target             = target;
            Overs              = overs;
            PlayerFactory      = playerFactory;
            Bowler             = PlayerFactory.GetBowler(bowlerType);
            Batsman            = PlayerFactory.GetBatsman(batsmanType);
            outStrategyFactory = outstrategyFactory;
            outStrategy        = outstrategyFactory.GetOutStrategy(batsmanType);
        }