Adds style cop (#109)

This commit is contained in:
Kamron Batman 2020-04-26 00:16:02 -07:00 committed by GitHub
parent 3e715bcb60
commit 556a17aba8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1725 changed files with 33831 additions and 38046 deletions

View file

@ -22,14 +22,14 @@ using System;
namespace Server
{
public struct Serial : IComparable<Serial>, IComparable<uint>
public readonly struct Serial : IComparable<Serial>, IComparable<uint>, IEquatable<Serial>
{
public static readonly Serial MinusOne = new Serial(0xFFFFFFFF);
public static readonly Serial Zero = new Serial(0);
public static Serial LastMobile{ get; private set; } = Zero;
public static Serial LastMobile { get; private set; } = Zero;
public static Serial LastItem{ get; private set; } = 0x40000000;
public static Serial LastItem { get; private set; } = 0x40000000;
public static Serial NewMobile
{
@ -57,7 +57,7 @@ namespace Server
private Serial(uint serial) => Value = serial;
public uint Value{ get; }
public uint Value { get; }
public bool IsMobile => Value > 0 && Value < 0x40000000;
@ -97,5 +97,9 @@ namespace Server
public static implicit operator uint(Serial a) => a.Value;
public static implicit operator Serial(uint a) => new Serial(a);
public bool Equals(Serial other) => Value == other.Value;
public int ToInt32() => (int)Value;
}
}