This commit is contained in:
2025-12-17 00:55:30 +08:00
parent 85b9767201
commit 3786863b00
13 changed files with 37 additions and 73 deletions

View File

@@ -3,10 +3,10 @@ using UnityEngine;
namespace Services {
public class GameBoard : IGameBoard {
private int height, width;
private readonly int height, width;
public int Height => this.height;
public int Width => this.width;
private Gem[,] gemsGrid;
private readonly Gem[,] gemsGrid;
public Gem[,] GemsGrid => this.gemsGrid;
public GameBoard(int width, int height) {
@@ -17,7 +17,7 @@ namespace Services {
public Gem GetGemAt(Vector2Int pos) {
Gem gameObject = this.gemsGrid[pos.x, pos.y];
return gameObject != null ? gameObject : null;
return gameObject;
}
public void SetGemAt(Vector2Int pos, Gem gameObject) {