Add resolutions service.

This commit is contained in:
2020-05-26 04:17:31 +01:00
parent 249c7a7baa
commit 3d2f0b7183
5 changed files with 78 additions and 29 deletions

View File

@@ -56,33 +56,5 @@ namespace Marechai.Database.Models
public virtual ICollection<Screen> Screens { get; set; }
public long? PaletteView => Palette ?? Colors;
public override string ToString()
{
if(Chars)
{
if(Colors == null)
return$"{Width}x{Height} characters";
if(Palette != null &&
Colors != Palette)
return Grayscale ? $"{Width}x{Height} characters at {Colors} grays from a palette of {Palette}"
: $"{Width}x{Height} characters at {Colors} colors from a palette of {Palette}";
return Colors == 2 && Grayscale ? $"{Width}x{Height} black and white characters"
: $"{Width}x{Height} characters at {Colors} colors";
}
if(Colors == null)
return$"{Width}x{Height} pixels";
if(Palette != null &&
Colors != Palette)
return Grayscale ? $"{Width}x{Height} pixels at {Colors} grays from a palette of {Palette}"
: $"{Width}x{Height} pixels at {Colors} colors from a palette of {Palette}";
return Colors == 2 && Grayscale ? $"{Width}x{Height} black and white pixels"
: $"{Width}x{Height} pixels at {Colors} colors";
}
}
}