Skip to content

Commit

Permalink
Updated nuget packages and fixed parent refs for U 2020.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Digitalroot committed Nov 23, 2022
1 parent 1a064db commit 2dce6a0
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 21 deletions.
6 changes: 6 additions & 0 deletions src/Digitalroot.Valheim.Common.Extensions.sln
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{F6CF7B11-6
..\docs\README.md = ..\docs\README.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "UnitTests\UnitTests.csproj", "{3DD97198-7414-4B6C-8B10-4520BBFF56C7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -34,6 +36,10 @@ Global
{50EA1929-24FC-4773-B30B-E7D556A09D60}.Debug|Any CPU.Build.0 = Debug|Any CPU
{50EA1929-24FC-4773-B30B-E7D556A09D60}.Release|Any CPU.ActiveCfg = Release|Any CPU
{50EA1929-24FC-4773-B30B-E7D556A09D60}.Release|Any CPU.Build.0 = Release|Any CPU
{3DD97198-7414-4B6C-8B10-4520BBFF56C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3DD97198-7414-4B6C-8B10-4520BBFF56C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3DD97198-7414-4B6C-8B10-4520BBFF56C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3DD97198-7414-4B6C-8B10-4520BBFF56C7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 2 additions & 0 deletions src/Digitalroot.Valheim.Common.Extensions.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=Patroller/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>AGPL-3.0-or-later</PackageLicenseExpression>
<Copyright>Copyright © Digitalroot Technologies 2021 - 2022</Copyright>
<Copyright>Copyright © Digitalroot Technologies 2021 - 2023</Copyright>
<PackageProjectUrl>https://github.com/Digitalroot-Valheim/Digitalroot.Valheim.Common.Extensions</PackageProjectUrl>
<RepositoryUrl>https://github.com/Digitalroot-Valheim/Digitalroot.Valheim.Common.Extensions</RepositoryUrl>
<RepositoryType>git</RepositoryType>
Expand Down Expand Up @@ -44,11 +44,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Digitalroot.Valheim.Common.References" Version="0.212.6" />
<PackageReference Include="UnityEngine.Modules" Version="[2020.3.3]">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>compile</IncludeAssets>
</PackageReference>
<PackageReference Include="Digitalroot.Valheim.Common.References" Version="0.212.7" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public static GameObject AddLedgeJumping(this GameObject prefab)
return prefab;
}

public static bool HasParent(this GameObject prefab) => prefab.transform.GetParent() != null;
public static bool HasParent(this GameObject prefab) => prefab.transform.parent != null;

public static GameObject GetParent(this GameObject prefab) => prefab.HasParent() ? prefab.transform.GetParent().gameObject : null;
public static GameObject GetParent(this GameObject prefab) => prefab.HasParent() ? prefab.transform.parent.gameObject : null;

public static bool IsBoss(this GameObject prefab) => prefab.GetComponent<Character>()?.IsBoss() ?? false;

Expand All @@ -43,12 +43,12 @@ public static string GetUniqueName(this GameObject prefab)
{
List<string> paths = new();

var parent = prefab.transform.GetParent();
var parent = prefab.transform.parent;

while (parent != null)
{
paths.Add(parent.name);
parent = parent.GetParent();
parent = parent.parent;
}

var sb = new StringBuilder();
Expand Down Expand Up @@ -101,7 +101,7 @@ public static GameObject AsSpawnPointPatroler(this GameObject prefab)

if (prefab.HasParent())
{
prefab.AsSpawnPointPatroler(prefab.transform.parent.transform.position);
prefab.AsSpawnPointPatroller(prefab.transform.parent.transform.position);
}
else
{
Expand All @@ -116,7 +116,7 @@ public static GameObject AsSpawnPointPatroler(this GameObject prefab)
/// </summary>
/// <param name="prefab">MonsterAI</param>
/// <returns></returns>
public static GameObject AsSpawnPointPatroler(this GameObject prefab, Vector3 point)
public static GameObject AsSpawnPointPatroller(this GameObject prefab, Vector3 point)
{
var monsterAI = prefab.GetComponent<MonsterAI>();
if (monsterAI == null) return prefab;
Expand Down
12 changes: 3 additions & 9 deletions src/Digitalroot.Valheim.Common.Extensions/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,9 @@
".NETFramework,Version=v4.6.2": {
"Digitalroot.Valheim.Common.References": {
"type": "Direct",
"requested": "[0.212.6, )",
"resolved": "0.212.6",
"contentHash": "itLbv/MacBzj3tSaM6cd2cUUmf/Ue76JjZlnrt/ZiyfyUEBmn+Ivl60i7fJwORrdg1bZVTKphxuxblFfuCxWAg=="
},
"UnityEngine.Modules": {
"type": "Direct",
"requested": "[2020.3.3, 2020.3.3]",
"resolved": "2020.3.3",
"contentHash": "dvoovYl+xSitTB6bmeE8+PfjkxqhxAaV8Ay2Ycss0ps08+yBHy9hso5Po0eh7HT/X/g+7wTUfhmhbcjPLJRewA=="
"requested": "[0.212.7, )",
"resolved": "0.212.7",
"contentHash": "4mpt8e/2YXg5nCZBEwyVp/uLhsj4FqvQgRchly70p13wyONf7KAUSmsP6o9mfMKRRzvymPhvAKTtrIgaOPxBRA=="
}
}
}
Expand Down
18 changes: 18 additions & 0 deletions src/UnitTests/UnitTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using NUnit.Framework;

namespace UnitTests
{
public class Tests
{
[SetUp]
public void Setup()
{
}

[Test]
public void Test1()
{
Assert.Pass();
}
}
}
19 changes: 19 additions & 0 deletions src/UnitTests/UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1" />
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>

0 comments on commit 2dce6a0

Please sign in to comment.