Example #1
0
        private void SendCellInfo(int column, int row, Element element, ChangeType changeType)
        {
            var eventArgs = new CellChangedArgs();

            eventArgs.column     = column;
            eventArgs.row        = row;
            eventArgs.changeType = changeType;
            eventArgs.element    = element;
            CellChanged?.Invoke(eventArgs);
        }
 private void OnCellChanged(CellChangedArgs eventArgs)
 {
     if (eventArgs.changeType == ChangeType.Initialize)
     {
         _fieldView.SpawnBackgroundCell(eventArgs.column, eventArgs.row);
         _fieldView.SpawnElement(eventArgs.column, eventArgs.row, eventArgs.element);
     }
     else if (eventArgs.changeType == ChangeType.Delete)
     {
         _fieldView.DeleteElement(eventArgs.column, eventArgs.row);
     }
     else if (eventArgs.changeType == ChangeType.CreateNew)
     {
         _fieldView.SpawnElement(eventArgs.column, eventArgs.row, eventArgs.element);
     }
 }