2025-07-26 06:56:07 +07:00
|
|
|
|
namespace WebApp;
|
|
|
|
|
|
|
|
|
|
|
|
internal record Coordinate
|
|
|
|
|
|
{
|
2025-07-30 21:59:04 +07:00
|
|
|
|
private static readonly string BasePath = Environment.GetEnvironmentVariable("ASSET_PATH_RO") ?? "";
|
2025-07-26 06:56:07 +07:00
|
|
|
|
public string Name { get; }
|
|
|
|
|
|
public int Row { get; }
|
|
|
|
|
|
public int Col { get; }
|
2025-08-01 08:36:27 +07:00
|
|
|
|
|
|
|
|
|
|
public string FullPath
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
string filename = Name + ".png";
|
|
|
|
|
|
return Path.Combine(BasePath, filename);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-07-26 06:56:07 +07:00
|
|
|
|
|
|
|
|
|
|
public Coordinate(string name)
|
|
|
|
|
|
{
|
|
|
|
|
|
Name = name;
|
2025-08-01 06:36:02 +07:00
|
|
|
|
(int row, int col) = Helper.ToRowCol(name);
|
2025-07-26 06:56:07 +07:00
|
|
|
|
Row = row;
|
|
|
|
|
|
Col = col;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Coordinate(int row, int col)
|
|
|
|
|
|
{
|
|
|
|
|
|
Row = row;
|
|
|
|
|
|
Col = col;
|
|
|
|
|
|
Name = Helper.ToLetters(row) + col;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
|
{
|
|
|
|
|
|
return Name;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|