|
using System;
using System.Windows.Forms;
using Microsoft.DirectX.Direct3D;
using System.Drawing;
using Microsoft.DirectX;
using Bornander.Games.BoardGame.Direct3D;
namespace Bornander.Games.BoardGame
{
public partial class GameForm : Form
{
private string aboutText;
public GameForm(IBoardGameLogic gameLogic, IBoardGameModelRepository modelRepository, string title, string aboutText)
{
this.aboutText = aboutText;
InitializeComponent();
this.Text = title;
this.MouseWheel +=new MouseEventHandler(gamePanel.HandleMouseWheel);
gameLogic.SetNextPlayerHandler(GameNextPlayer);
gameLogic.Initialize();
gamePanel.Initialize(gameLogic, modelRepository);
}
void GameNextPlayer(string playerIdentifier)
{
this.toolStripStatusCurrentPlayer.Text = "Current player is " + playerIdentifier;
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void newgameToolStripMenuItem_Click(object sender, EventArgs e)
{
gamePanel.InitializeNewGame();
}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
MessageBox.Show(aboutText, "About!", MessageBoxButtons.OK);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Article videos
Oakmead Apps Android Games
21 Feb 2014: Best VB.NET Article of January 2014 - Second Prize
18 Oct 2013: Best VB.NET article of September 2013
23 Jun 2012: Best C++ article of May 2012
20 Apr 2012: Best VB.NET article of March 2012
22 Feb 2010: Best overall article of January 2010
22 Feb 2010: Best C# article of January 2010