File tree Expand file tree Collapse file tree
src/CodeBreaker.Blazor.Client/Components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -117,10 +117,19 @@ private void ResetMove() =>
117117 private void SelectField ( int index )
118118 {
119119 _selectedField = index ;
120-
120+
121+ // Set all fields to not selected
121122 for ( int i = 0 ; i < _currentMove . Length ; i ++ )
122123 _currentMove [ i ] . Selected = false ;
123-
124+
125+ // Reset the field, if it is already filled
126+ if ( _currentMove [ _selectedField ] . Color is not null || _currentMove [ _selectedField ] . Shape is not null )
127+ {
128+ _currentMove [ _selectedField ] . Color = null ;
129+ _currentMove [ _selectedField ] . Shape = null ;
130+ }
131+
132+ // Set the selected field to selected
124133 _currentMove [ _selectedField ] . Selected = true ;
125134 _selectable = true ;
126135 }
@@ -148,9 +157,6 @@ private void SelectColor(string color)
148157
149158 private void SelectShape ( string shape )
150159 {
151- //_currentMove[_selectedField].Selected = true;
152- //_currentMove[_selectedField].Shape = shape;
153-
154160 int fieldIndex ;
155161
156162 // If a field is selected, use the selected field
You can’t perform that action at this time.
0 commit comments