Skip to content

Commit 8edb433

Browse files
author
RUBIUS\chebanovdd
committed
Changed param type for OnSequencesSolved method.
1 parent da5858c commit 8edb433

File tree

11 files changed

+18
-27
lines changed

11 files changed

+18
-27
lines changed

samples/Terminal.Match3/LevelGoals/CollectRowMaxItems.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Collections.Generic;
32
using Match3.App;
43
using Match3.App.Interfaces;
54
using Match3.Infrastructure.SequenceDetectors;
@@ -16,9 +15,9 @@ public CollectRowMaxItems(IGameBoard<ITerminalGridSlot> gameBoard)
1615
_maxRowLength = GetMaxRowLength(gameBoard);
1716
}
1817

19-
public override void OnSequencesSolved(IEnumerable<ItemSequence<ITerminalGridSlot>> sequences)
18+
public override void OnSequencesSolved(SolvedData<ITerminalGridSlot> solvedData)
2019
{
21-
foreach (var sequence in sequences)
20+
foreach (var sequence in solvedData.SolvedSequences)
2221
{
2322
if (sequence.SequenceDetectorType != typeof(HorizontalLineDetector<ITerminalGridSlot>))
2423
{

samples/Unity.Match3/Assets/Scripts/Common/GameScoreBoard.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.Collections.Generic;
21
using System.Text;
32
using Common.Interfaces;
43
using Match3.App;
@@ -9,9 +8,9 @@ namespace Common
98
{
109
public class GameScoreBoard : ISolvedSequencesConsumer<IUnityGridSlot>
1110
{
12-
public void OnSequencesSolved(IEnumerable<ItemSequence<IUnityGridSlot>> sequences)
11+
public void OnSequencesSolved(SolvedData<IUnityGridSlot> solvedData)
1312
{
14-
foreach (var sequence in sequences)
13+
foreach (var sequence in solvedData.SolvedSequences)
1514
{
1615
RegisterSequenceScore(sequence);
1716
}

samples/Unity.Match3/Assets/Scripts/Common/LevelGoals/CollectRowMaxItems.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.Collections.Generic;
21
using Common.Interfaces;
32
using Match3.App;
43
using Match3.App.Interfaces;
@@ -16,9 +15,9 @@ public CollectRowMaxItems(IGameBoard<IUnityGridSlot> gameBoard)
1615
_maxRowLength = GetMaxRowLength(gameBoard);
1716
}
1817

19-
public override void OnSequencesSolved(IEnumerable<ItemSequence<IUnityGridSlot>> sequences)
18+
public override void OnSequencesSolved(SolvedData<IUnityGridSlot> solvedData)
2019
{
21-
foreach (var sequence in sequences)
20+
foreach (var sequence in solvedData.SolvedSequences)
2221
{
2322
if (sequence.SequenceDetectorType != typeof(HorizontalLineDetector<IUnityGridSlot>))
2423
{
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
using System.Collections.Generic;
21
using Match3.Core.Interfaces;
32

43
namespace Match3.App.Interfaces
54
{
65
public interface ISolvedSequencesConsumer<TGridSlot> where TGridSlot : IGridSlot
76
{
8-
void OnSequencesSolved(IEnumerable<ItemSequence<TGridSlot>> sequences);
7+
void OnSequencesSolved(SolvedData<TGridSlot> solvedData);
98
}
109
}

src/Match3.App/Internal/BaseGame.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Collections.Generic;
32
using Match3.App.Interfaces;
43
using Match3.Core.Interfaces;
54
using Match3.Core.Structs;
@@ -97,18 +96,18 @@ protected bool IsSolved(GridPosition position1, GridPosition position2, out Solv
9796
return solvedData.SolvedSequences.Count > 0;
9897
}
9998

100-
protected void NotifySequencesSolved(IReadOnlyCollection<ItemSequence<TGridSlot>> sequences)
99+
protected void NotifySequencesSolved(SolvedData<TGridSlot> solvedData)
101100
{
102101
foreach (var sequencesConsumer in _solvedSequencesConsumers)
103102
{
104-
sequencesConsumer.OnSequencesSolved(sequences);
103+
sequencesConsumer.OnSequencesSolved(solvedData);
105104
}
106105

107106
foreach (var levelGoal in _levelGoals)
108107
{
109108
if (levelGoal.IsAchieved == false)
110109
{
111-
levelGoal.OnSequencesSolved(sequences);
110+
levelGoal.OnSequencesSolved(solvedData);
112111
}
113112
}
114113
}

src/Match3.App/LevelGoal.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Collections.Generic;
32
using Match3.App.Interfaces;
43
using Match3.Core.Interfaces;
54

@@ -11,7 +10,7 @@ public abstract class LevelGoal<TGridSlot> : ISolvedSequencesConsumer<TGridSlot>
1110

1211
public event EventHandler Achieved;
1312

14-
public abstract void OnSequencesSolved(IEnumerable<ItemSequence<TGridSlot>> sequences);
13+
public abstract void OnSequencesSolved(SolvedData<TGridSlot> solvedData);
1514

1615
protected void MarkAchieved()
1716
{

src/Match3.App/Match3Game.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ private async UniTask SwapItemsAsync(IBoardFillStrategy<TGridSlot> fillStrategy,
7979

8080
if (IsSolved(position1, position2, out var solvedData))
8181
{
82-
NotifySequencesSolved(solvedData.SolvedSequences);
82+
NotifySequencesSolved(solvedData);
8383
await _jobsExecutor.ExecuteJobsAsync(fillStrategy.GetSolveJobs(GameBoard, solvedData), cancellationToken);
8484
}
8585
else
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
using System.Collections.Generic;
21
using Match3.Core.Interfaces;
32

43
namespace Match3.App.Interfaces
54
{
65
public interface ISolvedSequencesConsumer<TGridSlot> where TGridSlot : IGridSlot
76
{
8-
void OnSequencesSolved(IEnumerable<ItemSequence<TGridSlot>> sequences);
7+
void OnSequencesSolved(SolvedData<TGridSlot> solvedData);
98
}
109
}

src/Match3.UnityPackage/Assets/Plugins/Match3/Runtime/Match3.App/Internal/BaseGame.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Collections.Generic;
32
using Match3.App.Interfaces;
43
using Match3.Core.Interfaces;
54
using Match3.Core.Structs;
@@ -97,18 +96,18 @@ protected bool IsSolved(GridPosition position1, GridPosition position2, out Solv
9796
return solvedData.SolvedSequences.Count > 0;
9897
}
9998

100-
protected void NotifySequencesSolved(IReadOnlyCollection<ItemSequence<TGridSlot>> sequences)
99+
protected void NotifySequencesSolved(SolvedData<TGridSlot> solvedData)
101100
{
102101
foreach (var sequencesConsumer in _solvedSequencesConsumers)
103102
{
104-
sequencesConsumer.OnSequencesSolved(sequences);
103+
sequencesConsumer.OnSequencesSolved(solvedData);
105104
}
106105

107106
foreach (var levelGoal in _levelGoals)
108107
{
109108
if (levelGoal.IsAchieved == false)
110109
{
111-
levelGoal.OnSequencesSolved(sequences);
110+
levelGoal.OnSequencesSolved(solvedData);
112111
}
113112
}
114113
}

src/Match3.UnityPackage/Assets/Plugins/Match3/Runtime/Match3.App/LevelGoal.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Collections.Generic;
32
using Match3.App.Interfaces;
43
using Match3.Core.Interfaces;
54

@@ -11,7 +10,7 @@ public abstract class LevelGoal<TGridSlot> : ISolvedSequencesConsumer<TGridSlot>
1110

1211
public event EventHandler Achieved;
1312

14-
public abstract void OnSequencesSolved(IEnumerable<ItemSequence<TGridSlot>> sequences);
13+
public abstract void OnSequencesSolved(SolvedData<TGridSlot> solvedData);
1514

1615
protected void MarkAchieved()
1716
{

0 commit comments

Comments
 (0)