Пример #1
0
        public void OnBoardSpaceSelected(object sender, EventArgs eventArgs)
        {
            BoardSpace space  = (BoardSpace)sender;
            int        column = getColumn(space);
            BoardSpaceSelectedEventArgs boardSpaceSelectedEventArgs = new BoardSpaceSelectedEventArgs(column);

            BoardSpaceSelected?.Invoke(this, boardSpaceSelectedEventArgs);
        }
Пример #2
0
 private int getColumn(BoardSpace space)
 {
     if (BoardSpace0.Equals(space))
     {
         return(0);
     }
     if (BoardSpace1.Equals(space))
     {
         return(1);
     }
     if (BoardSpace2.Equals(space))
     {
         return(2);
     }
     throw new Exception("Invalid BoardSpace checked by getColumn");
 }