mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Swapped Common, BSA, and VFS libs to standard
This commit is contained in:
parent
d3b72af7a8
commit
f01f81025f
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
<TargetFramework>netstandard2.1</TargetFramework>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<Platforms>x64</Platforms>
|
<Platforms>x64</Platforms>
|
||||||
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
|
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
|
||||||
|
@ -52,7 +52,7 @@ namespace Wabbajack.Common
|
|||||||
|
|
||||||
public static void ToJson<T>(this T obj, Stream stream)
|
public static void ToJson<T>(this T obj, Stream stream)
|
||||||
{
|
{
|
||||||
using var tw = new StreamWriter(stream, Encoding.UTF8, leaveOpen: true);
|
using var tw = new StreamWriter(stream, Encoding.UTF8, bufferSize: 1024, leaveOpen: true);
|
||||||
using var writer = new JsonTextWriter(tw);
|
using var writer = new JsonTextWriter(tw);
|
||||||
var ser = JsonSerializer.Create(JsonSettings);
|
var ser = JsonSerializer.Create(JsonSettings);
|
||||||
ser.Serialize(writer, obj);
|
ser.Serialize(writer, obj);
|
||||||
@ -81,7 +81,7 @@ namespace Wabbajack.Common
|
|||||||
|
|
||||||
public static T FromJson<T>(this Stream stream, bool genericReader = false)
|
public static T FromJson<T>(this Stream stream, bool genericReader = false)
|
||||||
{
|
{
|
||||||
using var tr = new StreamReader(stream, Encoding.UTF8, leaveOpen: true);
|
using var tr = new StreamReader(stream, Encoding.UTF8, bufferSize: 1024, detectEncodingFromByteOrderMarks: false, leaveOpen: true);
|
||||||
using var reader = new JsonTextReader(tr);
|
using var reader = new JsonTextReader(tr);
|
||||||
var ser = JsonSerializer.Create(genericReader ? GenericJsonSettings : JsonSettings);
|
var ser = JsonSerializer.Create(genericReader ? GenericJsonSettings : JsonSettings);
|
||||||
var result = ser.Deserialize<T>(reader);
|
var result = ser.Deserialize<T>(reader);
|
||||||
|
@ -439,7 +439,8 @@ namespace Wabbajack.Common
|
|||||||
/// <param name="coll"></param>
|
/// <param name="coll"></param>
|
||||||
/// <param name="func"></param>
|
/// <param name="func"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static IEnumerable<TOut> Keep<TIn, TOut>(this IEnumerable<TIn> coll, Func<TIn, TOut> func) where TOut : IComparable<TOut>
|
public static IEnumerable<TOut> Keep<TIn, TOut>(this IEnumerable<TIn> coll, Func<TIn, TOut> func)
|
||||||
|
where TOut : struct, IComparable<TOut>
|
||||||
{
|
{
|
||||||
return coll.Select(func).Where(v => v.CompareTo(default) != 0);
|
return coll.Select(func).Where(v => v.CompareTo(default) != 0);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
<TargetFramework>netstandard2.1</TargetFramework>
|
||||||
<Platforms>x64</Platforms>
|
<Platforms>x64</Platforms>
|
||||||
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
|
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
<TargetFramework>netstandard2.1</TargetFramework>
|
||||||
<Platforms>x64</Platforms>
|
<Platforms>x64</Platforms>
|
||||||
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
|
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user