te
This commit is contained in:
parent
01151e679b
commit
57b2f0400e
265 changed files with 22828 additions and 6 deletions
66
Unused/Decal.Adapter.Wrappers/EnchantmentWrapper.cs
Normal file
66
Unused/Decal.Adapter.Wrappers/EnchantmentWrapper.cs
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using Decal.Interop.Filters;
|
||||
|
||||
namespace Decal.Adapter.Wrappers;
|
||||
|
||||
public class EnchantmentWrapper : MarshalByRefObject, IDisposable
|
||||
{
|
||||
private Enchantment myEnchantment;
|
||||
|
||||
private bool isDisposed;
|
||||
|
||||
public double Adjustment => myEnchantment.Adjustment;
|
||||
|
||||
public int Affected => myEnchantment.Affected;
|
||||
|
||||
public int AffectedMask => myEnchantment.AffectedMask;
|
||||
|
||||
public double Duration => myEnchantment.Duration;
|
||||
|
||||
public int Family => myEnchantment.Family;
|
||||
|
||||
public int Layer => myEnchantment.Layer;
|
||||
|
||||
public int SpellId => myEnchantment.SpellID;
|
||||
|
||||
public int TimeRemaining => myEnchantment.TimeRemaining;
|
||||
|
||||
public DateTime Expires => DateTime.Now.AddSeconds(TimeRemaining);
|
||||
|
||||
internal EnchantmentWrapper(Enchantment enchant)
|
||||
{
|
||||
myEnchantment = enchant;
|
||||
}
|
||||
|
||||
~EnchantmentWrapper()
|
||||
{
|
||||
Dispose(disposing: false);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(disposing: true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (!isDisposed)
|
||||
{
|
||||
}
|
||||
if (myEnchantment != null)
|
||||
{
|
||||
Marshal.ReleaseComObject(myEnchantment);
|
||||
}
|
||||
isDisposed = true;
|
||||
}
|
||||
|
||||
protected void EnforceDisposedOnce()
|
||||
{
|
||||
if (isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException("EnchantmentWrapper");
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue