Upgrades code style - First batch (#22)

This commit is contained in:
Kamron Batman 2018-08-14 06:16:50 +08:00 committed by GitHub
parent 8ee42c8ea2
commit 632e8b4757
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1834 changed files with 10245 additions and 10437 deletions

View file

@ -12,7 +12,7 @@ namespace Server.Engines.Harvest
public double ReqSkill { get { return m_ReqSkill; } set { m_ReqSkill = value; } }
public double Chance { get { return m_Chance; } set { m_Chance = value; } }
public TextDefinition SuccessMessage { get { return m_SuccessMessage; } }
public TextDefinition SuccessMessage => m_SuccessMessage;
public void SendSuccessTo( Mobile m )
{
@ -28,4 +28,4 @@ namespace Server.Engines.Harvest
m_SuccessMessage = message;
}
}
}
}

View file

@ -77,15 +77,13 @@ namespace Server.Engines.Harvest
x /= m_BankWidth;
y /= m_BankHeight;
Dictionary<Point2D, HarvestBank> banks = null;
m_BanksByMap.TryGetValue( map, out banks );
m_BanksByMap.TryGetValue( map, out Dictionary<Point2D, HarvestBank> banks );
if ( banks == null )
m_BanksByMap[map] = banks = new Dictionary<Point2D, HarvestBank>();
Point2D key = new Point2D( x, y );
HarvestBank bank = null;
banks.TryGetValue( key, out bank );
banks.TryGetValue( key, out HarvestBank bank );
if ( bank == null )
banks[key] = bank = new HarvestBank( this, GetVeinAt( map, x, y ) );
@ -176,4 +174,4 @@ namespace Server.Engines.Harvest
}
}
}
}
}

View file

@ -11,7 +11,7 @@ namespace Server.Engines.Harvest
{
private List<HarvestDefinition> m_Definitions;
public List<HarvestDefinition> Definitions { get { return m_Definitions; } }
public List<HarvestDefinition> Definitions => m_Definitions;
public HarvestSystem()
{
@ -66,7 +66,7 @@ namespace Server.Engines.Harvest
public virtual object GetLock( Mobile from, Item tool, HarvestDefinition def, object toHarvest )
{
/* Here we prevent multiple harvesting.
*
*
* Some options:
* - 'return tool;' : This will allow the player to harvest more than once concurrently, but only if they use multiple tools. This seems to be as OSI.
* - 'return GetType();' : This will disallow multiple harvesting of the same type. That is, we couldn't mine more than once concurrently, but we could be both mining and lumberjacking.
@ -114,7 +114,7 @@ namespace Server.Engines.Harvest
OnBadHarvestTarget( from, tool, toHarvest );
return;
}
if ( !CheckRange( from, tool, def, map, loc, true ) )
return;
else if ( !CheckResources( from, tool, def, map, loc, true ) )
@ -503,4 +503,4 @@ namespace Server
{
}
}
}
}