ds5678 4c6c28e88b Refactoring
* Use preview language version
* Apply various code fixers
* Remove TypeTreeHelper
* Remove unused properties from IExportContainer
2025-04-29 11:31:02 -07:00

48 lines
739 B
C#

namespace AssetRipper.IO.Files.Streams.Smart
{
public partial class SmartStream
{
private class SmartRefCount
{
public static SmartRefCount operator ++(SmartRefCount _this)
{
_this.RefCount++;
return _this;
}
public static SmartRefCount operator --(SmartRefCount _this)
{
_this.RefCount--;
return _this;
}
public void Increase()
{
RefCount++;
}
public void Decrease()
{
RefCount--;
}
public override string ToString()
{
return RefCount.ToString();
}
public bool IsZero => RefCount == 0;
public int RefCount
{
get;
private set
{
ArgumentOutOfRangeException.ThrowIfNegative(value);
field = value;
}
} = 0;
}
}
}