Skip to content

Commit

Permalink
Merge pull request #17 from geeooff/feature/cleanup
Browse files Browse the repository at this point in the history
Added shared properties, vscode tasks, publishing features, nullable ref types, file-based namespaces, general cleanup, and code styling modernization
  • Loading branch information
geeooff authored Mar 18, 2024
2 parents 038baed + b2744c4 commit 18341b9
Show file tree
Hide file tree
Showing 58 changed files with 9,671 additions and 2,327 deletions.
124 changes: 84 additions & 40 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,86 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/Console/ForzaData.Console.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/Console/ForzaData.Console.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"${workspaceFolder}/Console/ForzaData.Console.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
}
]
"version": "2.0.0",
"options": {
"cwd": "${workspaceFolder}",
},
"presentation": {
"echo": false,
"focus": true,
"panel": "dedicated",
"showReuseMessage": false,
"clear": true
},
"tasks": [
{
"label": "restore",
"icon": {
"id": "package"
},
"command": "dotnet",
"type": "process",
"args": [
"restore",
"--use-current-runtime",
"--force-evaluate",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "build",
"icon": {
"id": "run"
},
"command": "dotnet",
"type": "process",
"args": [
"build",
"--use-current-runtime",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "test",
"icon": {
"id": "beaker"
},
"command": "dotnet",
"type": "process",
"args": [
"test",
"--results-directory", "TestResults",
"--logger", "html;LogFileName=TestResult.html",
"--logger", "trx;LogFileName=TestResult.trx",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile",
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "publish",
"icon": {
"id": "rocket"
},
"command": "dotnet",
"type": "process",
"args": [
"publish",
"--use-current-runtime",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
]
}
25 changes: 10 additions & 15 deletions Console/Arguments.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
using ForzaData.Core;
using System;
using System.Collections.Generic;
using System.Net;
using System.Text;
using PowArgs.Attributes;

namespace ForzaData.Console
namespace ForzaData.Console;

public class Arguments
{
public class Arguments
{
[PowArgs.Attributes.Argument("UDP local network port to bind")]
public int Port { get; set; } = 7777;
[Argument("UDP local network port to bind")]
public int Port { get; set; } = 7777;

[PowArgs.Attributes.Argument("IP of server (your PC or console running the game) to listen to", required: true)]
public string ServerIpAddress { get; set; }
[Argument("IP of server (your PC or console running the game) to listen to", required: true)]
public string? ServerIpAddress { get; set; }

[PowArgs.Attributes.Argument("Show this program arguments help")]
public bool Help { get; set; } = false;
}
[Argument("Show this program arguments help")]
public bool Help { get; set; } = false;
}
8 changes: 4 additions & 4 deletions Console/CarClasses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ private static class Motorsport
_ => false
};

internal static string GetMotorsportCarClassCode(int carClass) => carClass switch
internal static string? GetMotorsportCarClassCode(int carClass) => carClass switch
{
0 => "E",
1 => "D",
Expand Down Expand Up @@ -47,7 +47,7 @@ private static class Horizon
_ => false
};

internal static string GetHorizonCarClassCode(int carClass) => carClass switch
internal static string? GetHorizonCarClassCode(int carClass) => carClass switch
{
0 => "D",
1 => "C",
Expand All @@ -60,9 +60,9 @@ private static class Horizon
};
}

public static string GetCarClassCode(int carClass, int carPerformance)
public static string? GetCarClassCode(int carClass, int carPerformance)
{
string carClassCode = null;
string? carClassCode = null;

if (Motorsport.IsMotorsportCarClass(carClass, carPerformance))
carClassCode = Motorsport.GetMotorsportCarClassCode(carClass);
Expand Down
22 changes: 3 additions & 19 deletions Console/ForzaData.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,18 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<Version>0.8</Version>
<Authors>Geoffrey Vancoetsem</Authors>
<Company></Company>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/geeooff/forza-data-web</RepositoryUrl>
<Product>ForzaDataWeb</Product>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="PowArgs" Version="1.1.0" />
<None Remove="packages.lock.json" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Core\ForzaData.Core.csproj" />
<PackageReference Include="PowArgs" Version="1.1.0" />
</ItemGroup>

<ItemGroup>
<None Include="..\LICENSE">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
<ProjectReference Include="..\Core\ForzaData.Core.csproj" />
</ItemGroup>

</Project>
Loading

0 comments on commit 18341b9

Please sign in to comment.