Skip to content

Commit

Permalink
update(net): net8
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexis Huvier committed Nov 28, 2023
1 parent 1b5d5a1 commit 110e4d5
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 149 deletions.
18 changes: 0 additions & 18 deletions .config/dotnet-tools.json

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ obj/
riderModule.iml
/_ReSharper.Caches/
Testing/steam_appid.txt
.vs/
22 changes: 0 additions & 22 deletions .husky/pre-commit

This file was deleted.

10 changes: 0 additions & 10 deletions .husky/task-runner.json

This file was deleted.

13 changes: 0 additions & 13 deletions .idea/.idea.SharpEngine.Steamworks/.idea/.gitignore

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/.idea.SharpEngine.Steamworks/.idea/indexLayout.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/.idea.SharpEngine.Steamworks/.idea/misc.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/.idea.SharpEngine.Steamworks/.idea/vcs.xml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Steamworks Package for SharpEngine - C# 2D Game Engine

## Dependencies

- Net7
- Net8
- SharpEngine.Core
- Steamworks.NET
8 changes: 1 addition & 7 deletions SharpEngine.Steamworks/SharpEngine.Steamworks.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down Expand Up @@ -33,10 +33,4 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

<!-- set HUSKY to 0 in CI\/CD disable this -->
<Target Name="Husky" BeforeTargets="Restore;CollectPackageReferences" Condition="'$(HUSKY)' != 0">
<Exec Command="dotnet tool restore" StandardOutputImportance="Low" StandardErrorImportance="High" />
<Exec Command="dotnet husky install" StandardOutputImportance="Low" StandardErrorImportance="High" WorkingDirectory=".." />
</Target>
</Project>
46 changes: 17 additions & 29 deletions SharpEngine.Steamworks/Steam/Achievement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,41 @@ namespace SharpEngine.Steamworks.Steam;
/// <summary>
/// Class which represents Steam Achievement
/// </summary>
public class Achievement
/// <param name="achievementId">Achievement Id</param>
/// <param name="displayName">Achievement Name</param>
/// <param name="displayDescription">Achievement Description</param>
/// <param name="achieved">Achievement Achieved</param>
/// <param name="icon">Achievement Icon</param>
public class Achievement(
string achievementId,
string displayName = "",
string displayDescription = "",
bool achieved = false,
int icon = 0
)
{
/// <summary>
/// Id of Achievement
/// </summary>
public string AchievementId { get; }
public string AchievementId { get; } = achievementId;

/// <summary>
/// Name of Achievement
/// </summary>
public string DisplayName { get; set; }
public string DisplayName { get; set; } = displayName;

/// <summary>
/// Description of Achievement
/// </summary>
public string DisplayDescription { get; set; }
public string DisplayDescription { get; set; } = displayDescription;

/// <summary>
/// If Achievement is achieve
/// </summary>
public bool Achieved { get; set; }
public bool Achieved { get; set; } = achieved;

/// <summary>
/// Icon of Achievement
/// </summary>
public int Icon { get; set; }

/// <summary>
/// Create Achievement
/// </summary>
/// <param name="achievementId">Achievement Id</param>
/// <param name="displayName">Achievement Name</param>
/// <param name="displayDescription">Achievement Description</param>
/// <param name="achieved">Achievement Achieved</param>
/// <param name="icon">Achievement Icon</param>
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;
}
24 changes: 7 additions & 17 deletions SharpEngine.Steamworks/Steam/ItemInstallInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,23 @@ namespace SharpEngine.Steamworks.Steam;
/// <summary>
/// Class which represents install info of steam item
/// </summary>
public class ItemInstallInfo
/// <param name="sizeOnDisk">Item Size</param>
/// <param name="folder">Item Folder</param>
/// <param name="timestamp">Item Install Timestamp</param>
public class ItemInstallInfo(ulong sizeOnDisk, string folder, uint timestamp)
{
/// <summary>
/// Size of Item
/// </summary>
public ulong SizeOnDisk { get; }
public ulong SizeOnDisk { get; } = sizeOnDisk;

/// <summary>
/// Folder of Item
/// </summary>
public string Folder { get; }
public string Folder { get; } = folder;

/// <summary>
/// Install timestamp of Item
/// </summary>
public uint Timestamp { get; }

/// <summary>
/// Create Item Install Info
/// </summary>
/// <param name="sizeOnDisk">Item Size</param>
/// <param name="folder">Item Folder</param>
/// <param name="timestamp">Item Install Timestamp</param>
public ItemInstallInfo(ulong sizeOnDisk, string folder, uint timestamp)
{
SizeOnDisk = sizeOnDisk;
Folder = folder;
Timestamp = timestamp;
}
public uint Timestamp { get; } = timestamp;
}
6 changes: 2 additions & 4 deletions SharpEngine.Steamworks/SteamManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static class SteamManager
private static bool _requestedStats;
private static bool _statsValid;
private static bool _storeStats;
private static readonly List<Achievement> Achievements = new();
private static readonly List<Achievement> Achievements = [];

/// <summary>
/// Is SteamManager is Running
Expand Down Expand Up @@ -140,9 +140,7 @@ public static IEnumerable<PublishedFileId_t> GetSubscribedItems()
{
var nb = SteamUGC.GetNumSubscribedItems();
var items = new PublishedFileId_t[nb];
return SteamUGC.GetSubscribedItems(items, nb) != 0
? items
: Array.Empty<PublishedFileId_t>();
return SteamUGC.GetSubscribedItems(items, nb) != 0 ? items : [];
}

/// <summary>
Expand Down
8 changes: 1 addition & 7 deletions Testing/Testing.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand All @@ -13,10 +13,4 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

<!-- set HUSKY to 0 in CI\/CD disable this -->
<Target Name="Husky" BeforeTargets="Restore;CollectPackageReferences" Condition="'$(HUSKY)' != 0">
<Exec Command="dotnet tool restore" StandardOutputImportance="Low" StandardErrorImportance="High" />
<Exec Command="dotnet husky install" StandardOutputImportance="Low" StandardErrorImportance="High" WorkingDirectory=".." />
</Target>
</Project>

0 comments on commit 110e4d5

Please sign in to comment.