Exemple #1
0
        void CreateBoard(Game game)
        {
            var origin = new BottomField();
            origin.Row = 1;
            origin.Column = 0;

            // Bottom Row
            BaseField first = CreateBottomRow(origin);

            // Spawn points
            CreateSpawnPoints(game, first);

            // Second Row
            BaseField second = CreateSecondRow(first);

            // Third Row
            BaseField third = CreateThridRow(second);

            // Fourth Row
            BaseField fourth = CreateFourthRow(third);

            // Fifth Row
            BaseField fifth = CreateFifthRow(fourth);

            // Sixth Row
            BaseField sixth = CreateSixthRow(fifth);

            // Seventh Row
            BaseField seventh = CreateSeventhRow(sixth);

            Finish = seventh.GetField(Direction.Right, 4)
                   .AddField(Direction.Up, new FinishField()).GetField(Direction.Up) as ContainerField;

            Origin = origin;
        }
Exemple #2
0
        public GameController()
        {
            _game = Game.Current;

            _boardview = new BoardView();
            _gameview = new GameView();

            _inputController = new InputController();
        }
Exemple #3
0
        public Player(Game game, int number)
        {
            Game = game;
            Number = number;

            Pawns = new List<Pawn>()
            {
                new Pawn(1, this),
                new Pawn(2, this),
                new Pawn(3, this),
                new Pawn(4, this)
            };

        }
Exemple #4
0
        void CreateSpawnPoints(Game game, BaseField first)
        {
            var sp1 = first.GetField(Direction.Right)
                 .AddField(Direction.Down, new SpawnField(game.Players.ElementAt(0)))
                 .GetField(Direction.Down);

            var sp2 = first.GetField(Direction.Right, 3)
               .AddField(Direction.Down, new SpawnField(game.Players.ElementAt(1)))
               .GetField(Direction.Down);

            var sp3 = first.GetField(Direction.Right, 7)
               .AddField(Direction.Down, new SpawnField(game.Players.ElementAt(2)))
               .GetField(Direction.Down);

            var sp4 = first.GetField(Direction.Right, 9)
               .AddField(Direction.Down, new SpawnField(game.Players.ElementAt(3)))
               .GetField(Direction.Down);

            _spawnPoints.Add(game.Players.ElementAt(0), sp1 as CollectionField);
            _spawnPoints.Add(game.Players.ElementAt(1), sp2 as CollectionField);
            _spawnPoints.Add(game.Players.ElementAt(2), sp3 as CollectionField);
            _spawnPoints.Add(game.Players.ElementAt(3), sp4 as CollectionField);
        }
Exemple #5
0
        public Board(Game game)
        {
            _spawnPoints = new Dictionary<Player, CollectionField>();

            CreateBoard(game);
        }