public void CreateWithValues()
		{
			var name = "Name";
			var score = 1;
			var player = new Player(name, score);

			Assert.AreEqual(player.Name, name);
			Assert.AreEqual(player.Score, score);
		}
Esempio n. 2
0
		public static void Main(string[] args)
		{
			var ioProvider = new ConsoleIOProvider();
			var player = new Player();
			var field = new Field();

			var gameUISettngs = new DefaultUIEngineSettings<ConsoleIOProvider>(ioProvider, player);
			var gameUI = new UIEngine<ConsoleIOProvider>(gameUISettngs);
			var gameEngineSettings = new GameEngineSettings<IDefaultUIEngine, IIntegerStats>(gameUI, field, player, InFileScores.Instance);
			var gameEngine = new GameEngine(gameEngineSettings);
			gameEngine.Start();
		}
Esempio n. 3
0
		private void MainForm_Load(object sender, EventArgs e)
		{
			var ioProvider = new WindowsFormsIOProvider(this);
			var player = new Player();
			var field = new Field();

			var gameUISettngs = new DefaultUIEngineSettings<WindowsFormsIOProvider>(
				ioProvider,
				player,
				ioProviderSettings: new WindowsFormsIOProviderSettings(),
				startRenderer: new StartWindowRenderer<WindowsFormsIOProvider>(),
				exitRenderer: new ExitWindowRenderer<WindowsFormsIOProvider>(),
				chooseDifficultyRenderer: new ChooseDifficultyWindowRenderer<WindowsFormsIOProvider>(),
				helpDisplayRenderer: new HelpDisplayWindowRenderer<WindowsFormsIOProvider>(),
				fieldRenderer: new FieldWindowsRenderer<WindowsFormsIOProvider>());

			var gameUI = new UIEngine<WindowsFormsIOProvider>(gameUISettngs);
			var gameEngineSettings = new GameEngineSettings<IDefaultUIEngine, IIntegerStats>(gameUI, field, player, InMemoryScores.Instance);
			var gameEngine = new GameEngine(gameEngineSettings);
			this._gameEngine = gameEngine;

			Task.Run(() => gameEngine.Start());
		}
		public void SetScore()
		{
			var player = new Player();
			player.Score = 3;
		}
		public void SetName()
		{
			var player = new Player();
			player.Name = "Name";
		}
		public void GetScore()
		{
			var player = new Player();
			Assert.AreEqual(player.Score, 0);
		}
		public void GetName()
		{
			var player = new Player();
			Assert.AreEqual(player.Name, null);
		}