-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Upgrade all projects to net8.0 and lang v12 * Use primary ctors * Various small fixes and threat warnings as errors * Set github action to use net8.0
- Loading branch information
Showing
94 changed files
with
13,507 additions
and
13,719 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<LangVersion>10</LangVersion> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<LangVersion>12</LangVersion> | ||
<TreatWarningsAsErrors>True</TreatWarningsAsErrors> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace ConsoleEngine.Abstractions.Inputs | ||
namespace ConsoleEngine.Abstractions.Inputs; | ||
|
||
public interface IInputHandler | ||
{ | ||
public interface IInputHandler | ||
{ | ||
public KeyState GetKey(Key key) => GetKey((int)key); | ||
public IEnumerable<int> GetPressedKeyCodes(); | ||
KeyState GetKey(int id); | ||
void Update(); | ||
} | ||
public KeyState GetKey(Key key) => GetKey((int)key); | ||
public IEnumerable<int> GetPressedKeyCodes(); | ||
KeyState GetKey(int id); | ||
void Update(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,54 @@ | ||
namespace ConsoleEngine.Abstractions.Inputs | ||
namespace ConsoleEngine.Abstractions.Inputs; | ||
|
||
public enum Key : short | ||
{ | ||
public enum Key : short | ||
{ | ||
K0 = 0x30, K1 = 0x31, K2 = 0x32, K3 = 0x33, K4 = 0x34, | ||
K5 = 0x35, K6 = 0x36, K7 = 0x37, K8 = 0x38, K9 = 0x39, | ||
K0 = 0x30, K1 = 0x31, K2 = 0x32, K3 = 0x33, K4 = 0x34, | ||
K5 = 0x35, K6 = 0x36, K7 = 0x37, K8 = 0x38, K9 = 0x39, | ||
|
||
A = 0x41, B = 0x42, C = 0x43, D = 0x44, E = 0x45, | ||
F = 0x46, G = 0x47, H = 0x48, I = 0x49, J = 0x4A, | ||
K = 0x4B, L = 0x4C, M = 0x4D, N = 0x4E, O = 0x4F, | ||
P = 0x50, Q = 0x51, R = 0x52, S = 0x53, T = 0x54, | ||
U = 0x55, V = 0x56, W = 0x57, X = 0x58, Y = 0x59, | ||
Z = 0x5A, | ||
A = 0x41, B = 0x42, C = 0x43, D = 0x44, E = 0x45, | ||
F = 0x46, G = 0x47, H = 0x48, I = 0x49, J = 0x4A, | ||
K = 0x4B, L = 0x4C, M = 0x4D, N = 0x4E, O = 0x4F, | ||
P = 0x50, Q = 0x51, R = 0x52, S = 0x53, T = 0x54, | ||
U = 0x55, V = 0x56, W = 0x57, X = 0x58, Y = 0x59, | ||
Z = 0x5A, | ||
|
||
F1 = 0x70, F2 = 0x71, F3 = 0x72, F4 = 0x73, | ||
F5 = 0x74, F6 = 0x75, F7 = 0x76, F8 = 0x77, | ||
F9 = 0x78, F10 = 0x79, F11 = 0x7A, F12 = 0x7B, | ||
F1 = 0x70, F2 = 0x71, F3 = 0x72, F4 = 0x73, | ||
F5 = 0x74, F6 = 0x75, F7 = 0x76, F8 = 0x77, | ||
F9 = 0x78, F10 = 0x79, F11 = 0x7A, F12 = 0x7B, | ||
|
||
ESCAPE = 0x1B, | ||
CONVERT = 0x1C, | ||
NONCONVERT = 0x1D, | ||
ACCEPT = 0x1E, | ||
MODECHANGE = 0x1F, | ||
SPACE = 0x20, | ||
PRIOR = 0x21, | ||
NEXT = 0x22, | ||
END = 0x23, | ||
HOME = 0x24, | ||
LEFT = 0x25, | ||
UP = 0x26, | ||
RIGHT = 0x27, | ||
DOWN = 0x28, | ||
SELECT = 0x29, | ||
PRINT = 0x2A, | ||
EXECUTE = 0x2B, | ||
ENTER = 0x0D, | ||
SNAPSHOT = 0x2C, | ||
INSERT = 0x2D, | ||
DELETE = 0x2E, | ||
HELP = 0x2F, | ||
BACKSPACE = 0x08, | ||
ESCAPE = 0x1B, | ||
CONVERT = 0x1C, | ||
NONCONVERT = 0x1D, | ||
ACCEPT = 0x1E, | ||
MODECHANGE = 0x1F, | ||
SPACE = 0x20, | ||
PRIOR = 0x21, | ||
NEXT = 0x22, | ||
END = 0x23, | ||
HOME = 0x24, | ||
LEFT = 0x25, | ||
UP = 0x26, | ||
RIGHT = 0x27, | ||
DOWN = 0x28, | ||
SELECT = 0x29, | ||
PRINT = 0x2A, | ||
EXECUTE = 0x2B, | ||
ENTER = 0x0D, | ||
SNAPSHOT = 0x2C, | ||
INSERT = 0x2D, | ||
DELETE = 0x2E, | ||
HELP = 0x2F, | ||
BACKSPACE = 0x08, | ||
|
||
NUMPAD0 = 0x60, NUMPAD1 = 0x61, NUMPAD2 = 0x62, | ||
NUMPAD3 = 0x63, NUMPAD4 = 0x64, NUMPAD5 = 0x65, | ||
NUMPAD6 = 0x66, NUMPAD7 = 0x67, NUMPAD8 = 0x68, | ||
NUMPAD9 = 0x69, | ||
NUMPAD0 = 0x60, NUMPAD1 = 0x61, NUMPAD2 = 0x62, | ||
NUMPAD3 = 0x63, NUMPAD4 = 0x64, NUMPAD5 = 0x65, | ||
NUMPAD6 = 0x66, NUMPAD7 = 0x67, NUMPAD8 = 0x68, | ||
NUMPAD9 = 0x69, | ||
|
||
MULTIPLY = 0x6A, | ||
ADD = 0x6B, | ||
SEPARATOR = 0x6C, | ||
SUBTRACT = 0x6D, | ||
DECIMAL = 0x6E, | ||
DIVIDE = 0x6F, | ||
} | ||
MULTIPLY = 0x6A, | ||
ADD = 0x6B, | ||
SEPARATOR = 0x6C, | ||
SUBTRACT = 0x6D, | ||
DECIMAL = 0x6E, | ||
DIVIDE = 0x6F, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
namespace ConsoleEngine.Abstractions.Inputs | ||
namespace ConsoleEngine.Abstractions.Inputs; | ||
|
||
public struct KeyState | ||
{ | ||
public struct KeyState | ||
{ | ||
public bool Pressed { get; set; } | ||
public bool Released { get; set; } | ||
public bool Held { get; set; } | ||
public int Index { get; set; } | ||
} | ||
public bool Pressed { get; set; } | ||
public bool Released { get; set; } | ||
public bool Held { get; set; } | ||
public int Index { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
namespace ConsoleEngine.Abstractions.Rendering | ||
namespace ConsoleEngine.Abstractions.Rendering; | ||
|
||
public class FontInfo | ||
{ | ||
public class FontInfo | ||
{ | ||
public string FontFace { get; set; } | ||
public int FontWidth { get; set; } | ||
public int FontHeight { get; set; } | ||
} | ||
public string FontFace { get; set; } | ||
public int FontWidth { get; set; } | ||
public int FontHeight { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
using System; | ||
|
||
namespace ConsoleEngine.Abstractions.Rendering | ||
namespace ConsoleEngine.Abstractions.Rendering; | ||
|
||
public interface IConsoleHandler | ||
{ | ||
public interface IConsoleHandler | ||
{ | ||
public int Width { get; } | ||
public int Height { get; } | ||
public int Width { get; } | ||
public int Height { get; } | ||
|
||
void InitializeConsole(); | ||
void SetTitle(string title); | ||
void SetCursorVisible(bool visible); | ||
void Resizable(bool resizable); | ||
void SetFont(FontInfo fontInfo); | ||
void Render(Span<Pixel> pixels); | ||
void Close(); | ||
} | ||
void InitializeConsole(); | ||
void SetTitle(string title); | ||
void SetCursorVisible(bool visible); | ||
void Resizable(bool resizable); | ||
void SetFont(FontInfo fontInfo); | ||
void Render(Span<Pixel> pixels); | ||
void Close(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
using System; | ||
|
||
namespace ConsoleEngine.Abstractions.Rendering | ||
namespace ConsoleEngine.Abstractions.Rendering; | ||
|
||
public struct Pixel | ||
{ | ||
public struct Pixel | ||
{ | ||
public ConsoleColor ForegroundColor { get; set; } | ||
public ConsoleColor BackgroundColor { get; set; } | ||
public char Char { get; set; } | ||
public ConsoleColor ForegroundColor { get; set; } | ||
public ConsoleColor BackgroundColor { get; set; } | ||
public char Char { get; set; } | ||
|
||
|
||
public static readonly Pixel Blank = new() { ForegroundColor = ConsoleColor.Black, BackgroundColor = ConsoleColor.Black, Char = ' ' }; | ||
} | ||
public static readonly Pixel Blank = new() { ForegroundColor = ConsoleColor.Black, BackgroundColor = ConsoleColor.Black, Char = ' ' }; | ||
} |
Oops, something went wrong.