Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
PhantomGamers committed Dec 14, 2023
1 parent a176856 commit 888e229
Show file tree
Hide file tree
Showing 600 changed files with 32,432 additions and 30,170 deletions.
116 changes: 58 additions & 58 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<DevEnvLoc>$(MSBuildThisFileDirectory)DevEnv.targets</DevEnvLoc>
</PropertyGroup>

<!-- This sets $(DSPGameDir) -->
<Import Project="$(DevEnvLoc)" Condition="Exists('$(DevEnvLoc)')" />

<PropertyGroup Label="Game Install Properties">
<DSPGameDir Condition="!Exists('$(DevEnvLoc)')">C:\Program Files (x86)\Steam\steamapps\common\Dyson Sphere Program\</DSPGameDir>
<DSPGameDir>$([MSBuild]::EnsureTrailingSlash('$(DSPGameDir)'))</DSPGameDir>
<PluginOutputDirectory>$(DSPGameDir)BepInEx\plugins\nebula-NebulaMultiplayerMod\</PluginOutputDirectory>
<PropSheetPath>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)'))</PropSheetPath>
<PluginOutputDirectory Condition="Exists('$(PropSheetPath).remoteBuild')">$(PropSheetPath)dist\release\nebula-NebulaMultiplayerMod\</PluginOutputDirectory>
</PropertyGroup>

<PropertyGroup Label="Common Properties">
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

<OutputPath Condition="Exists('$(DSPGameDir)') Or Exists('$(PropSheetPath).remoteBuild')">$(PluginOutputDirectory)</OutputPath>
<TargetFramework>net472</TargetFramework>
<LangVersion>latest</LangVersion>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<DefaultItemExcludes>$(DefaultItemExcludes);*.binlog</DefaultItemExcludes>

<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<GitVersionBaseDirectory>$(MSBuildThisFileDirectory)</GitVersionBaseDirectory>
</PropertyGroup>

<PropertyGroup Label="API Properties" Condition=" '$(MSBuildProjectName)' == 'NebulaAPI' " >
<OutputPath Condition="Exists('$(DSPGameDir)') Or Exists('$(PropSheetPath).remoteBuild')">$(OutputPath)..\nebula-NebulaMultiplayerModApi</OutputPath>
</PropertyGroup>
<!-- Shared Items -->
<ItemGroup Label="NuGets">
<PackageReference Include="Microsoft.Unity.Analyzers" Version="1.*" PrivateAssets="all" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.*" PrivateAssets="all" />
</ItemGroup>

<ItemGroup Label="NuGetsMain" Condition=" '$(MSBuildProjectName)' != 'NebulaAPI' ">
<PackageReference Include="K4os.Compression.LZ4.Streams" Version="1.*" />
</ItemGroup>

<ItemGroup Label="Core">
<PackageReference Include="BepInEx.Core" Version="5.*" PrivateAssets="all" />
<PackageReference Include="UnityEngine.Modules" Version="2018.4.12" IncludeAssets="compile" PrivateAssets="all" />
<PackageReference Include="DysonSphereProgram.GameLibs" Version="*-*" IncludeAssets="compile" PrivateAssets="all" />
<PackageReference Include="DysonSphereProgram.Modding.CommonAPI" Version="1.4.5" IncludeAssets="compile" PrivateAssets="all"
Condition=" '$(MSBuildProjectName)' != 'NebulaAPI' " />

</ItemGroup>

<ItemGroup Condition="'$(TargetFramework.TrimEnd(`0123456789`))' == 'net'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="all" />
</ItemGroup>
<PropertyGroup>
<DevEnvLoc>$(MSBuildThisFileDirectory)DevEnv.targets</DevEnvLoc>
</PropertyGroup>

<!-- This sets $(DSPGameDir) -->
<Import Project="$(DevEnvLoc)" Condition="Exists('$(DevEnvLoc)')"/>

