// FINISHED public void ResolveMerger(BoardObject boardObject, Direction direction) { if (GamePaused) { return; } BoardPosition unmovingObjectsPosition = boardObject.CurrentPosition.Neighbours[(int)direction]; Assert.IsNotNull(unmovingObjectsPosition, "There is a valid neighbouring position to merge with in the given direction"); BoardObject unmovingObject = unmovingObjectsPosition.CurrentObject; Assert.IsNotNull(unmovingObject, "There is an object to merge with in the given direction"); Assert.IsTrue(unmovingObject.CanMergeWith(boardObject), "Merger is possible"); // Delete the moving object DeleteExistingObject(boardObject); // Increase the level of the unmoving object by one IncreaseLevelOfExistingObject(unmovingObject); }