Removes implicit this.

This commit is contained in:
Kamron Batman 2018-09-14 12:56:58 -07:00
parent 04b4cfe75b
commit 83dcf536d8
533 changed files with 2804 additions and 2806 deletions

View file

@ -25,7 +25,7 @@ namespace Server.Regions
public static void Configure()
{
Region.DefaultRegionType = typeof( BaseRegion );
DefaultRegionType = typeof( BaseRegion );
}
private string m_RuneName;
@ -70,7 +70,7 @@ namespace Server.Regions
{
base.OnUnregister();
this.Spawns = null;
Spawns = null;
}
public static string GetRuneNameFor( Region region )
@ -106,9 +106,7 @@ namespace Server.Regions
if ( !region.AllowSpawn() )
return false;
BaseRegion br = region as BaseRegion;
if ( br != null )
if ( region is BaseRegion br )
{
if ( br.Spawns != null )
{
@ -133,11 +131,11 @@ namespace Server.Regions
public override void OnEnter(Mobile m)
{
if (m is PlayerMobile && ((PlayerMobile)m).Young)
if (m is PlayerMobile mobile && mobile.Young)
{
if (!this.YoungProtected)
if (!YoungProtected)
{
m.SendGump(new YoungDungeonWarning());
mobile.SendGump(new YoungDungeonWarning());
}
}
}
@ -163,9 +161,9 @@ namespace Server.Regions
return;
// Test if area rectangles are overlapping, and in that case break them into smaller non overlapping rectangles
for ( int i = 0; i < this.Area.Length; i++ )
for ( int i = 0; i < Area.Length; i++ )
{
m_RectBuffer2.Add( this.Area[i] );
m_RectBuffer2.Add( Area[i] );
for ( int j = 0; j < m_RectBuffer1.Count && m_RectBuffer2.Count > 0; j++ )
{
@ -231,7 +229,7 @@ namespace Server.Regions
public Point3D RandomSpawnLocation( int spawnHeight, bool land, bool water, Point3D home, int range )
{
Map map = this.Map;
Map map = Map;
if ( map == Map.Internal )
return Point3D.Zero;
@ -277,9 +275,9 @@ namespace Server.Regions
y = Utility.RandomMinMax( home.Y - range, home.Y + range );
minZ = int.MaxValue; maxZ = int.MinValue;
for ( int j = 0; j < this.Area.Length; j++ )
for ( int j = 0; j < Area.Length; j++ )
{
Rectangle3D rect = this.Area[j];
Rectangle3D rect = Area[j];
if ( x >= rect.Start.X && x < rect.End.X && y >= rect.Start.Y && y < rect.End.Y )
{
@ -407,7 +405,7 @@ namespace Server.Regions
m_SpawnBuffer1.Clear();
if ( !Region.Find( new Point3D( x, y, z ), map ).AcceptsSpawnsFrom( this ) )
if ( !Find( new Point3D( x, y, z ), map ).AcceptsSpawnsFrom( this ) )
{
m_SpawnBuffer2.Clear();
continue;
@ -472,12 +470,12 @@ namespace Server.Regions
public override string ToString()
{
if ( this.Name != null )
return this.Name;
else if ( this.RuneName != null )
return this.RuneName;
if ( Name != null )
return Name;
else if ( RuneName != null )
return RuneName;
else
return this.GetType().Name;
return GetType().Name;
}
public BaseRegion( string name, Map map, int priority, params Rectangle2D[] area ) : base( name, map, priority, area )

View file

@ -39,7 +39,7 @@ namespace Server.Regions
public override bool CanUseStuckMenu( Mobile m )
{
if ( this.Map == Map.Felucca )
if ( Map == Map.Felucca )
return false;
return base.CanUseStuckMenu( m );

View file

@ -115,7 +115,7 @@ namespace Server.Regions
{
get
{
if ( this.Map == Map.Ilshenar || this.Map == Map.Malas )
if ( Map == Map.Ilshenar || Map == Map.Malas )
return typeof( ArcherGuard );
else
return typeof( WarriorGuard );
@ -152,7 +152,7 @@ namespace Server.Regions
bool disabled = false;
if ( ReadBoolean( el, "disabled", ref disabled, false ) )
this.Disabled = disabled;
Disabled = disabled;
}
public override bool OnBeginSpellCast( Mobile m, ISpell s )

View file

@ -8,7 +8,7 @@ namespace Server.Regions
{
public class HouseRegion : BaseRegion
{
public static readonly int HousePriority = Region.DefaultPriority + 1;
public static readonly int HousePriority = DefaultPriority + 1;
private BaseHouse m_House;
@ -31,7 +31,7 @@ namespace Server.Regions
Point3D ban = house.RelativeBanLocation;
this.GoLocation = new Point3D( house.X + ban.X, house.Y + ban.Y, house.Z + ban.Z );
GoLocation = new Point3D( house.X + ban.X, house.Y + ban.Y, house.Z + ban.Z );
}
public override bool AllowHousing( Mobile from, Point3D p )
@ -51,7 +51,7 @@ namespace Server.Regions
for ( int i = 0; i < area.Length; i++ )
{
Rectangle2D rect = houseArea[i];
area[i] = Region.ConvertTo3D( new Rectangle2D( x + rect.Start.X, y + rect.Start.Y, rect.Width, rect.Height ) );
area[i] = ConvertTo3D( new Rectangle2D( x + rect.Start.X, y + rect.Start.Y, rect.Width, rect.Height ) );
}
return area;

View file

@ -114,7 +114,7 @@ namespace Server.Regions
Region region = entry.Region;
Map map = region.Map;
Point3D loc = entry.RandomSpawnLocation( this.Height, this.Land, this.Water );
Point3D loc = entry.RandomSpawnLocation( Height, Land, Water );
if ( loc == Point3D.Zero )
return null;

View file

@ -57,7 +57,7 @@ namespace Server.Regions
public bool Running => m_Running;
public bool Complete => m_SpawnedObjects.Count >= m_Max;
public bool Spawning => m_Running && !this.Complete;
public bool Spawning => m_Running && !Complete;
public SpawnEntry( int id, BaseRegion region, Point3D home, int range, Direction direction, SpawnDefinition definition, int max, TimeSpan minSpawnTime, TimeSpan maxSpawnTime )
{
@ -117,7 +117,7 @@ namespace Server.Regions
spawn.Spawner = this;
if ( spawn is BaseCreature )
((BaseCreature)spawn).RemoveIfUntamed = this.RemoveIfUntamed;
((BaseCreature)spawn).RemoveIfUntamed = RemoveIfUntamed;
}
void ISpawner.Remove( ISpawnable spawn )
@ -138,7 +138,7 @@ namespace Server.Regions
private void CheckTimer()
{
if ( this.Spawning )
if ( Spawning )
{
if ( m_SpawnTimer == null )
{
@ -192,7 +192,7 @@ namespace Server.Regions
{
InternalDeleteSpawnedObjects();
for ( int i = 0; !this.Complete && i < m_Max; i++ )
for ( int i = 0; !Complete && i < m_Max; i++ )
Spawn();
m_Running = true;
@ -259,7 +259,7 @@ namespace Server.Regions
{
m_NextSpawn = reader.ReadDeltaTime();
if ( this.Spawning )
if ( Spawning )
{
if ( m_SpawnTimer != null )
m_SpawnTimer.Stop();