From 110e4d55872091b08ab5589f417865ef3fbe23eb Mon Sep 17 00:00:00 2001 From: Alexis Huvier Date: Tue, 28 Nov 2023 22:51:03 +0100 Subject: [PATCH] update(net): net8 --- .config/dotnet-tools.json | 18 -------- .gitignore | 1 + .husky/pre-commit | 22 --------- .husky/task-runner.json | 10 ---- .../.idea/.gitignore | 13 ------ .../.idea/indexLayout.xml | 8 ---- .../.idea/misc.xml | 7 --- .../.idea/vcs.xml | 6 --- README.md | 2 +- .../SharpEngine.Steamworks.csproj | 8 +--- SharpEngine.Steamworks/Steam/Achievement.cs | 46 +++++++------------ .../Steam/ItemInstallInfo.cs | 24 +++------- SharpEngine.Steamworks/SteamManager.cs | 6 +-- Testing/Testing.csproj | 8 +--- 14 files changed, 30 insertions(+), 149 deletions(-) delete mode 100644 .config/dotnet-tools.json delete mode 100755 .husky/pre-commit delete mode 100644 .husky/task-runner.json delete mode 100644 .idea/.idea.SharpEngine.Steamworks/.idea/.gitignore delete mode 100644 .idea/.idea.SharpEngine.Steamworks/.idea/indexLayout.xml delete mode 100644 .idea/.idea.SharpEngine.Steamworks/.idea/misc.xml delete mode 100644 .idea/.idea.SharpEngine.Steamworks/.idea/vcs.xml diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json deleted file mode 100644 index 2377ad4..0000000 --- a/.config/dotnet-tools.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "version": 1, - "isRoot": true, - "tools": { - "husky": { - "version": "0.6.2", - "commands": [ - "husky" - ] - }, - "csharpier": { - "version": "0.25.0", - "commands": [ - "dotnet-csharpier" - ] - } - } -} \ No newline at end of file diff --git a/.gitignore b/.gitignore index c23efda..b291ae4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ obj/ riderModule.iml /_ReSharper.Caches/ Testing/steam_appid.txt +.vs/ \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100755 index 0a41ede..0000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -## husky task runner examples ------------------- -## Note : for local installation use 'dotnet' prefix. e.g. 'dotnet husky' - -## run all tasks -#husky run - -### run all tasks with group: 'group-name' -#husky run --group group-name - -## run task with name: 'task-name' -#husky run --name task-name - -## pass hook arguments to task -#husky run --args "$1" "$2" - -## or put your custom commands ------------------- -#echo 'Husky.Net is awesome!' - -dotnet husky run --name format diff --git a/.husky/task-runner.json b/.husky/task-runner.json deleted file mode 100644 index abc22f7..0000000 --- a/.husky/task-runner.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "tasks": [ - { - "name": "format", - "command": "dotnet", - "args": [ "csharpier", "${staged}" ], - "include": [ "**/*.cs" ] - } - ] -} diff --git a/.idea/.idea.SharpEngine.Steamworks/.idea/.gitignore b/.idea/.idea.SharpEngine.Steamworks/.idea/.gitignore deleted file mode 100644 index 3b40b26..0000000 --- a/.idea/.idea.SharpEngine.Steamworks/.idea/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Rider ignored files -/modules.xml -/.idea.SharpEngine.Steamworks.iml -/contentModel.xml -/projectSettingsUpdater.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/.idea.SharpEngine.Steamworks/.idea/indexLayout.xml b/.idea/.idea.SharpEngine.Steamworks/.idea/indexLayout.xml deleted file mode 100644 index 7b08163..0000000 --- a/.idea/.idea.SharpEngine.Steamworks/.idea/indexLayout.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/.idea.SharpEngine.Steamworks/.idea/misc.xml b/.idea/.idea.SharpEngine.Steamworks/.idea/misc.xml deleted file mode 100644 index 30bab2a..0000000 --- a/.idea/.idea.SharpEngine.Steamworks/.idea/misc.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/.idea.SharpEngine.Steamworks/.idea/vcs.xml b/.idea/.idea.SharpEngine.Steamworks/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/.idea.SharpEngine.Steamworks/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/README.md b/README.md index d627066..326ec1d 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,6 @@ Steamworks Package for SharpEngine - C# 2D Game Engine ## Dependencies -- Net7 +- Net8 - SharpEngine.Core - Steamworks.NET diff --git a/SharpEngine.Steamworks/SharpEngine.Steamworks.csproj b/SharpEngine.Steamworks/SharpEngine.Steamworks.csproj index 1d1fb23..853f8c1 100644 --- a/SharpEngine.Steamworks/SharpEngine.Steamworks.csproj +++ b/SharpEngine.Steamworks/SharpEngine.Steamworks.csproj @@ -1,6 +1,6 @@  - net7.0 + net8.0 enable enable true @@ -33,10 +33,4 @@ Always - - - - - - \ No newline at end of file diff --git a/SharpEngine.Steamworks/Steam/Achievement.cs b/SharpEngine.Steamworks/Steam/Achievement.cs index f33abbd..cb73340 100644 --- a/SharpEngine.Steamworks/Steam/Achievement.cs +++ b/SharpEngine.Steamworks/Steam/Achievement.cs @@ -3,53 +3,41 @@ namespace SharpEngine.Steamworks.Steam; /// /// Class which represents Steam Achievement /// -public class Achievement +/// Achievement Id +/// Achievement Name +/// Achievement Description +/// Achievement Achieved +/// Achievement Icon +public class Achievement( + string achievementId, + string displayName = "", + string displayDescription = "", + bool achieved = false, + int icon = 0 + ) { /// /// Id of Achievement /// - public string AchievementId { get; } + public string AchievementId { get; } = achievementId; /// /// Name of Achievement /// - public string DisplayName { get; set; } + public string DisplayName { get; set; } = displayName; /// /// Description of Achievement /// - public string DisplayDescription { get; set; } + public string DisplayDescription { get; set; } = displayDescription; /// /// If Achievement is achieve /// - public bool Achieved { get; set; } + public bool Achieved { get; set; } = achieved; /// /// Icon of Achievement /// - public int Icon { get; set; } - - /// - /// Create Achievement - /// - /// Achievement Id - /// Achievement Name - /// Achievement Description - /// Achievement Achieved - /// Achievement Icon - public Achievement( - string achievementId, - string displayName = "", - string displayDescription = "", - bool achieved = false, - int icon = 0 - ) - { - AchievementId = achievementId; - DisplayName = displayName; - DisplayDescription = displayDescription; - Achieved = achieved; - Icon = icon; - } + public int Icon { get; set; } = icon; } diff --git a/SharpEngine.Steamworks/Steam/ItemInstallInfo.cs b/SharpEngine.Steamworks/Steam/ItemInstallInfo.cs index 8e9ebcf..9342376 100644 --- a/SharpEngine.Steamworks/Steam/ItemInstallInfo.cs +++ b/SharpEngine.Steamworks/Steam/ItemInstallInfo.cs @@ -3,33 +3,23 @@ namespace SharpEngine.Steamworks.Steam; /// /// Class which represents install info of steam item /// -public class ItemInstallInfo +/// Item Size +/// Item Folder +/// Item Install Timestamp +public class ItemInstallInfo(ulong sizeOnDisk, string folder, uint timestamp) { /// /// Size of Item /// - public ulong SizeOnDisk { get; } + public ulong SizeOnDisk { get; } = sizeOnDisk; /// /// Folder of Item /// - public string Folder { get; } + public string Folder { get; } = folder; /// /// Install timestamp of Item /// - public uint Timestamp { get; } - - /// - /// Create Item Install Info - /// - /// Item Size - /// Item Folder - /// Item Install Timestamp - public ItemInstallInfo(ulong sizeOnDisk, string folder, uint timestamp) - { - SizeOnDisk = sizeOnDisk; - Folder = folder; - Timestamp = timestamp; - } + public uint Timestamp { get; } = timestamp; } diff --git a/SharpEngine.Steamworks/SteamManager.cs b/SharpEngine.Steamworks/SteamManager.cs index 2825ef5..f427113 100644 --- a/SharpEngine.Steamworks/SteamManager.cs +++ b/SharpEngine.Steamworks/SteamManager.cs @@ -16,7 +16,7 @@ public static class SteamManager private static bool _requestedStats; private static bool _statsValid; private static bool _storeStats; - private static readonly List Achievements = new(); + private static readonly List Achievements = []; /// /// Is SteamManager is Running @@ -140,9 +140,7 @@ public static IEnumerable GetSubscribedItems() { var nb = SteamUGC.GetNumSubscribedItems(); var items = new PublishedFileId_t[nb]; - return SteamUGC.GetSubscribedItems(items, nb) != 0 - ? items - : Array.Empty(); + return SteamUGC.GetSubscribedItems(items, nb) != 0 ? items : []; } /// diff --git a/Testing/Testing.csproj b/Testing/Testing.csproj index 24553a6..5bfa028 100644 --- a/Testing/Testing.csproj +++ b/Testing/Testing.csproj @@ -1,7 +1,7 @@  Exe - net7.0 + net8.0 enable enable @@ -13,10 +13,4 @@ Always - - - - - - \ No newline at end of file