mirror of
https://github.com/AssetRipper/AssetRipper.git
synced 2025-12-11 20:15:29 +01:00
* Use preview language version * Apply various code fixers * Remove TypeTreeHelper * Remove unused properties from IExportContainer
48 lines
739 B
C#
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;
|
|
}
|
|
}
|
|
}
|