Weapos Rejiggered
Modified weapon scripts to eliminate specialized projectile behavior - allows charged weapons to have projectiles and modify weapon stats when charged Added machine gun weapon & VFX Moved third party code to Plugins folder to improve compile times
This commit is contained in:
parent
2a0fe34611
commit
dbc522a224
2105 changed files with 7033 additions and 1141 deletions
|
|
@ -1,73 +0,0 @@
|
|||
// Copyright (c) All contributors. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Buffers;
|
||||
|
||||
#pragma warning disable SA1649 // File name should match first type name
|
||||
|
||||
namespace MessagePack.Formatters
|
||||
{
|
||||
public sealed class NullableFormatter<T> : IMessagePackFormatter<T?>
|
||||
where T : struct
|
||||
{
|
||||
public void Serialize(ref MessagePackWriter writer, T? value, MessagePackSerializerOptions options)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
writer.WriteNil();
|
||||
}
|
||||
else
|
||||
{
|
||||
options.Resolver.GetFormatterWithVerify<T>().Serialize(ref writer, value.Value, options);
|
||||
}
|
||||
}
|
||||
|
||||
public T? Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options)
|
||||
{
|
||||
if (reader.IsNil)
|
||||
{
|
||||
reader.ReadNil();
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
return options.Resolver.GetFormatterWithVerify<T>().Deserialize(ref reader, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class StaticNullableFormatter<T> : IMessagePackFormatter<T?>
|
||||
where T : struct
|
||||
{
|
||||
private readonly IMessagePackFormatter<T> underlyingFormatter;
|
||||
|
||||
public StaticNullableFormatter(IMessagePackFormatter<T> underlyingFormatter)
|
||||
{
|
||||
this.underlyingFormatter = underlyingFormatter;
|
||||
}
|
||||
|
||||
public void Serialize(ref MessagePackWriter writer, T? value, MessagePackSerializerOptions options)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
writer.WriteNil();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.underlyingFormatter.Serialize(ref writer, value.Value, options);
|
||||
}
|
||||
}
|
||||
|
||||
public T? Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options)
|
||||
{
|
||||
if (reader.TryReadNil())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
return this.underlyingFormatter.Deserialize(ref reader, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue