Show More
Commit Description:
Tweak calculations....
Commit Description:
Tweak calculations. Prevent a negative number of visitors and separate visitors from donors.
File last commit:
Show/Diff file:
Action:
FNA/src/Content/ContentReaders/NullableReader.cs
55 lines | 1.0 KiB | text/x-csharp | CSharpLexer
Early working version (including all dependencies, lol).
r0 #region License
/* FNA - XNA4 Reimplementation for Desktop Platforms
Upgrade FNA to 22.12...
r690 * Copyright 2009-2022 Ethan Lee and the MonoGame Team
Early working version (including all dependencies, lol).
r0 *
* Released under the Microsoft Public License.
* See LICENSE for details.
*/
#endregion
#region Using Statements
using System;
#endregion
namespace Microsoft.Xna.Framework.Content
{
internal class NullableReader<T> : ContentTypeReader<T?> where T : struct
{
#region Private ContentTypeReader Instance
ContentTypeReader elementReader;
#endregion
#region Internal Constructor
internal NullableReader()
{
}
#endregion
#region Protected Initialization Method
protected internal override void Initialize(ContentTypeReaderManager manager)
{
Type readerType = typeof(T);
elementReader = manager.GetTypeReader(readerType);
}
#endregion
#region Protected Read Method
protected internal override T? Read(ContentReader input, T? existingInstance)
{
if (input.ReadBoolean())
{
return input.ReadObject<T>(elementReader);
}
return null;
}
#endregion
}
}