コード例 #1
0
        public void Setup()
        {
            player = new Player("Player");
            var players = new[] { player };

            dice = new ControlledDice();
            var realEstateHandler = FakeHandlerFactory.CreateEmptyRealEstateHandler(players);

            landableSpaces = new Dictionary <Int32, UnownableSpace>();

            for (var i = 0; i < BoardConstants.BOARD_SIZE; i++)
            {
                landableSpaces.Add(i, new LandableSpace());
            }

            space6  = landableSpaces[6] as LandableSpace;
            space10 = landableSpaces[10] as LandableSpace;

            var spaceHandler = new UnownableHandler(landableSpaces);

            banker       = new Banker(players);
            boardHandler = new BoardHandler(players, realEstateHandler, spaceHandler, banker);
            jailHandler  = new JailHandler(dice, boardHandler, banker);
            turnHandler  = new TurnHandler(dice, boardHandler, jailHandler, realEstateHandler, banker);
        }
コード例 #2
0
 public TurnHandler(IDice dice, IBoardHandler boardHandler, IJailHandler jailHandler, IOwnableHandler realEstateHandler, IBanker banker)
 {
     this.dice              = dice;
     this.boardHandler      = boardHandler;
     this.jailHandler       = jailHandler;
     this.realEstateHandler = realEstateHandler;
     this.banker            = banker;
 }
コード例 #3
0
 public TurnHandler(IDice dice, IBoardHandler boardHandler, IJailHandler jailHandler, IOwnableHandler realEstateHandler, IBanker banker)
 {
     this.dice = dice;
     this.boardHandler = boardHandler;
     this.jailHandler = jailHandler;
     this.realEstateHandler = realEstateHandler;
     this.banker = banker;
 }
コード例 #4
0
 public DeckFactory(IEnumerable<IPlayer> players, 
                    IJailHandler jailHandler, IBoardHandler boardHandler, IOwnableHandler realEstateHandler, IBanker banker)
 {
     random = new Random();
     this.jailHandler = jailHandler;
     this.players = players;
     this.boardHandler = boardHandler;
     this.realEstateHandler = realEstateHandler;
     this.banker = banker;
 }
コード例 #5
0
 public DeckFactory(IEnumerable <IPlayer> players,
                    IJailHandler jailHandler, IBoardHandler boardHandler, IOwnableHandler realEstateHandler, IBanker banker)
 {
     random                 = new Random();
     this.jailHandler       = jailHandler;
     this.players           = players;
     this.boardHandler      = boardHandler;
     this.realEstateHandler = realEstateHandler;
     this.banker            = banker;
 }
コード例 #6
0
        public void SetupPlayerWithStrategy()
        {
            dice = new ControlledDice();

            player = new Player("name");

            var players = new[] { player };
            banker = new Banker(players);
            var realEstateHandler = FakeHandlerFactory.CreateEmptyRealEstateHandler(players);
            boardHandler = FakeHandlerFactory.CreateBoardHandlerForFakeBoard(players, realEstateHandler, banker);
            jailHandler = new JailHandler(dice, boardHandler, banker);
        }
コード例 #7
0
        public void Setup()
        {
            player = new Player("name");
            var players = new[] { player };

            var dice = new ControlledDice();
            banker = new Banker(players);
            var realEstateHandler = FakeHandlerFactory.CreateEmptyRealEstateHandler(players);
            var boardHandler = FakeHandlerFactory.CreateBoardHandlerForFakeBoard(players, realEstateHandler, banker);
            jailHandler = new JailHandler(dice, boardHandler, banker);
            getOutOfJailCard = new GetOutOfJailFreeCard(jailHandler);
        }
コード例 #8
0
        public void SetupPlayerWithStrategy()
        {
            dice = new ControlledDice();

            player = new Player("name");

            var players = new[] { player };

            banker = new Banker(players);
            var realEstateHandler = FakeHandlerFactory.CreateEmptyRealEstateHandler(players);

            boardHandler = FakeHandlerFactory.CreateBoardHandlerForFakeBoard(players, realEstateHandler, banker);
            jailHandler  = new JailHandler(dice, boardHandler, banker);
        }
コード例 #9
0
        public void Setup()
        {
            player = new Player("name");
            var players = new[] { player };

            var dice = new ControlledDice();

            banker = new Banker(players);
            var realEstateHandler = FakeHandlerFactory.CreateEmptyRealEstateHandler(players);
            var boardHandler      = FakeHandlerFactory.CreateBoardHandlerForFakeBoard(players, realEstateHandler, banker);

            jailHandler      = new JailHandler(dice, boardHandler, banker);
            getOutOfJailCard = new GetOutOfJailFreeCard(jailHandler);
        }
コード例 #10
0
 public GetOutOfJailFreeCard(IJailHandler jailHandler)
 {
     this.jailHandler = jailHandler;
 }
コード例 #11
0
 public GetOutOfJailFreeCard(IJailHandler jailHandler)
 {
     this.jailHandler = jailHandler;
 }
コード例 #12
0
 public GoToJailCard(IJailHandler jailHandler)
 {
     this.jailHandler = jailHandler;
 }
コード例 #13
0
        public void Setup()
        {
            player = new Player("Player");
            var players = new[] { player };

            dice = new ControlledDice();
            var realEstateHandler = FakeHandlerFactory.CreateEmptyRealEstateHandler(players);

            landableSpaces = new Dictionary<Int32, UnownableSpace>();

            for (var i = 0; i < BoardConstants.BOARD_SIZE; i++)
                landableSpaces.Add(i, new LandableSpace());

            space6 = landableSpaces[6] as LandableSpace;
            space10 = landableSpaces[10] as LandableSpace;

            var spaceHandler = new UnownableHandler(landableSpaces);
            banker = new Banker(players);
            boardHandler = new BoardHandler(players, realEstateHandler, spaceHandler, banker);
            jailHandler = new JailHandler(dice, boardHandler, banker);
            turnHandler = new TurnHandler(dice, boardHandler, jailHandler, realEstateHandler, banker);
        }
コード例 #14
0
 public GoToJailCard(IJailHandler jailHandler)
 {
     this.jailHandler = jailHandler;
 }