@@ -58,13 +58,7 @@ public void CreateGridTiles()
58
58
_gridSlotTiles = new IGridTile [ _rowCount , _columnCount ] ;
59
59
_originPosition = GetOriginPosition ( _rowCount , _columnCount ) ;
60
60
61
- for ( var rowIndex = 0 ; rowIndex < _rowCount ; rowIndex ++ )
62
- {
63
- for ( var columnIndex = 0 ; columnIndex < _columnCount ; columnIndex ++ )
64
- {
65
- SetTile ( rowIndex , columnIndex , TileGroup . Available ) ;
66
- }
67
- }
61
+ SetTilesGroup ( TileGroup . Available ) ;
68
62
}
69
63
70
64
public bool IsTileActive ( GridPosition gridPosition )
@@ -122,14 +116,7 @@ public TileGroup GetTileGroup(GridPosition gridPosition)
122
116
123
117
public void ResetState ( )
124
118
{
125
- for ( var rowIndex = 0 ; rowIndex < _rowCount ; rowIndex ++ )
126
- {
127
- for ( var columnIndex = 0 ; columnIndex < _columnCount ; columnIndex ++ )
128
- {
129
- SetTile ( rowIndex , columnIndex , TileGroup . Available ) ;
130
- }
131
- }
132
-
119
+ SetTilesGroup ( TileGroup . Available ) ;
133
120
ResetGameBoardData ( ) ;
134
121
}
135
122
@@ -173,6 +160,17 @@ private IGridTile GetTile(int rowIndex, int columnIndex, TileGroup group)
173
160
return tile ;
174
161
}
175
162
163
+ private void SetTilesGroup ( TileGroup group )
164
+ {
165
+ for ( var rowIndex = 0 ; rowIndex < _rowCount ; rowIndex ++ )
166
+ {
167
+ for ( var columnIndex = 0 ; columnIndex < _columnCount ; columnIndex ++ )
168
+ {
169
+ SetTile ( rowIndex , columnIndex , group ) ;
170
+ }
171
+ }
172
+ }
173
+
176
174
private void SetTile ( int rowIndex , int columnIndex , TileGroup group )
177
175
{
178
176
var currentTile = _gridSlotTiles [ rowIndex , columnIndex ] ;
0 commit comments