40 FxCop Warnings; good practice

This commit is contained in:
asayre 2010-12-23 09:18:45 +00:00
parent 3f535ea235
commit 34e3a88bfe
30 changed files with 45 additions and 49 deletions

View file

@ -1104,7 +1104,7 @@ namespace Server.Items
// Evasion grants a variable bonus post ML. 50% prior. // Evasion grants a variable bonus post ML. 50% prior.
if ( Evasion.IsEvading( defender ) ) if ( Evasion.IsEvading( defender ) )
chance *= Evasion.GetParryScalar( defender ); chance *= Evasion.GetParryScalar( defender );
// Low dexterity lowers the chance. // Low dexterity lowers the chance.
if ( defender.Dex < 80 ) if ( defender.Dex < 80 )
@ -1133,9 +1133,9 @@ namespace Server.Items
chance += 0.05; chance += 0.05;
} }
// Evasion grants a variable bonus post ML. 50% prior. // Evasion grants a variable bonus post ML. 50% prior.
if( Evasion.IsEvading( defender ) ) if( Evasion.IsEvading( defender ) )
chance *= Evasion.GetParryScalar( defender ); chance *= Evasion.GetParryScalar( defender );
// Low dexterity lowers the chance. // Low dexterity lowers the chance.
if( defender.Dex < 80 ) if( defender.Dex < 80 )

View file

@ -20,6 +20,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// //
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
@ -76,3 +77,5 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyDelaySign(false)] [assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")] [assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")] [assembly: AssemblyKeyName("")]
[assembly: ComVisible(false)]

View file

@ -183,7 +183,7 @@ namespace Server.Commands
} }
} }
public class CommandSystem public static class CommandSystem
{ {
private static string m_Prefix = "["; private static string m_Prefix = "[";

View file

@ -77,7 +77,7 @@ namespace Server.Diagnostics {
} }
} }
public BaseProfile( string name ) { protected BaseProfile( string name ) {
_name = name; _name = name;
_stopwatch = new Stopwatch(); _stopwatch = new Stopwatch();

View file

@ -39,7 +39,7 @@ namespace Server.Diagnostics {
} }
} }
public BasePacketProfile( string name ) protected BasePacketProfile(string name)
: base( name ) { : base( name ) {
} }

View file

