Initial commit

This commit is contained in:
dennisarfan 2025-07-30 07:30:00 +07:00
commit ef3b7d68fb
30 changed files with 1568 additions and 0 deletions

55
Domain/Configuration.cs Normal file
View file

@ -0,0 +1,55 @@
namespace StitchATon2.Domain;
public class Configuration
{
public required string AssetPath { get; init; }
public required string CachePath { get; init; }
public required int Columns { get; init; }
public required int Rows { get; init; }
public required int Width { get; init; }
public required int Height { get; init; }
public int FullWidth => Width * Columns;
public int FullHeight => Height * Rows;
public int BottomTileIndex => Height - 1;
public int RightTileIndex => Width - 1;
public int TileCount => Columns * Rows;
public required int ImageCacheCapacity { get; init; }
public required int IntegralCacheCapacity { get; init; }
public static Configuration Default
{
get
{
var assetPath = Environment.GetEnvironmentVariable("ASSET_PATH_RO")!;
var cachePath = Path.Combine(Path.GetTempPath(), "d42df2a2-60ac-4dc3-a6b9-d4c04f2e08e6");
return new Configuration
{
AssetPath = assetPath,
CachePath = cachePath,
Columns = 55,
Rows = 31,
Width = 720,
Height = 720,
ImageCacheCapacity = 5,
IntegralCacheCapacity = 10,
};
}
}
public string GetAssetPath(string assetName)
{
return Path.Combine(AssetPath, assetName);
}
public string GetCachePath(string assetName)
{
return Path.Combine(CachePath, assetName);
}
}