<PropertyGroup Label="Game Install Properties">
<DSPGameDir Condition="!Exists('$(DevEnvLoc)')">C:\Program Files (x86)\Steam\steamapps\common\Dyson Sphere Program\</DSPGameDir>
<DSPGameDir>$([MSBuild]::EnsureTrailingSlash('$(DSPGameDir)'))</DSPGameDir>
<PluginOutputDirectory>$(DSPGameDir)BepInEx\plugins\nebula-NebulaMultiplayerMod\</PluginOutputDirectory>
<PropSheetPath>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)'))</PropSheetPath>
<PluginOutputDirectory Condition="Exists('$(PropSheetPath).remoteBuild')">$(PropSheetPath)dist\release\nebula-NebulaMultiplayerMod\</PluginOutputDirectory>
</PropertyGroup>

<PropertyGroup Label="Common Properties">
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

<OutputPath Condition="Exists('$(DSPGameDir)') Or Exists('$(PropSheetPath).remoteBuild')">$(PluginOutputDirectory)</OutputPath>
<TargetFramework>net472</TargetFramework>
<LangVersion>latest</LangVersion>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<DefaultItemExcludes>$(DefaultItemExcludes);*.binlog</DefaultItemExcludes>

<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<GitVersionBaseDirectory>$(MSBuildThisFileDirectory)</GitVersionBaseDirectory>
</PropertyGroup>

<PropertyGroup Label="API Properties" Condition=" '$(MSBuildProjectName)' == 'NebulaAPI' ">
<OutputPath Condition="Exists('$(DSPGameDir)') Or Exists('$(PropSheetPath).remoteBuild')">$(OutputPath)..\nebula-NebulaMultiplayerModApi</OutputPath>
</PropertyGroup>

<!-- Shared Items -->
<ItemGroup Label="NuGets">
<PackageReference Include="Microsoft.Unity.Analyzers" Version="1.*" PrivateAssets="all"/>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.*" PrivateAssets="all"/>
</ItemGroup>

<ItemGroup Label="NuGetsMain" Condition=" '$(MSBuildProjectName)' != 'NebulaAPI' ">
<PackageReference Include="K4os.Compression.LZ4.Streams" Version="1.*"/>
</ItemGroup>

<ItemGroup Label="Core">
<PackageReference Include="BepInEx.Core" Version="5.*" PrivateAssets="all"/>
<PackageReference Include="UnityEngine.Modules" Version="2018.4.12" IncludeAssets="compile" PrivateAssets="all"/>
<PackageReference Include="DysonSphereProgram.GameLibs" Version="*-*" IncludeAssets="compile" PrivateAssets="all"/>
<PackageReference Include="DysonSphereProgram.Modding.CommonAPI" Version="1.4.5" IncludeAssets="compile" PrivateAssets="all"
Condition=" '$(MSBuildProjectName)' != 'NebulaAPI' "/>

</ItemGroup>

<ItemGroup Condition="'$(TargetFramework.TrimEnd(`0123456789`))' == 'net'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="all"/>
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildThisFileDirectory)SharedConfig.targets"/>
<Import Project="$(MSBuildThisFileDirectory)SharedConfig.targets"/>
</Project>
3 changes: 2 additions & 1 deletion NebulaAPI/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@

1.1.0:

- Float3 IPlayerData.MechaColor has been changed to Float4[] IPlayerData.MechaColors in line with changes introduced in DSP version 0.8.21.8562.
- Float3 IPlayerData.MechaColor has been changed to Float4[] IPlayerData.MechaColors in line with changes introduced in
DSP version 0.8.21.8562.
- Edited description.

1.0.0:
Expand Down
51 changes: 27 additions & 24 deletions NebulaAPI/DataStructures/CollectionExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,37 +1,40 @@
using System;
#region

using System;
using System.Collections;
using System.Threading;

namespace NebulaAPI
#endregion

namespace NebulaAPI;