@ -42,7 +42,7 @@ namespace Server
None None
} }
public class Effects public static class Effects
{ {
private static ParticleSupportType m_ParticleSupportType = ParticleSupportType.Detect; private static ParticleSupportType m_ParticleSupportType = ParticleSupportType.Detect;

View file

@ -24,7 +24,7 @@ using DiagELog = System.Diagnostics.EventLog;
namespace Server namespace Server
{ {
public class EventLog public static class EventLog
{ {
static EventLog() static EventLog()
{ {

View file

@ -789,7 +789,7 @@ namespace Server
public bool Blocked{ get{ return m_Blocked; } set{ m_Blocked = value; } } public bool Blocked{ get{ return m_Blocked; } set{ m_Blocked = value; } }
} }
public class EventSink public static class EventSink
{ {
public static event CharacterCreatedEventHandler CharacterCreated; public static event CharacterCreatedEventHandler CharacterCreated;
public static event OpenDoorMacroEventHandler OpenDoorMacroUsed; public static event OpenDoorMacroEventHandler OpenDoorMacroUsed;

View file

@ -36,7 +36,7 @@ namespace Server.Guilds
{ {
private int m_Id; private int m_Id;
public BaseGuild( int Id )//serialization ctor protected BaseGuild( int Id )//serialization ctor
{ {
m_Id = Id; m_Id = Id;
m_GuildList.Add( m_Id, this ); m_GuildList.Add( m_Id, this );
@ -44,7 +44,7 @@ namespace Server.Guilds
m_NextID = m_Id + 1; m_NextID = m_Id + 1;
} }
public BaseGuild() protected BaseGuild()
{ {
m_Id = m_NextID++; m_Id = m_NextID++;
m_GuildList.Add( m_Id, this ); m_GuildList.Add( m_Id, this );

View file

@ -27,7 +27,7 @@ namespace Server.Gumps
{ {
private Gump m_Parent; private Gump m_Parent;
public GumpEntry() protected GumpEntry()
{ {
} }

View file

@ -544,6 +544,7 @@ namespace Server
Weight, Weight,
} }
[Flags]
public enum ExpandFlag public enum ExpandFlag
{ {
None = 0x00, None = 0x00,

View file

@ -23,7 +23,7 @@ using System.IO;
namespace Server namespace Server
{ {
public class ItemBounds public static class ItemBounds
{ {
private static Rectangle2D[] m_Bounds; private static Rectangle2D[] m_Bounds;

View file

@ -35,18 +35,18 @@ namespace Server
[CommandProperty( AccessLevel.GameMaster )] [CommandProperty( AccessLevel.GameMaster )]
public int Hue { get { return m_Hue; } set { m_Hue = value; } } public int Hue { get { return m_Hue; } set { m_Hue = value; } }
public BaseHairInfo( int itemid ) protected BaseHairInfo( int itemid )
: this( itemid, 0 ) : this( itemid, 0 )
{ {
} }
public BaseHairInfo( int itemid, int hue ) protected BaseHairInfo( int itemid, int hue )
{ {
m_ItemID = itemid; m_ItemID = itemid;
m_Hue = hue; m_Hue = hue;
} }
public BaseHairInfo( GenericReader reader ) protected BaseHairInfo( GenericReader reader )
{ {
int version = reader.ReadInt(); int version = reader.ReadInt();

View file

@ -125,7 +125,7 @@ namespace Server
return m_Maps[index]; return m_Maps[index];
} }
throw new Exception( "Invalid map name" ); throw new ArgumentException( "Invalid map name" );
} }
private static void CheckNamesAndValues() private static void CheckNamesAndValues()

View file

@ -108,7 +108,7 @@ namespace Server
private double m_Value; private double m_Value;
private bool m_ObeyCap; private bool m_ObeyCap;
public SkillMod( SkillName skill, bool relative, double value ) protected SkillMod( SkillName skill, bool relative, double value )
{ {
m_Skill = skill; m_Skill = skill;
m_Relative = relative; m_Relative = relative;

View file

@ -23,7 +23,7 @@ using System.Collections;
namespace Server.Movement namespace Server.Movement
{ {
public class Movement public static class Movement
{ {
private static IMovementImpl m_Impl; private static IMovementImpl m_Impl;

View file

@ -24,7 +24,7 @@ using System.IO;
namespace Server namespace Server
{ {
public class MultiData public static class MultiData
{ {
private static MultiComponentList[] m_Components; private static MultiComponentList[] m_Components;

View file

@ -22,7 +22,7 @@ using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Server { namespace Server {
public class NativeReader { public static class NativeReader {
private static readonly INativeReader m_NativeReader; private static readonly INativeReader m_NativeReader;

View file

@ -26,7 +26,7 @@ namespace Server.Network {
/// <summary> /// <summary>
/// Handles outgoing packet compression for the network. /// Handles outgoing packet compression for the network.
/// </summary> /// </summary>
public class Compression { public static class Compression {
private static int[] _huffmanTable = new int[514] private static int[] _huffmanTable = new int[514]
{ {
0x2, 0x000, 0x5, 0x01F, 0x6, 0x022, 0x7, 0x034, 0x7, 0x075, 0x6, 0x028, 0x6, 0x03B, 0x7, 0x032, 0x2, 0x000, 0x5, 0x01F, 0x6, 0x022, 0x7, 0x034, 0x7, 0x075, 0x6, 0x028, 0x6, 0x03B, 0x7, 0x032,

View file

@ -57,7 +57,7 @@ namespace Server.Network
Encoded = 0xC0 Encoded = 0xC0
} }
public class PacketHandlers public static class PacketHandlers
{ {
private static PacketHandler[] m_Handlers; private static PacketHandler[] m_Handlers;
private static PacketHandler[] m_6017Handlers; private static PacketHandler[] m_6017Handlers;

View file

@ -2715,7 +2715,7 @@ namespace Server.Network
} }
} }
public class AttributeNormalizer public static class AttributeNormalizer
{ {
private static int m_Maximum = 25; private static int m_Maximum = 25;
private static bool m_Enabled = true; private static bool m_Enabled = true;
@ -3997,7 +3997,7 @@ namespace Server.Network
get{ return m_PacketID; } get{ return m_PacketID; }
} }
public Packet( int packetID ) protected Packet( int packetID )
{ {
m_PacketID = packetID; m_PacketID = packetID;
@ -4015,7 +4015,7 @@ namespace Server.Network
m_Stream.Write( (short) 0 ); m_Stream.Write( (short) 0 );
} }
public Packet( int packetID, int length ) protected Packet( int packetID, int length )
{ {
m_PacketID = packetID; m_PacketID = packetID;
m_Length = length; m_Length = length;

View file

@ -28,7 +28,7 @@ namespace Server
{ {
public delegate int NotorietyHandler( Mobile source, Mobile target ); public delegate int NotorietyHandler( Mobile source, Mobile target );
public class Notoriety public static class Notoriety
{ {
public const int Innocent = 1; public const int Innocent = 1;
public const int Ally = 2; public const int Ally = 2;

View file

@ -108,7 +108,6 @@ namespace Server {
protected void SaveItems(SaveMetrics metrics) protected void SaveItems(SaveMetrics metrics)
{ {
Dictionary<Serial, Item> items = World.Items; Dictionary<Serial, Item> items = World.Items;
List<Item> decaying = new List<Item>();
GenericWriter idx; GenericWriter idx;
GenericWriter tdb; GenericWriter tdb;

View file

@ -36,7 +36,7 @@ namespace Server.Prompts
} }
} }
public Prompt() protected Prompt()
{ {
do do
{ {

View file

@ -77,7 +77,7 @@ namespace Server
return m_Races[index]; return m_Races[index];
} }
throw new Exception( "Invalid race name" ); throw new ArgumentException( "Invalid race name" );
} }
private static void CheckNamesAndValues() private static void CheckNamesAndValues()
@ -114,7 +114,7 @@ namespace Server
public int FemaleBody { get { return m_FemaleBody; } } public int FemaleBody { get { return m_FemaleBody; } }
public int FemaleGhostBody { get { return m_FemaleGhostBody; } } public int FemaleGhostBody { get { return m_FemaleGhostBody; } }
public Race( int raceID, int raceIndex, string name, string pluralName, int maleBody, int femaleBody, int maleGhostBody, int femaleGhostBody, Expansion requiredExpansion ) protected Race( int raceID, int raceIndex, string name, string pluralName, int maleBody, int femaleBody, int maleGhostBody, int femaleGhostBody, Expansion requiredExpansion )
{ {
m_RaceID = raceID; m_RaceID = raceID;
m_RaceIndex = raceIndex; m_RaceIndex = raceIndex;

View file

@ -32,7 +32,7 @@ using Microsoft.VisualBasic;
namespace Server namespace Server
{ {
public class ScriptCompiler public static class ScriptCompiler
{ {
private static Assembly[] m_Assemblies; private static Assembly[] m_Assemblies;
@ -522,15 +522,6 @@ namespace Server
private delegate CompilerResults Compiler( bool debug ); private delegate CompilerResults Compiler( bool debug );
private void LoadScriptedAssembly( List<Assembly> assemblies, string fileName, Compiler compiler, bool debug )
{
if( File.Exists( fileName ) )
{
}
}
public static bool Compile() public static bool Compile()
{ {
return Compile( false ); return Compile( false );

View file

@ -34,7 +34,7 @@ namespace Server
{ {
public abstract class GenericReader public abstract class GenericReader
{ {
public GenericReader() { } protected GenericReader() { }
public abstract string ReadString(); public abstract string ReadString();
public abstract DateTime ReadDateTime(); public abstract DateTime ReadDateTime();
@ -90,7 +90,7 @@ namespace Server
public abstract class GenericWriter public abstract class GenericWriter
{ {
public GenericWriter() { } protected GenericWriter() { }
public abstract void Close(); public abstract void Close();

View file

@ -53,11 +53,13 @@ namespace Server.Targeting
} }
} }
public MultiTarget( int multiID, Point3D offset ) : this( multiID, offset, 10, true, TargetFlags.None ) protected MultiTarget( int multiID, Point3D offset )
: this( multiID, offset, 10, true, TargetFlags.None )
{ {
} }
public MultiTarget( int multiID, Point3D offset, int range, bool allowGround, TargetFlags flags ) : base( range, allowGround, flags ) protected MultiTarget( int multiID, Point3D offset, int range, bool allowGround, TargetFlags flags )
: base( range, allowGround, flags )
{ {
m_MultiID = multiID; m_MultiID = multiID;
m_Offset = offset; m_Offset = offset;

View file

@ -38,7 +38,7 @@ namespace Server.Targeting
public DateTime TimeoutTime{ get{ return m_TimeoutTime; } } public DateTime TimeoutTime{ get{ return m_TimeoutTime; } }
public Target( int range, bool allowGround, TargetFlags flags ) protected Target( int range, bool allowGround, TargetFlags flags )
{ {
m_TargetID = ++m_NextTargetID; m_TargetID = ++m_NextTargetID;
m_Range = range; m_Range = range;

View file

@ -197,7 +197,7 @@ namespace Server
StairRight = 0x80000000 StairRight = 0x80000000
} }
public class TileData public static class TileData
{ {
private static LandData[] m_LandData; private static LandData[] m_LandData;
private static ItemData[] m_ItemData; private static ItemData[] m_ItemData;