-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainForm.cs
52 lines (42 loc) · 1023 Bytes
/
MainForm.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using System.Windows.Forms;
using Pong.Interfaces;
using Pong.Classes;
namespace Pong
{
public partial class MainForm : Form
{
#region Fields
/// <summary>
/// Canvas object
/// </summary>
readonly ICanvas canvas;
/// <summary>
/// Game object
/// </summary>
readonly IPongGame game;
#endregion
#region Constructor
/// <summary>
/// Main form constructor
/// </summary>
public MainForm()
{
InitializeComponent();
canvas = new Canvas(gameBox);
game = new PongGame(canvas);
}
#endregion
#region Methods
/// <summary>
/// Form load handler
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void MainForm_Load(object sender, EventArgs e)
{
this.game.StartGame();
}
#endregion
}
}