private void FillFieldWithObjects(IFieldObjectCreator fieldObjectCreator) { for (int i = 0; i < fieldSize.x; i++) { for (int j = 0; j < fieldSize.y; j++) { Vector2Int currentCell = new Vector2Int(i, j); fieldObjectCreator.CreateFieldObject(currentCell); } } }
public FieldUpdater(IMatrixStorageSwappable <IGameObjectable> fieldMatrix, ICombinationsFinder combinationsFinder, IFieldObjectCreator fieldObjectCreator, IFieldObjectRemover fieldObjectRemover, ICoroutinePlayer coroutinePlayer, FieldProperties fieldProperties, float fieldObjectFallingStartSpeed, float fieldObjectFallingVelocity) { this.fieldMatrix = fieldMatrix; this.combinationsFinder = combinationsFinder; this.fieldObjectCreator = fieldObjectCreator; this.fieldObjectRemover = fieldObjectRemover; this.coroutinePlayer = coroutinePlayer; this.fieldProperties = fieldProperties; this.fieldObjectFallingStartSpeed = fieldObjectFallingStartSpeed; this.fieldObjectFallingVelocity = fieldObjectFallingVelocity; }