Esempio n. 1
0
 public XoGameForm()
 {
     InitializeComponent();
     _xoGameGui = new XoGameGui(new Player(XoValue.SecondPlayer), _xoGame)
     {
         Dock = DockStyle.Fill
     };
     Controls.Add(_xoGameGui);
     _xoGame.Spaces.ForEach(p => p.Marked += (s, e) =>
     {
         var space = (XoSpace)s;
         _data = new[] { _xoGame.Spaces.IndexOf(space), (int)space.Value };
     });
 }
Esempio n. 2
0
File: Form1.cs Progetto: uaandrei/XO
 public Form1()
 {
     InitializeComponent();
     _client = new XoGameServiceClient();
     _client.StartGame();
     _xoGameGui = new XoGameGui(new Player(XoValue.FirstPlayer), _game)
     {
         Dock = DockStyle.Fill
     };
     panel1.Controls.Add(_xoGameGui);
     _game.Spaces.ForEach(p => p.Marked += (s, e) =>
     {
         var space = (XoSpace)s;
         var data = _client.UpdateGame(new[] { _game.Spaces.IndexOf(space), (int)space.Value });
         _xoGameGui.UpdateGame(data[0], data[1]);
     });
 }