예제 #1
0
 /* Raised when there is an update in the grid. */
 public void RaiseUpdateEvent()
 {
     if (GridUpdateEvent != null)
     {
         GridUpdateEvent.Invoke();
     }
 }
예제 #2
0
        private void UpdateBy(GridUpdateEvent results)
        {
            foreach (var result in results.GridUpdates)
            {
                UpdateGrids(result);
            }

            lblStatus.Text = results.Summary;
        }
예제 #3
0
        private void dgPlayerShips_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            // TODO: test that clicks aren't too rapid
            // TODO: pub/sub controller + form control

            GridUpdateEvent results = _battleshipsGame.GetMoveResults(IsPlayerGrid, e.ColumnIndex, e.RowIndex);

            UpdateBy(results);
        }