Create All Needed Scripts

This commit is contained in:
2025-12-14 09:23:38 +08:00
parent 980b26dd5e
commit 6fe70bd113
53 changed files with 1988 additions and 195 deletions

View File

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