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

@ -12,7 +12,7 @@ namespace Server.Misc
public class GiftGiving
{
private static List<GiftGiver> m_Givers = new List<GiftGiver>();
private static readonly List<GiftGiver> m_Givers = new List<GiftGiver>();
public static void Register(GiftGiver giver)
{
@ -55,8 +55,8 @@ namespace Server.Misc
{
public virtual TimeSpan MinimumAge => TimeSpan.FromDays(30.0);
public abstract DateTime Start{ get; }
public abstract DateTime Finish{ get; }
public abstract DateTime Start { get; }
public abstract DateTime Finish { get; }
public abstract void GiveGift(Mobile mob);
public virtual void DelayGiveGift(TimeSpan delay, Mobile mob)

View file

@ -73,9 +73,9 @@ namespace Server.Misc
Map = map;
}
public Point3D Location{ get; }
public Point3D Location { get; }
public Map Map{ get; }
public Map Map { get; }
}
}
}

View file

@ -121,7 +121,7 @@ namespace Server.Misc
private static void ChangeSkill(Mobile from, string name, double value)
{
if (!Enum.TryParse(name, true, out SkillName index) || !Core.SE && (int)index > 51 || !Core.AOS && (int)index > 48)
if (!Enum.TryParse(name, true, out SkillName index) || (!Core.SE && (int)index > 51) || (!Core.AOS && (int)index > 48))
{
from.SendLocalizedMessage(1005631); // You have specified an invalid skill to set.
return;
@ -152,7 +152,6 @@ namespace Server.Misc
}
}
public class TCHelpGump : Gump
{
public TCHelpGump() : base(40, 40)
@ -178,52 +177,52 @@ namespace Server.Misc
switch (info.ButtonID)
{
case 1: // RunUO
{
sender.LaunchBrowser("https://github.com/runuo/");
break;
}
case 2: // List of skills
{
string[] strings = Enum.GetNames(typeof(SkillName));
Array.Sort(strings);
StringBuilder sb = new StringBuilder();
if (strings.Length > 0)
sb.Append(strings[0]);
for (int i = 1; i < strings.Length; ++i)
{
string v = strings[i];
if (sb.Length + 1 + v.Length >= 256)
{
sender.Send(new AsciiMessage(Server.Serial.MinusOne, -1, MessageType.Label, 0x35, 3,
"System", sb.ToString()));
sb = new StringBuilder();
sb.Append(v);
}
else
{
sb.Append(' ');
sb.Append(v);
}
sender.LaunchBrowser("https://github.com/runuo/");
break;
}
case 2: // List of skills
{
string[] strings = Enum.GetNames(typeof(SkillName));
if (sb.Length > 0)
sender.Send(new AsciiMessage(Server.Serial.MinusOne, -1, MessageType.Label, 0x35, 3, "System",
sb.ToString()));
Array.Sort(strings);
break;
}
StringBuilder sb = new StringBuilder();
if (strings.Length > 0)
sb.Append(strings[0]);
for (int i = 1; i < strings.Length; ++i)
{
string v = strings[i];
if (sb.Length + 1 + v.Length >= 256)
{
sender.Send(new AsciiMessage(Server.Serial.MinusOne, -1, MessageType.Label, 0x35, 3,
"System", sb.ToString()));
sb = new StringBuilder();
sb.Append(v);
}
else
{
sb.Append(' ');
sb.Append(v);
}
}
if (sb.Length > 0)
sender.Send(new AsciiMessage(Server.Serial.MinusOne, -1, MessageType.Label, 0x35, 3, "System",
sb.ToString()));
break;
}
case 3: // Command list
{
sender.Mobile.SendAsciiMessage(0x482, "The command prefix is \"{0}\"", CommandSystem.Prefix);
CommandHandlers.Help_OnCommand(new CommandEventArgs(sender.Mobile, "help", "", new string[0]));
{
sender.Mobile.SendAsciiMessage(0x482, "The command prefix is \"{0}\"", CommandSystem.Prefix);
CommandHandlers.Help_OnCommand(new CommandEventArgs(sender.Mobile, "help", "", new string[0]));
break;
}
break;
}
}
}
}

View file

@ -1,56 +0,0 @@
#if false
using System;
using Server.Network;
using Server.Commands;
namespace Server.Items
{
public class GMStone : Item
{
public override string DefaultName
{
get { return "a GM stone"; }
}
[Constructible]
public GMStone() : base( 0xED4 )
{
Movable = false;
Hue = 0x489;
}
public GMStone( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
public override void OnDoubleClick( Mobile from )
{
if ( from.AccessLevel < AccessLevel.GameMaster )
{
from.AccessLevel = AccessLevel.GameMaster;
from.SendAsciiMessage( 0x482, "The command prefix is \"{0}\"", CommandSystem.Prefix );
CommandHandlers.Help_OnCommand( new CommandEventArgs( from, "help", "", new string[0] ) );
}
else
{
from.SendMessage( "The stone has no effect." );
}
}
}
}
#endif

View file

@ -115,11 +115,11 @@ namespace Server.Items
switch (version)
{
case 0:
{
m_GamblePot = reader.ReadInt();
{
m_GamblePot = reader.ReadInt();
break;
}
break;
}
}
}
}