public void Start() { FieldFactory minesweeperFactory = new MinesweeperFieldFactory(); IField minesweeperField = minesweeperFactory.CreateField(); FieldFactory playingFieldFactory = new PlayingFieldFactory(); IField playingField = playingFieldFactory.CreateField(); IRenderer consoleRenderer = new ConsoleRenderer(); IReadInput inputReader = new ConsoleReader(); IScoreBoard scoreboard = new ScoreBoard(); IEngine engine = new Engine(minesweeperField, playingField, consoleRenderer, inputReader, scoreboard); engine.Play(); }
public static void Main(string[] args) { GameField gameField = new GameField(10,10); char[,] playingField = gameField.Create(); char[,] bombsField = gameField.PlaceBombs(); int maxScore = (gameField.FieldCols * gameField.FieldCols) - (gameField.FieldCols + gameField.FieldCols); Engine engine = new Engine(); while (true) { if (Engine.IsNewGame) { playingField = gameField.Create(); bombsField = gameField.PlaceBombs(); Draw.GameLoad(); Draw.PlayingField(playingField); } Console.Write("Enter row and column: "); string inputCommand = Console.ReadLine(); if (inputCommand == "exit") { break; } inputCommand = engine.ParseInputCommand(inputCommand, playingField); engine.ExecuteCommand(inputCommand, gameField, playingField, bombsField, maxScore); } Console.WriteLine("Press any key to exit the game."); Console.Read(); }
static void Main() { Engine engine = new Engine(); engine.Run(); }
// Entry point of the game. static void Main(string[] args) { Engine gameEngine = new Engine(); gameEngine.Start(); }
internal static void Main() { IEngine engine = new Engine(); engine.Play(); }