-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameViewResolution.cs
54 lines (51 loc) · 1.61 KB
/
GameViewResolution.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Copyright (c) 2023 Koji Hasegawa.
// This software is released under the MIT License.
using System.Diagnostics.CodeAnalysis;
namespace TestHelper.Attributes
{
/// <summary>
/// Enum for <c>GameView</c> resolution.
/// </summary>
[SuppressMessage("ReSharper", "InconsistentNaming")]
[SuppressMessage("ReSharper", "MissingXmlDoc")]
public enum GameViewResolution
{
VGA,
XGA,
WXGA,
FullHD,
QHD,
FourK_UHD
}
/// <summary>
/// Extension methods for <c>GameViewResolution</c>.
/// </summary>
public static class GameViewResolutionExtensions
{
/// <summary>
/// Get resolution parameter.
/// </summary>
/// <param name="resolution"></param>
/// <returns>width, height, and name</returns>
public static (uint, uint, string) GetParameter(this GameViewResolution resolution)
{
switch (resolution)
{
case GameViewResolution.VGA:
return (640, 480, "VGA");
case GameViewResolution.XGA:
return (1024, 768, "XGA");
case GameViewResolution.WXGA:
return (1366, 768, "WXGA");
case GameViewResolution.FullHD:
return (1920, 1080, "Full HD");
case GameViewResolution.QHD:
return (2560, 1440, "QHD");
case GameViewResolution.FourK_UHD:
return (3840, 2160, "4K UHD");
default:
return (0, 0, "undefined");
}
}
}
}