public static Game CreateGame(IEnumerable<IPlayer> players)
        {
            var dice = new MonopolyDice();

            var banker = new Banker(players);
            var realEstateHandler = new OwnableHandler(BoardFactory.CreateRealEstate(dice), banker);
            var spaces = BoardFactory.CreateNonRealEstateSpaces(banker);
            var spaceHandler = new UnownableHandler(spaces);

            var boardHandler = new BoardHandler(players, realEstateHandler, spaceHandler, banker);
            var jailHandler = new JailHandler(dice, boardHandler, banker);
            var turnHandler = new TurnHandler(dice, boardHandler, jailHandler, realEstateHandler, banker);

            var deckFactory = new DeckFactory(players, jailHandler, boardHandler, realEstateHandler, banker);
            var communityChest = deckFactory.BuildCommunityChestDeck();
            var chance = deckFactory.BuildChanceDeck(dice);

            foreach (var space in spaces.Values.OfType<DrawCard>())
            {
                if (space.ToString() == "Community Chest")
                    space.AddDeck(communityChest);
                else
                    space.AddDeck(chance);
            }

            return new Game(players, turnHandler, banker);
        }
        public void Setup()
        {
            player = new Player("name");
            var players = new[] { player };

            banker = new Banker(players);
            var realEstateHandler = new OwnableHandler(new Dictionary<Int32, OwnableSpace>(), banker);

            var normalSpaces = new Dictionary<Int32, UnownableSpace>();
            for(var i = 0; i < BoardConstants.BOARD_SIZE; i++)
                normalSpaces.Add(i, new NormalSpace("space " + i));

            var spaceHandler = new UnownableHandler(normalSpaces);

            boardHandler = new BoardHandler(players, realEstateHandler, spaceHandler, banker);
        }
        public void Setup()
        {
            property = new Property("property", 0, 0, GROUPING.PURPLE, 0, new[] { 0, 0, 0, 0, 0 });
            otherProperty = new Property("property", 0, 0, GROUPING.PURPLE, 0, new[] { 0, 0, 0, 0, 0 });

            var dict = new Dictionary<Int32, OwnableSpace>();
            dict.Add(0, property);
            dict.Add(1, otherProperty);

            player = new Player("name");
            player.OwnableStrategy = new AlwaysBuyOrMortgage();
            var players = new[] { player };
            banker = new Banker(players);
            var realEstateHandler = new OwnableHandler(dict, banker);
            housesAndHotelsCard = new HousesAndHotelsCard("card", 40, 115, realEstateHandler, banker);

            realEstateHandler.Land(player, 0);
            realEstateHandler.Land(player, 1);
        }
        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);
        }
        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);
        }
        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);
        }