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

@ -1,6 +1,6 @@
/*************************************************************************
* ModernUO *
* Copyright (C) 2019 - ModernUO Development Team *
* Copyright (C) 2019-2020 - ModernUO Development Team *
* Email: hi@modernuo.com *
* File: BinaryFileReader.cs *
* Created: 2019/12/30 - Updated: 2020/01/18 *
@ -46,8 +46,8 @@ namespace Server
public DateTime ReadDeltaTime()
{
long ticks = m_File.ReadInt64();
long now = DateTime.UtcNow.Ticks;
var ticks = m_File.ReadInt64();
var now = DateTime.UtcNow.Ticks;
if (ticks > 0 && ticks + now < 0)
return DateTime.MaxValue;
@ -85,8 +85,8 @@ namespace Server
public DateTimeOffset ReadDateTimeOffset()
{
long ticks = m_File.ReadInt64();
TimeSpan offset = new TimeSpan(m_File.ReadInt64());
var ticks = m_File.ReadInt64();
var offset = new TimeSpan(m_File.ReadInt64());
return new DateTimeOffset(ticks, offset);
}
@ -151,13 +151,13 @@ namespace Server
public List<T> ReadStrongItemList<T>() where T : Item
{
int count = ReadInt();
var count = ReadInt();
if (count > 0)
{
List<T> list = new List<T>(count);
var list = new List<T>(count);
for (int i = 0; i < count; ++i)
for (var i = 0; i < count; ++i)
if (ReadItem() is T item)
list.Add(item);
@ -171,13 +171,13 @@ namespace Server
public HashSet<T> ReadItemSet<T>() where T : Item
{
int count = ReadInt();
var count = ReadInt();
if (count > 0)
{
HashSet<T> set = new HashSet<T>();
var set = new HashSet<T>();
for (int i = 0; i < count; ++i)
for (var i = 0; i < count; ++i)
if (ReadItem() is T item)
set.Add(item);
@ -191,13 +191,13 @@ namespace Server
public List<T> ReadStrongMobileList<T>() where T : Mobile
{
int count = ReadInt();
var count = ReadInt();
if (count > 0)
{
List<T> list = new List<T>(count);
var list = new List<T>(count);
for (int i = 0; i < count; ++i)
for (var i = 0; i < count; ++i)
if (ReadMobile() is T m)
list.Add(m);
@ -211,13 +211,13 @@ namespace Server
public HashSet<T> ReadMobileSet<T>() where T : Mobile
{
int count = ReadInt();
var count = ReadInt();
if (count > 0)
{
HashSet<T> set = new HashSet<T>();
var set = new HashSet<T>();
for (int i = 0; i < count; ++i)
for (var i = 0; i < count; ++i)
if (ReadMobile() is T item)
set.Add(item);
@ -231,13 +231,13 @@ namespace Server
public List<T> ReadStrongGuildList<T>() where T : BaseGuild
{
int count = ReadInt();
var count = ReadInt();
if (count > 0)
{
List<T> list = new List<T>(count);
var list = new List<T>(count);
for (int i = 0; i < count; ++i)
for (var i = 0; i < count; ++i)
if (ReadGuild() is T g)
list.Add(g);
@ -251,13 +251,13 @@ namespace Server
public HashSet<T> ReadGuildSet<T>() where T : BaseGuild
{
int count = ReadInt();
var count = ReadInt();
if (count > 0)
{
HashSet<T> set = new HashSet<T>();
var set = new HashSet<T>();
for (int i = 0; i < count; ++i)
for (var i = 0; i < count; ++i)
if (ReadGuild() is T item)
set.Add(item);
@ -271,5 +271,4 @@ namespace Server
public bool End() => m_File.PeekChar() == -1;
}
}