public static class CollectionExtensions
{
public static class CollectionExtensions
public static Locker Lock(this ICollection collection)
{
public static Locker Lock(this ICollection collection)
{
return new Locker(collection.SyncRoot);
}

public static Locker GetLocked<T>(this T collection, out T result) where T : ICollection
{
result = collection;
return new Locker(collection.SyncRoot);
}
return new Locker(collection.SyncRoot);
}

public readonly struct Locker : IDisposable
public static Locker GetLocked<T>(this T collection, out T result) where T : ICollection
{
private readonly object lockObject;
result = collection;
return new Locker(collection.SyncRoot);
}
}

public Locker(object lockObject)
{
this.lockObject = lockObject;
public readonly struct Locker : IDisposable
{
private readonly object lockObject;

Monitor.Enter(lockObject);
}
public Locker(object lockObject)
{
this.lockObject = lockObject;

public void Dispose()
{
Monitor.Exit(lockObject);
}
Monitor.Enter(lockObject);
}

public void Dispose()
{
Monitor.Exit(lockObject);
}
}
59 changes: 31 additions & 28 deletions NebulaAPI/DataStructures/DataStructureExtenstions.cs
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
using UnityEngine;
#region

namespace NebulaAPI
using UnityEngine;

#endregion

namespace NebulaAPI;

public static class DataStructureExtenstions
{
public static class DataStructureExtenstions
public static Vector3 ToVector3(this Float3 value)
{
return new Vector3(value.x, value.y, value.z);
}

public static VectorLF3 ToVectorLF3(this Double3 value)
{
return new VectorLF3(value.x, value.y, value.z);
}

public static Float3 ToFloat3(this Vector3 value)
{
return new Float3(value.x, value.y, value.z);
}

public static Quaternion ToQuaternion(this Float4 value)
{
return new Quaternion(value.x, value.y, value.z, value.w);
}

public static Float4 ToFloat4(this Quaternion value)
{
public static Vector3 ToVector3(this Float3 value)
{
return new Vector3(value.x, value.y, value.z);
}

public static VectorLF3 ToVectorLF3(this Double3 value)
{
return new VectorLF3(value.x, value.y, value.z);
}

public static Float3 ToFloat3(this Vector3 value)
{
return new Float3(value.x, value.y, value.z);
}

public static Quaternion ToQuaternion(this Float4 value)
{
return new Quaternion(value.x, value.y, value.z, value.w);
}

public static Float4 ToFloat4(this Quaternion value)
{
return new Float4(value.x, value.y, value.z, value.w);
}
return new Float4(value.x, value.y, value.z, value.w);
}
}
}
58 changes: 28 additions & 30 deletions NebulaAPI/DataStructures/Double3.cs
Original file line number Diff line number Diff line change
@@ -1,38 +1,36 @@

namespace NebulaAPI
namespace NebulaAPI;

[RegisterNestedType]
public struct Double3 : INetSerializable
{
[RegisterNestedType]
public struct Double3 : INetSerializable
{
public double x;
public double y;
public double z;
public double x;
public double y;
public double z;

public Double3(double x, double y, double z)
{
this.x = x;
this.y = y;
this.z = z;
}
public Double3(double x, double y, double z)
{
this.x = x;
this.y = y;
this.z = z;
}

public void Serialize(INetDataWriter writer)
{
writer.Put(x);
writer.Put(y);
writer.Put(z);
}
public void Serialize(INetDataWriter writer)
{
writer.Put(x);
writer.Put(y);
writer.Put(z);
}

public void Deserialize(INetDataReader reader)
{
x = reader.GetDouble();
y = reader.GetDouble();
z = reader.GetDouble();
}
public void Deserialize(INetDataReader reader)
{
x = reader.GetDouble();
y = reader.GetDouble();
z = reader.GetDouble();
}


public override string ToString()
{
return $"x: {x}, y: {y}, z: {z}";
}
public override string ToString()
{
return $"x: {x}, y: {y}, z: {z}";
}
}
Loading

0 comments on commit 888e229

Please sign in to comment.