mirror of
https://github.com/modernuo/ModernUO
synced 2026-08-11 22:23:06 -04:00
### Summary * Fixes spawner timer deserialization * Adds a check for a null timer and allows the timer to get recreated * Adds PotionKeg reverse lookup * Heavily optimizes decimal serialize/deserialize
21 lines
377 B
C#
21 lines
377 B
C#
using System;
|
|
using Xunit;
|
|
|
|
namespace Server.Tests;
|
|
|
|
public class EnumConversionTests
|
|
{
|
|
[Fact]
|
|
public void TestToEnum()
|
|
{
|
|
var e = ReadEnum<TileFlag>();
|
|
|
|
Assert.Equal(TileFlag.Container, e);
|
|
}
|
|
|
|
private static unsafe T ReadEnum<T>() where T : unmanaged, Enum
|
|
{
|
|
var num = (long)TileFlag.Container;
|
|
return *(T*)#
|
|
}
|
|
}
|