38 lines
No EOL
781 B
C#
38 lines
No EOL
781 B
C#
namespace WebApp;
|
|
|
|
internal record Coordinate
|
|
{
|
|
private static readonly string BasePath = Environment.GetEnvironmentVariable("ASSET_PATH_RO") ?? "";
|
|
public string Name { get; }
|
|
public int Row { get; }
|
|
public int Col { get; }
|
|
|
|
public string FullPath
|
|
{
|
|
get
|
|
{
|
|
string filename = Name + ".png";
|
|
return Path.Combine(BasePath, filename);
|
|
}
|
|
}
|
|
|
|
public Coordinate(string name)
|
|
{
|
|
Name = name;
|
|
(int row, int col) = Helper.ToRowCol(name);
|
|
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;
|
|
}
|
|
} |