Files
match3-unity/Assets/Scripts/Utils/GemUtils.cs

21 lines
627 B
C#

using Enums;
using Models.Interfaces;
using Services;
using Structs;
using UnityEngine;
namespace Utils {
public static class GemUtils {
public static GemTypeValues GetGemValues(GemType type, GemTypeValues[] gemValues) {
foreach (GemTypeValues gemValue in gemValues) {
if(gemValue.type == type) return gemValue;
}
return default;
}
public static bool IsInBounds(Vector2Int position, IGameBoard gameBoard) {
return position.x >= 0 && position.x < gameBoard.Width && position.y >= 0 && position.y < gameBoard.Height;
}
}
}