Esempio n. 1
0
 public MoveHandler(IMoveGenerator moveGenerator, IUserMoveReader userMoveReader, IMoveValidator moveValidator, IBoardHandler boardHandler)
 {
     _moveGenerator = moveGenerator;
     _userMoveReader = userMoveReader;
     _moveValidator = moveValidator;
     _boardHandler = boardHandler;
 }
Esempio n. 2
0
 public ChessClient(string username, string password, IBoardHandler boardHandler)
 {
     Username     = username;
     Password     = password;
     userId       = CallGetUserId();
     BoardHandler = boardHandler;
 }
Esempio n. 3
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);
        }
Esempio n. 4
0
 public GameHandler(IGameBuilder gameBuilder, IMoveHandler moveHandler, IBoardHandler boardHandler)
 {
     _gameBuilder = gameBuilder;
     _moveHandler = moveHandler;
     _boardHandler = boardHandler;
     Game = null;
 }
Esempio n. 5
0
 public MoveHandler(IMoveGenerator moveGenerator, IUserMoveReader userMoveReader, IMoveValidator moveValidator, IBoardHandler boardHandler)
 {
     _moveGenerator  = moveGenerator;
     _userMoveReader = userMoveReader;
     _moveValidator  = moveValidator;
     _boardHandler   = boardHandler;
 }
        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);
        }
Esempio n. 7
0
 public GameHandler(IGameBuilder gameBuilder, IMoveHandler moveHandler, IBoardHandler boardHandler)
 {
     _gameBuilder  = gameBuilder;
     _moveHandler  = moveHandler;
     _boardHandler = boardHandler;
     Game          = null;
 }
Esempio n. 8
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;
 }
 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;
 }
Esempio n. 10
0
        public JailHandler(IDice dice, IBoardHandler boardHandler, IBanker banker)
        {
            this.dice = dice;
            this.boardHandler = boardHandler;
            this.banker = banker;

            turnsInJail = new Dictionary<IPlayer, Int16>();
            cards = new Dictionary<GetOutOfJailFreeCard, IPlayer>(2);
        }
Esempio n. 11
0
        public JailHandler(IDice dice, IBoardHandler boardHandler, IBanker banker)
        {
            this.dice         = dice;
            this.boardHandler = boardHandler;
            this.banker       = banker;

            turnsInJail = new Dictionary <IPlayer, Int16>();
            cards       = new Dictionary <GetOutOfJailFreeCard, IPlayer>(2);
        }
        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);
        }
Esempio n. 13
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;
 }
Esempio n. 14
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;
 }
        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);
        }
Esempio n. 16
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);
        }
        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);
        }
Esempio n. 18
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);
        }
        public void Setup()
        {
            player = new Player("name");

            var dice = new ControlledDice();
            var players = new[] { player };
            var banker = new Banker(players);
            var realEstateHandler = FakeHandlerFactory.CreateEmptyRealEstateHandler(players);
            boardHandler = FakeHandlerFactory.CreateBoardHandlerForFakeBoard(players, realEstateHandler, banker);
            jailHandler = new JailHandler(dice, boardHandler, banker);

            goToJailCard = new GoToJailCard(jailHandler);
        }
Esempio n. 20
0
        public void Setup()
        {
            player = new Player("name");

            var dice              = new ControlledDice();
            var players           = new[] { player };
            var banker            = new Banker(players);
            var realEstateHandler = FakeHandlerFactory.CreateEmptyRealEstateHandler(players);

            boardHandler = FakeHandlerFactory.CreateBoardHandlerForFakeBoard(players, realEstateHandler, banker);
            jailHandler  = new JailHandler(dice, boardHandler, banker);

            goToJailCard = new GoToJailCard(jailHandler);
        }
Esempio n. 21
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 };

            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()
        {
            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);
        }
 public MoveBackThreeCard(IBoardHandler boardHandler)
 {
     this.boardHandler = boardHandler;
 }
Esempio n. 25
0
 public MoveAndPassGoCard(String name, Int32 position, IBoardHandler boardHandler)
 {
     this.name         = name;
     this.position     = position;
     this.boardHandler = boardHandler;
 }
 public MoveToNearestRailroadCard(IBoardHandler boardHandler)
 {
     this.boardHandler = boardHandler;
 }
 public MoveToNearestUtilityCard(IBoardHandler boardHandler, IDice dice)
 {
     this.boardHandler = boardHandler;
     this.dice = dice;
 }
 public MoveToNearestRailroadCard(IBoardHandler boardHandler)
 {
     this.boardHandler = boardHandler;
 }
        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()
        {
            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);
        }
Esempio n. 31
0
 public AppLogic(IMessenger messenger, IBoardHandler boardHandler, IProcessUserInput processUserInput)
 {
     _messenger        = messenger ?? throw new ArgumentNullException();
     _boardHandler     = boardHandler ?? throw new ArgumentNullException();
     _processUserInput = processUserInput ?? throw new ArgumentNullException();
 }
        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);
        }
 public MoveAndPassGoCard(String name, Int32 position, IBoardHandler boardHandler)
 {
     this.name = name;
     this.position = position;
     this.boardHandler = boardHandler;
 }
 public MoveBackThreeCard(IBoardHandler boardHandler)
 {
     this.boardHandler = boardHandler;
 }
Esempio n. 35
0
 public MoveToNearestUtilityCard(IBoardHandler boardHandler, IDice dice)
 {
     this.boardHandler = boardHandler;
     this.dice         = dice;
 }
        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);
        }