This commit is contained in:
2025-12-18 03:49:05 +08:00
parent 668bd03f63
commit 667a39c260
8 changed files with 6 additions and 18 deletions

View File

@@ -4,7 +4,6 @@ using System.Collections.Generic;
using Cysharp.Threading.Tasks; using Cysharp.Threading.Tasks;
using Enums; using Enums;
using Models.Interfaces; using Models.Interfaces;
using Structs;
using UnityEngine; using UnityEngine;
namespace Services.Interfaces namespace Services.Interfaces

View File

@@ -2,7 +2,6 @@ using System.Collections.Generic;
using Cysharp.Threading.Tasks; using Cysharp.Threading.Tasks;
using UnityEngine; using UnityEngine;
using Enums; using Enums;
using Structs;
namespace Services.Interfaces { namespace Services.Interfaces {
public interface IMatchService { public interface IMatchService {

View File

@@ -1,24 +1,18 @@
using Presenter;
using Services.Interfaces; using Services.Interfaces;
using UnityEngine; using UnityEngine;
using VContainer.Unity; using VContainer.Unity;
using Views;
namespace Services namespace Services
{ {
public class LevelEntryPoint : IStartable public class LevelEntryPoint : IStartable
{ {
private readonly IObjectPool<GemView> gemViewPool;
private readonly IGameBoardService gameBoardService; private readonly IGameBoardService gameBoardService;
private readonly IInputService inputService; private readonly IInputService inputService;
private readonly AudioPresenter audioPresenter;
public LevelEntryPoint(IObjectPool<GemView> gemViewPool, IGameBoardService gameBoardService, IInputService inputService, AudioPresenter audioPresenter) public LevelEntryPoint(IGameBoardService gameBoardService, IInputService inputService)
{ {
this.gemViewPool = gemViewPool;
this.gameBoardService = gameBoardService; this.gameBoardService = gameBoardService;
this.inputService = inputService; this.inputService = inputService;
this.audioPresenter = audioPresenter;
} }
public void Start() public void Start()

View File

@@ -4,7 +4,6 @@ using Cysharp.Threading.Tasks;
using Enums; using Enums;
using Models.Interfaces; using Models.Interfaces;
using Services.Interfaces; using Services.Interfaces;
using Structs;
using UnityEngine; using UnityEngine;
namespace Services { namespace Services {

View File

@@ -1,10 +1,9 @@
using System; using System;
using Services.Interfaces; using Services.Interfaces;
using UnityEngine;
namespace Services { namespace Services {
public class ScoreService : IScoreService { public class ScoreService : IScoreService {
private int score = 0; private int score;
public int Score => this.score; public int Score => this.score;
public event Action<int> OnScoreChanged; public event Action<int> OnScoreChanged;
public void AddScore(int value) { public void AddScore(int value) {

View File

@@ -1,6 +1,5 @@
using Enums; using Enums;
using Models.Interfaces; using Models.Interfaces;
using Services;
using Structs; using Structs;
using UnityEngine; using UnityEngine;

View File

@@ -1,11 +1,10 @@
using System; using System;
using System.Linq;
using Enums; using Enums;
using Random = UnityEngine.Random; using Random = UnityEngine.Random;
namespace Utils { namespace Utils {
public static class RandomUtils { public static class RandomUtils {
private static readonly GemType[] spawnableGems = BuildSpawnableGems(); private static readonly GemType[] SPAWNABLE_GEMS = BuildSpawnableGems();
private static GemType[] BuildSpawnableGems() { private static GemType[] BuildSpawnableGems() {
Array values = Enum.GetValues(typeof(GemType)); Array values = Enum.GetValues(typeof(GemType));
@@ -31,7 +30,7 @@ namespace Utils {
} }
public static GemType RandomGemType() { public static GemType RandomGemType() {
return spawnableGems[Random.Range(0, spawnableGems.Length)]; return SPAWNABLE_GEMS[Random.Range(0, SPAWNABLE_GEMS.Length)];
} }
} }
} }

View File

@@ -19,11 +19,11 @@ namespace Views {
private CancellationTokenSource spawnScaleCts; private CancellationTokenSource spawnScaleCts;
public void Bind(Gem gem, GemTypeValues gemvalue, bool isBomb = false) { public void Bind(Gem gem, GemTypeValues gemValue, bool isBomb = false) {
this.gem = gem; this.gem = gem;
this.gameObject.SetActive(true); this.gameObject.SetActive(true);
SetupGem(isBomb, gemvalue.gemSprite); SetupGem(isBomb, gemValue.gemSprite);
PlaySpawnScale(); PlaySpawnScale();
} }