Cleanup
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -4,15 +4,15 @@ using UnityEngine;
|
||||
|
||||
namespace Services {
|
||||
public class Gem {
|
||||
private GemType type;
|
||||
private readonly GemType type;
|
||||
private Vector2Int position;
|
||||
public GemType Type => this.type;
|
||||
public Vector2Int Position => this.position;
|
||||
|
||||
private int scoreValue;
|
||||
private readonly int scoreValue;
|
||||
public int ScoreValue => this.scoreValue;
|
||||
|
||||
private GemType colorType;
|
||||
private readonly GemType colorType;
|
||||
public GemType MatchColor => this.type == GemType.Bomb ? this.colorType : this.type;
|
||||
|
||||
public Gem(GemType type, Vector2Int position, GemTypeValues gemValue, GemType? colorType = null) {
|
||||
|
||||
Reference in New Issue
Block a user