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

@ -115,12 +115,12 @@ namespace Server.Mobiles
}
[CommandProperty(AccessLevel.GameMaster)]
public DateTime SculptedOn{ get; set; }
public DateTime SculptedOn { get; set; }
public CharacterStatuePlinth Plinth{ get; set; }
public CharacterStatuePlinth Plinth { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public bool IsRewardItem{ get; set; }
public bool IsRewardItem { get; set; }
public override void OnDoubleClick(Mobile from)
{
@ -385,7 +385,7 @@ namespace Server.Mobiles
private class DemolishEntry : ContextMenuEntry
{
private CharacterStatue m_Statue;
private readonly CharacterStatue m_Statue;
public DemolishEntry(CharacterStatue statue) : base(6275, 2) => m_Statue = statue;
@ -442,7 +442,7 @@ namespace Server.Mobiles
}
[CommandProperty(AccessLevel.GameMaster)]
public CharacterStatue Statue{ get; set; }
public CharacterStatue Statue { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public StatueType StatueType
@ -547,8 +547,8 @@ namespace Server.Mobiles
public class CharacterStatueTarget : Target
{
private Item m_Maker;
private StatueType m_Type;
private readonly Item m_Maker;
private readonly StatueType m_Type;
public CharacterStatueTarget(Item maker, StatueType type) : base(-1, true, TargetFlags.None)
{
@ -651,7 +651,7 @@ namespace Server.Mobiles
int doorHeight = door.ItemData.CalcHeight;
if (Utility.InRange(doorLoc, p, 1) &&
(p.Z == doorLoc.Z || p.Z + height > doorLoc.Z && doorLoc.Z + doorHeight > p.Z))
(p.Z == doorLoc.Z || (p.Z + height > doorLoc.Z && doorLoc.Z + doorHeight > p.Z)))
return AddonFitResult.DoorTooClose;
}

View file

@ -5,9 +5,9 @@ namespace Server.Gumps
{
public class CharacterStatueGump : Gump
{
private Item m_Maker;
private Mobile m_Owner;
private CharacterStatue m_Statue;
private readonly Item m_Maker;
private readonly Mobile m_Owner;
private readonly CharacterStatue m_Statue;
public CharacterStatueGump(Item maker, CharacterStatue statue, Mobile owner) : base(60, 36)
{

View file

@ -4,17 +4,17 @@ namespace Server.Network
{
public UpdateStatueAnimation(Mobile m, int status, int animation, int frame) : base(0xBF, 17)
{
m_Stream.Write((short)0x11);
m_Stream.Write((short)0x19);
m_Stream.Write((byte)0x5);
m_Stream.Write(m.Serial);
m_Stream.Write((byte)0);
m_Stream.Write((byte)0xFF);
m_Stream.Write((byte)status);
m_Stream.Write((byte)0);
m_Stream.Write((byte)animation);
m_Stream.Write((byte)0);
m_Stream.Write((byte)frame);
Stream.Write((short)0x11);
Stream.Write((short)0x19);
Stream.Write((byte)0x5);
Stream.Write(m.Serial);
Stream.Write((byte)0);
Stream.Write((byte)0xFF);
Stream.Write((byte)status);
Stream.Write((byte)0);
Stream.Write((byte)animation);
Stream.Write((byte)0);
Stream.Write((byte)frame);
}
}
}

View file

@ -16,10 +16,10 @@ namespace Server.Engines.VeteranRewards
Entries = new List<RewardEntry>();
}
public int Name{ get; }
public int Name { get; }
public string NameString{ get; }
public string NameString { get; }
public List<RewardEntry> Entries{ get; }
public List<RewardEntry> Entries { get; }
}
}

View file

@ -7,7 +7,7 @@ namespace Server.Engines.VeteranRewards
{
public class RewardChoiceGump : Gump
{
private Mobile m_From;
private readonly Mobile m_From;
public RewardChoiceGump(Mobile from) : base(0, 0)
{

View file

@ -6,8 +6,8 @@ namespace Server.Engines.VeteranRewards
{
public class RewardConfirmGump : Gump
{
private RewardEntry m_Entry;
private Mobile m_From;
private readonly RewardEntry m_Entry;
private readonly Mobile m_From;
public RewardConfirmGump(Mobile from, RewardEntry entry) : base(0, 0)
{

View file

@ -6,7 +6,7 @@ namespace Server.Gumps
{
public class RewardDemolitionGump : Gump
{
private IAddon m_Addon;
private readonly IAddon m_Addon;
public RewardDemolitionGump(IAddon addon, int question) : base(150, 50)
{

View file

@ -1,5 +1,5 @@
using Server.Utilities;
using System;
using Server.Utilities;
namespace Server.Engines.VeteranRewards
{
@ -47,19 +47,19 @@ namespace Server.Engines.VeteranRewards
category.Entries.Add(this);
}
public RewardList List{ get; set; }
public RewardList List { get; set; }
public RewardCategory Category{ get; }
public RewardCategory Category { get; }
public Type ItemType{ get; }
public Type ItemType { get; }
public Expansion RequiredExpansion{ get; }
public Expansion RequiredExpansion { get; }
public int Name{ get; }
public int Name { get; }
public string NameString{ get; }
public string NameString { get; }
public object[] Args{ get; }
public object[] Args { get; }
public Item Construct()
{

View file

@ -13,8 +13,8 @@ namespace Server.Engines.VeteranRewards
entries[i].List = this;
}
public TimeSpan Age{ get; }
public TimeSpan Age { get; }
public RewardEntry[] Entries{ get; }
public RewardEntry[] Entries { get; }
}
}

View file

@ -5,7 +5,7 @@ namespace Server.Engines.VeteranRewards
{
public class RewardNoticeGump : Gump
{
private Mobile m_From;
private readonly Mobile m_From;
public RewardNoticeGump(Mobile from) : base(0, 0)
{

View file

@ -11,8 +11,8 @@ namespace Server.Gumps
public class RewardOptionGump : Gump
{
private IRewardOption m_Option;
private RewardOptionList m_Options = new RewardOptionList();
private readonly IRewardOption m_Option;
private readonly RewardOptionList m_Options = new RewardOptionList();
public RewardOptionGump(IRewardOption option, int title = 0) : base(60, 36)
{
@ -72,9 +72,9 @@ namespace Server.Gumps
Cliloc = cliloc;
}
public int ID{ get; }
public int ID { get; }
public int Cliloc{ get; }
public int Cliloc { get; }
}
public class RewardOptionList : List<RewardOption>

View file

@ -46,7 +46,7 @@ namespace Server.Engines.VeteranRewards
List<RewardEntry> entries = category.Entries;
for (int j = 0; j < entries.Count; ++j)
//RewardEntry entry = entries[j];
// RewardEntry entry = entries[j];
if (HasAccess(mob, entries[j]))
return true;
return false;
@ -131,7 +131,7 @@ namespace Server.Engines.VeteranRewards
if (!(mob.Account is Account acct))
return false;
//if ( mob.AccessLevel < AccessLevel.GameMaster )
// if (mob.AccessLevel < AccessLevel.GameMaster)
acct.SetTag("numRewardsChosen", (cur + 1).ToString());
return true;
@ -192,14 +192,13 @@ namespace Server.Engines.VeteranRewards
if (args == null && entries[j].Args.Length == 0)
{
if (isRelaxedRules && i <= 0 || HasAccess(from, list, out TimeSpan ts))
if ((isRelaxedRules && i <= 0) || HasAccess(from, list, out TimeSpan ts))
return true;
from.SendLocalizedMessage(1008126, true,
Math.Ceiling(ts.TotalDays / 30.0)
.ToString()); // Your account is not old enough to use this item. Months until you can use this item :
return false;
}
if (args?.Length != entries[j].Args.Length)
@ -212,7 +211,7 @@ namespace Server.Engines.VeteranRewards
if (match)
{
if (isRelaxedRules && i <= 0 || HasAccess(from, list, out TimeSpan ts))
if ((isRelaxedRules && i <= 0) || HasAccess(from, list, out TimeSpan ts))
return true;
from.SendLocalizedMessage(1008126, true,
@ -501,6 +500,6 @@ namespace Server.Engines.VeteranRewards
public interface IRewardItem
{
bool IsRewardItem{ get; set; }
bool IsRewardItem { get; set; }
}
}