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

@ -24,7 +24,7 @@ namespace Server.Factions
public Faction Faction{ get{ return m_Faction; } }
public List<Candidate> Candidates { get { return m_Candidates; } }
public List<Candidate> Candidates => m_Candidates;
public ElectionState State{ get{ return m_State; } set{ m_State = value; m_LastStateTime = DateTime.UtcNow; } }
public DateTime LastStateTime{ get{ return m_LastStateTime; } }
@ -483,7 +483,7 @@ namespace Server.Factions
private List<Voter> m_Voters;
public Mobile Mobile{ get{ return m_Mobile; } }
public List<Voter> Voters { get { return m_Voters; } }
public List<Voter> Voters => m_Voters;
public int Votes{ get{ return m_Voters.Count; } }
@ -561,4 +561,4 @@ namespace Server.Factions
Campaign,
Election
}
}
}

View file

@ -927,9 +927,7 @@ namespace Server.Factions
public static bool ClearSkillLoss( Mobile mob )
{
SkillLossContext context;
if ( !m_SkillLoss.TryGetValue( mob, out context ) )
if (!m_SkillLoss.TryGetValue( mob, out SkillLossContext context ))
return false;
m_SkillLoss.Remove( mob );
@ -1111,7 +1109,7 @@ namespace Server.Factions
{
if ( victimState.KillPoints <= -6 )
{
killer.SendLocalizedMessage( 501693 ); // This victim is not worth enough to get kill points from.
killer.SendLocalizedMessage( 501693 ); // This victim is not worth enough to get kill points from.
#region Ethics
Ethics.Player killerEPL = Ethics.Player.Find( killer );
@ -1153,7 +1151,7 @@ namespace Server.Factions
if ( 1 > Utility.Random( 3 ) )
killerState.IsActive = true;
int silver = 0;
silver = killerState.Faction.AwardSilver( killer, award * 40 );

View file

@ -24,15 +24,15 @@ namespace Server.Factions
public Mobile Mobile{ get{ return m_Mobile; } }
public Faction Faction{ get{ return m_Faction; } }
public List<PlayerState> Owner { get { return m_Owner; } }
public List<PlayerState> Owner => m_Owner;
public MerchantTitle MerchantTitle{ get{ return m_MerchantTitle; } set{ m_MerchantTitle = value; Invalidate(); } }
public Town Sheriff{ get{ return m_Sheriff; } set{ m_Sheriff = value; Invalidate(); } }
public Town Finance{ get{ return m_Finance; } set{ m_Finance = value; Invalidate(); } }
public List<SilverGivenEntry> SilverGiven { get { return m_SilverGiven; } }
public List<SilverGivenEntry> SilverGiven => m_SilverGiven;
public int KillPoints {
get { return m_KillPoints; }
set {
public int KillPoints {
get { return m_KillPoints; }
set {
if ( m_KillPoints != value ) {
if ( value > m_KillPoints ) {
if ( m_KillPoints <= 0 ) {
@ -41,7 +41,7 @@ namespace Server.Factions
Invalidate();
return;
}
m_Owner.Remove( this );
m_Owner.Insert( m_Faction.ZeroRankOffset, this );
@ -104,9 +104,9 @@ namespace Server.Factions
private int m_RankIndex = -1;
public int RankIndex { get { return m_RankIndex; } set { if ( m_RankIndex != value ) { m_RankIndex = value; m_InvalidateRank = true; } } }
public RankDefinition Rank {
get {
public RankDefinition Rank {
get {
if ( m_InvalidateRank ) {
RankDefinition[] ranks = m_Faction.Definition.Ranks;
int percent;
@ -252,4 +252,4 @@ namespace Server.Factions
return ((PlayerState)obj).m_KillPoints - m_KillPoints;
}
}
}
}

View file

@ -436,7 +436,7 @@ namespace Server.Factions
return ( mob.AccessLevel >= AccessLevel.GameMaster || mob == Finance );
}
public static List<Town> Towns { get { return Reflector.Towns; } }
public static List<Town> Towns => Reflector.Towns;
public const int SilverCaptureBonus = 10000;
@ -551,4 +551,4 @@ namespace Server.Factions
}
}
}
}
}

View file

@ -10,7 +10,7 @@ namespace Server.Factions
private List<BaseFactionVendor> m_Vendors;
public VendorDefinition Definition{ get{ return m_Definition; } }
public List<BaseFactionVendor> Vendors { get { return m_Vendors; } }
public List<BaseFactionVendor> Vendors => m_Vendors;
public BaseFactionVendor Construct( Town town, Faction faction )
{
@ -24,4 +24,4 @@ namespace Server.Factions
m_Vendors = new List<BaseFactionVendor>();
}
}
}
}