Adjust Bomb Behavior

This commit is contained in:
2025-12-16 21:19:33 +08:00
parent d10d574cff
commit 9842e7ef3f
4 changed files with 45 additions and 27 deletions

View File

@@ -17,8 +17,14 @@ namespace Services
if (matchPositions == null || matchPositions.Count == 0)
return Array.Empty<Vector2Int>();
HashSet<Vector2Int> candidates = new HashSet<Vector2Int>();
return matchPositions.Distinct().ToList();
}
// This is the old implementation wherein any adjacent matches will detonate the bomb
private List<Vector2Int> DetonateThroughAdjacentMatches(IReadOnlyList<Vector2Int> matchPositions) {
HashSet<Vector2Int> candidates = new HashSet<Vector2Int>();
foreach (Vector2Int p in matchPositions)
{
candidates.Add(p + Vector2Int.left);
@@ -26,7 +32,7 @@ namespace Services
candidates.Add(p + Vector2Int.up);
candidates.Add(p + Vector2Int.down);
}
return candidates.ToList();
}