Cleanup GameBOardService

This commit is contained in:
2025-12-17 06:34:57 +08:00
parent b3dc2cb4bd
commit 2de9359dda
6 changed files with 91 additions and 79 deletions

View File

@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using Cysharp.Threading.Tasks;
using Enums;
using Models.Interfaces;
using Structs;
using UnityEngine;
@@ -12,9 +13,10 @@ namespace Services.Interfaces
public BombSpawnRequest? PendingBombSpawn { get; }
void SetLastSwap(Vector2Int from, Vector2Int to);
void ClearPendingBombs();
void DetectBombSpawnFromLastSwap(List<Gem> currentMatches);
List<Vector2Int> ApplyPendingBombSpawns(Action<Vector2Int, GemType, bool> spawnGem);
UniTask<List<Vector2Int>> GetInitialBombs(List<Vector2Int> protectedPositions, List<Vector2Int> bombCandidates);
UniTask DetonateChainAsync(
IReadOnlyList<Vector2Int> initialBombs,

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using Cysharp.Threading.Tasks;
using UnityEngine;
using Enums;
using Structs;
@@ -6,6 +7,7 @@ using Structs;
namespace Services.Interfaces {
public interface IMatchService {
List<Gem> CurrentMatches { get; }
UniTask<List<Vector2Int>> GetMatchPositionsAsync(List<Vector2Int> protectedPositions);
bool MatchesAt(Vector2Int positionToCheck, GemType gemTypeToCheck);
void FindAllMatches();
}