Changes properties to use automatic property initializers

This commit is contained in:
Kamron Batman 2018-09-14 15:23:29 -07:00
parent f0a48ad431
commit 06fa31a7bf
623 changed files with 13072 additions and 19304 deletions

View file

@ -20,11 +20,9 @@ namespace Server.Engines.Harvest
}
}
private HarvestDefinition m_OreAndStone, m_Sand;
public HarvestDefinition OreAndStone { get; }
public HarvestDefinition OreAndStone => m_OreAndStone;
public HarvestDefinition Sand => m_Sand;
public HarvestDefinition Sand { get; }
private Mining()
{
@ -32,7 +30,7 @@ namespace Server.Engines.Harvest
HarvestVein[] veins;
#region Mining for ore and stone
HarvestDefinition oreAndStone = m_OreAndStone = new HarvestDefinition();
HarvestDefinition oreAndStone = OreAndStone = new HarvestDefinition();
// Resource banks are every 8x8 tiles
oreAndStone.BankWidth = 8;
@ -124,7 +122,7 @@ namespace Server.Engines.Harvest
#endregion
#region Mining for sand
HarvestDefinition sand = m_Sand = new HarvestDefinition();
HarvestDefinition sand = Sand = new HarvestDefinition();
// Resource banks are every 8x8 tiles
sand.BankWidth = 8;
@ -185,7 +183,7 @@ namespace Server.Engines.Harvest
public override Type GetResourceType( Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource )
{
if ( def == m_OreAndStone )
if ( def == OreAndStone )
{
if ( from is PlayerMobile pm && pm.StoneMining && pm.ToggleMiningStone && from.Skills[SkillName.Mining].Base >= 100.0 && 0.1 > Utility.RandomDouble() )
return resource.Types[1];
@ -229,7 +227,7 @@ namespace Server.Engines.Harvest
if ( !base.CheckHarvest( from, tool, def, toHarvest ) )
return false;
if ( def == m_Sand && !(from is PlayerMobile mobile && mobile.Skills[SkillName.Mining].Base >= 100.0 && mobile.SandMining) )
if ( def == Sand && !(from is PlayerMobile mobile && mobile.Skills[SkillName.Mining].Base >= 100.0 && mobile.SandMining) )
{
OnBadHarvestTarget( from, tool, toHarvest );
return false;
@ -250,7 +248,7 @@ namespace Server.Engines.Harvest
public override HarvestVein MutateVein( Mobile from, Item tool, HarvestDefinition def, HarvestBank bank, object toHarvest, HarvestVein vein )
{
if ( tool is GargoylesPickaxe && def == m_OreAndStone )
if ( tool is GargoylesPickaxe && def == OreAndStone )
{
int veinIndex = Array.IndexOf( def.Veins, vein );
@ -274,7 +272,7 @@ namespace Server.Engines.Harvest
public override void OnHarvestFinished( Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested )
{
if ( tool is GargoylesPickaxe && def == m_OreAndStone && 0.1 > Utility.RandomDouble() )
if ( tool is GargoylesPickaxe && def == OreAndStone && 0.1 > Utility.RandomDouble() )
{
HarvestResource res = vein.PrimaryResource;