コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GameEngine"/> class with all its needed components.
 /// </summary>
 /// <param name="kingSurvivalGameBoard">Takes the game board.</param>
 /// <param name="firstPawn">Takes the games first pawn.</param>
 /// <param name="secondPawn">Takes the games second pawn.</param>
 /// <param name="thirdPawn">Takes the games third pawn.</param>
 /// <param name="fourthPawn">Takes the games fourth pawn.</param>
 /// <param name="theKing">Takes the games king.</param>
 public GameEngine(GameBoard kingSurvivalGameBoard, Pawn firstPawn, Pawn secondPawn, Pawn thirdPawn, Pawn fourthPawn, King theKing)
 {
     this.kingSurvivalGameBoard = kingSurvivalGameBoard;
     this.firstPawn = firstPawn;
     this.secondPawn = secondPawn;
     this.thirdPawn = thirdPawn;
     this.fourthPawn = fourthPawn;
     this.theKing = theKing;
     this.allPawns = new List<Figure>();
 }
コード例 #2
0
 /// <summary>
 /// Starts the current game.
 /// </summary>
 public void StartGame()
 {
     Pawn firstPawn = new Pawn('A', new string[] { "ADL", "ADR" }, new int[] { 2, 4 });
     Pawn secondPawn = new Pawn('B', new string[] { "BDL", "BDR" }, new int[] { 2, 8 });
     Pawn thirdPawn = new Pawn('C', new string[] { "CDL", "CDR" }, new int[] { 2, 12 });
     Pawn fourthPawn = new Pawn('D', new string[] { "DDL", "DDR" }, new int[] { 2, 16 });
     King theKing = new King();
     GameBoard gameBoard = new GameBoard();
     GameEngine myTestEngine = new GameEngine(gameBoard, firstPawn, secondPawn, thirdPawn, fourthPawn, theKing);
     myTestEngine.InitGame();
     myTestEngine.StartGame();
 }