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; }
public GameController() { _game = Game.Current; _boardview = new BoardView(); _gameview = new GameView(); _inputController = new InputController(); }
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) }; }
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); }
public Board(Game game) { _spawnPoints = new Dictionary<Player, CollectionField>(); CreateBoard(game); }