Ejemplo n.º 1
0
        public void Setup()
        {
            player = new Player("name");
            player.OwnableStrategy = new RandomlyBuyOrMortgage();
            var owner = new Player("owner");

            owner.OwnableStrategy = new RandomlyBuyOrMortgage();

            var players = new[] { player, owner };

            var dice       = new ControlledDice();
            var realEstate = BoardFactory.CreateRealEstate(dice);

            banker = new Banker(players);
            var realEstateHandler = new OwnableHandler(realEstate, banker);

            boardHandler = FakeHandlerFactory.CreateBoardHandlerForFakeBoard(players, realEstateHandler, banker);

            foreach (var rxr in realEstate.Values.OfType <Railroad>())
            {
                realEstateHandler.Land(owner, realEstate.Keys.First(k => realEstate[k] == rxr));
            }

            railroadCard = new MoveToNearestRailroadCard(boardHandler);
        }
Ejemplo n.º 2
0
        public void Setup()
        {
            player = new Player("name");
            var players           = new[] { player };
            var realEstateHandler = FakeHandlerFactory.CreateEmptyRealEstateHandler(players);
            var banker            = new Banker(players);

            boardHandler = FakeHandlerFactory.CreateBoardHandlerForFakeBoard(players, realEstateHandler, banker);

            moveBackCard = new MoveBackThreeCard(boardHandler);
        }
Ejemplo n.º 3
0
        public void Setup()
        {
            var players           = new[] { new Player("Player") };
            var dice              = new ControlledDice();
            var realEstateHandler = FakeHandlerFactory.CreateEmptyRealEstateHandler(players);
            var banker            = new Banker(players);
            var boardHandler      = FakeHandlerFactory.CreateBoardHandlerForFakeBoard(players, realEstateHandler, banker);
            var jailHandler       = new JailHandler(dice, boardHandler, banker);
            var deckFactory       = new DeckFactory(players, jailHandler, boardHandler, realEstateHandler, banker);

            deck = deckFactory.BuildCommunityChestDeck();
        }
Ejemplo n.º 4
0
        public void Setup()
        {
            player = new Player("name");
            var players = new[] { player };

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

            boardHandler = FakeHandlerFactory.CreateBoardHandlerForFakeBoard(players, realEstateHandler, banker);

            passGoCard = new MoveAndPassGoCard("move", BoardConstants.ATLANTIC_AVENUE, boardHandler);
        }
Ejemplo n.º 5
0
        public void Setup()
        {
            var players           = new[] { new Player("Player") };
            var banker            = new Banker(players);
            var realEstateHandler = new OwnableHandler(new Dictionary <Int32, OwnableSpace>(), banker);
            var boardHandler      = FakeHandlerFactory.CreateBoardHandlerForFakeBoard(players, realEstateHandler, banker);
            var dice        = new ControlledDice();
            var jailHandler = new JailHandler(dice, boardHandler, banker);
            var deckFactory = new DeckFactory(players, jailHandler, boardHandler, realEstateHandler, banker);

            deck = deckFactory.BuildChanceDeck(dice);
        }
Ejemplo n.º 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);
        }
        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);
        }
Ejemplo n.º 8
0
        private void SetupGameWithPlayers(Int32 numberOfPlayers)
        {
            var players           = GeneratePlayerIEnumerable(numberOfPlayers);
            var realEstateHandler = FakeHandlerFactory.CreateEmptyRealEstateHandler(players);

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

            dice = new ControlledDice();
            var jailHandler = new JailHandler(dice, boardHandler, banker);
            var turnHandler = new TurnHandler(dice, boardHandler, jailHandler, realEstateHandler, banker);

            game = new Game(players, turnHandler, banker);
        }
Ejemplo n.º 9
0
        public void Setup()
        {
            player = new Player("name");
            var players           = new[] { player };
            var realEstateHandler = FakeHandlerFactory.CreateEmptyRealEstateHandler(players);
            var boardHandler      = FakeHandlerFactory.CreateBoardHandlerForFakeBoard(players, realEstateHandler, banker);
            var dice = new ControlledDice();

            banker = new Banker(players);
            var jailHandler = new JailHandler(dice, boardHandler, banker);
            var deckFactory = new DeckFactory(players, jailHandler, boardHandler, realEstateHandler, banker);

            deck     = deckFactory.BuildCommunityChestDeck();
            drawCard = new DrawCard("draw card");
            drawCard.AddDeck(deck);
        }
        public void Setup()
        {
            player = new Player("name");
            owner  = new Player("owner");
            player.OwnableStrategy = new RandomlyBuyOrMortgage();
            owner.OwnableStrategy  = new RandomlyBuyOrMortgage();
            var players = new[] { player, owner };

            banker = new Banker(players);
            var dice = new ControlledDice();

            dice.SetPredeterminedRollValue(ROLL);
            var realEstate        = BoardFactory.CreateRealEstate(dice);
            var realEstateHandler = new OwnableHandler(realEstate, banker);

            boardHandler = FakeHandlerFactory.CreateBoardHandlerForFakeBoard(players, realEstateHandler, banker);

            utilityCard = new MoveToNearestUtilityCard(boardHandler, dice);
        }