public CellStatusChangedEventArgs(CellID identifier, EConnectFourCellContent newContent,
                                   EConnectFourCellContent oldContent)
 {
     Identifier = identifier;
     NewContent = newContent;
     OldContent = oldContent;
 }
        public void SetPiece(CellID target, EConnectFourCellContent content)
        {
            EConnectFourCellContent oldContent = _cells[target].Content;

            _cells[target].SetContent(content);
            CellStatusChanged(this, new CellStatusChangedEventArgs(target, content, oldContent));
        }
        public CellID SetPiece(int row, int col, EConnectFourCellContent content)
        {
            if (IsValidMove(keyFor(row, col)))
            {
                var cellid = getLowestEmptyRowOfCol(col);
                SetPiece(cellid, content);
                return(cellid);
            }

            throw new InvalidOperationException();
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            EConnectFourCellContent type = (EConnectFourCellContent)value;

            switch (type)
            {
            case EConnectFourCellContent.Black:
                return(new SolidColorBrush(Colors.Red));

            case EConnectFourCellContent.White:
                return(new SolidColorBrush(Colors.Yellow));

            default:
                return(new SolidColorBrush(Colors.White));
            }
        }
 public void SetContent(EConnectFourCellContent content)
 {
     Content = content;
 }
 public FourConnectCellModel(int row, int col)
 {
     RowIndex = row;
     ColIndex = col;
     Content  = EConnectFourCellContent.Empty;
 }
 public CellStatusViewModel(int row, int col, EConnectFourCellContent content)
 {
     _row         = row;
     _col         = col;
     _cellFilling = content;
 }
 public void SetContent(EConnectFourCellContent content)
 {
     CellFilling = content;
 }