Changes properties to use automatic property initializers
This commit is contained in:
parent
f0a48ad431
commit
06fa31a7bf
623 changed files with 13072 additions and 19304 deletions
|
|
@ -9,7 +9,6 @@ namespace Server.Items
|
|||
{
|
||||
public class Guildstone : Item, IAddon, IChopable
|
||||
{
|
||||
private Guild m_Guild;
|
||||
private string m_GuildName;
|
||||
private string m_GuildAbbrev;
|
||||
|
||||
|
|
@ -28,7 +27,7 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Guild Guild => m_Guild;
|
||||
public Guild Guild { get; private set; }
|
||||
|
||||
public override int LabelNumber => 1041429; // a guildstone
|
||||
|
||||
|
|
@ -38,7 +37,7 @@ namespace Server.Items
|
|||
|
||||
public Guildstone( Guild g, string guildName, string abbrev ) : base( Guild.NewGuildSystem ? 0xED6 : 0xED4 )
|
||||
{
|
||||
m_Guild = g;
|
||||
Guild = g;
|
||||
m_GuildName = guildName;
|
||||
m_GuildAbbrev = abbrev;
|
||||
|
||||
|
|
@ -53,10 +52,10 @@ namespace Server.Items
|
|||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
if ( m_Guild != null && !m_Guild.Disbanded )
|
||||
if ( Guild != null && !Guild.Disbanded )
|
||||
{
|
||||
m_GuildName = m_Guild.Name;
|
||||
m_GuildAbbrev = m_Guild.Abbreviation;
|
||||
m_GuildName = Guild.Name;
|
||||
m_GuildAbbrev = Guild.Abbreviation;
|
||||
}
|
||||
|
||||
writer.Write( (int)3 ); // version
|
||||
|
|
@ -66,7 +65,7 @@ namespace Server.Items
|
|||
writer.Write( m_GuildName );
|
||||
writer.Write( m_GuildAbbrev );
|
||||
|
||||
writer.Write( m_Guild );
|
||||
writer.Write( Guild );
|
||||
}
|
||||
|
||||
private bool m_BeforeChangeover;
|
||||
|
|
@ -92,7 +91,7 @@ namespace Server.Items
|
|||
}
|
||||
case 1:
|
||||
{
|
||||
m_Guild = reader.ReadGuild() as Guild;
|
||||
Guild = reader.ReadGuild() as Guild;
|
||||
|
||||
goto case 0;
|
||||
}
|
||||
|
|
@ -111,7 +110,7 @@ namespace Server.Items
|
|||
if ( Guild.NewGuildSystem && m_BeforeChangeover )
|
||||
Timer.DelayCall( TimeSpan.Zero, AddToHouse );
|
||||
|
||||
if ( !Guild.NewGuildSystem && m_Guild == null )
|
||||
if ( !Guild.NewGuildSystem && Guild == null )
|
||||
Delete();
|
||||
}
|
||||
|
||||
|
|
@ -130,15 +129,15 @@ namespace Server.Items
|
|||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_Guild != null && !m_Guild.Disbanded )
|
||||
if ( Guild != null && !Guild.Disbanded )
|
||||
{
|
||||
string name;
|
||||
string abbr;
|
||||
|
||||
if ( (name = m_Guild.Name) == null || (name = name.Trim()).Length <= 0 )
|
||||
if ( (name = Guild.Name) == null || (name = name.Trim()).Length <= 0 )
|
||||
name = "(unnamed)";
|
||||
|
||||
if ( (abbr = m_Guild.Abbreviation) == null || (abbr = abbr.Trim()).Length <= 0 )
|
||||
if ( (abbr = Guild.Abbreviation) == null || (abbr = abbr.Trim()).Length <= 0 )
|
||||
abbr = "";
|
||||
|
||||
//list.Add( 1060802, Utility.FixHtml( name ) ); // Guild name: ~1_val~
|
||||
|
|
@ -154,11 +153,11 @@ namespace Server.Items
|
|||
{
|
||||
base.OnSingleClick( from );
|
||||
|
||||
if ( m_Guild != null && !m_Guild.Disbanded )
|
||||
if ( Guild != null && !Guild.Disbanded )
|
||||
{
|
||||
string name;
|
||||
|
||||
if ( (name = m_Guild.Name) == null || (name = name.Trim()).Length <= 0 )
|
||||
if ( (name = Guild.Name) == null || (name = name.Trim()).Length <= 0 )
|
||||
name = "(unnamed)";
|
||||
|
||||
LabelTo( from, name );
|
||||
|
|
@ -171,8 +170,8 @@ namespace Server.Items
|
|||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
if ( !Guild.NewGuildSystem && m_Guild != null && !m_Guild.Disbanded )
|
||||
m_Guild.Disband();
|
||||
if ( !Guild.NewGuildSystem && Guild != null && !Guild.Disbanded )
|
||||
Guild.Disband();
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
|
|
@ -180,7 +179,7 @@ namespace Server.Items
|
|||
if ( Guild.NewGuildSystem )
|
||||
return;
|
||||
|
||||
if ( m_Guild == null || m_Guild.Disbanded )
|
||||
if ( Guild == null || Guild.Disbanded )
|
||||
{
|
||||
Delete();
|
||||
}
|
||||
|
|
@ -188,10 +187,10 @@ namespace Server.Items
|
|||
{
|
||||
from.SendLocalizedMessage( 500446 ); // That is too far away.
|
||||
}
|
||||
else if ( m_Guild.Accepted.Contains( from ) )
|
||||
else if ( Guild.Accepted.Contains( from ) )
|
||||
{
|
||||
#region Factions
|
||||
PlayerState guildState = PlayerState.Find( m_Guild.Leader );
|
||||
PlayerState guildState = PlayerState.Find( Guild.Leader );
|
||||
PlayerState targetState = PlayerState.Find( from );
|
||||
|
||||
Faction guildFaction = guildState?.Faction;
|
||||
|
|
@ -204,25 +203,25 @@ namespace Server.Items
|
|||
targetState.Leaving = guildState.Leaving;
|
||||
#endregion
|
||||
|
||||
m_Guild.Accepted.Remove( from );
|
||||
m_Guild.AddMember( from );
|
||||
Guild.Accepted.Remove( from );
|
||||
Guild.AddMember( from );
|
||||
|
||||
GuildGump.EnsureClosed( from );
|
||||
from.SendGump( new GuildGump( from, m_Guild ) );
|
||||
from.SendGump( new GuildGump( from, Guild ) );
|
||||
}
|
||||
else if ( from.AccessLevel < AccessLevel.GameMaster && !m_Guild.IsMember( from ) )
|
||||
else if ( from.AccessLevel < AccessLevel.GameMaster && !Guild.IsMember( from ) )
|
||||
{
|
||||
from.Send( new MessageLocalized( Serial, ItemID, MessageType.Regular, 0x3B2, 3, 501158, "", "" ) ); // You are not a member ...
|
||||
}
|
||||
else
|
||||
{
|
||||
GuildGump.EnsureClosed( from );
|
||||
from.SendGump( new GuildGump( from, m_Guild ) );
|
||||
from.SendGump( new GuildGump( from, Guild ) );
|
||||
}
|
||||
}
|
||||
|
||||
#region IAddon Members
|
||||
public Item Deed => new GuildstoneDeed( m_Guild, m_GuildName, m_GuildAbbrev );
|
||||
public Item Deed => new GuildstoneDeed( Guild, m_GuildName, m_GuildAbbrev );
|
||||
|
||||
public bool CouldFit( IPoint3D p, Map map )
|
||||
{
|
||||
|
|
@ -267,7 +266,6 @@ namespace Server.Items
|
|||
{
|
||||
public override int LabelNumber => 1041233; // deed to a guildstone
|
||||
|
||||
private Guild m_Guild;
|
||||
private string m_GuildName;
|
||||
private string m_GuildAbbrev;
|
||||
|
||||
|
|
@ -286,7 +284,7 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Guild Guild => m_Guild;
|
||||
public Guild Guild { get; private set; }
|
||||
|
||||
[Constructible]
|
||||
public GuildstoneDeed() : this( null, null )
|
||||
|
|
@ -300,7 +298,7 @@ namespace Server.Items
|
|||
|
||||
public GuildstoneDeed( Guild g, string guildName, string abbrev ) : base( 0x14F0 )
|
||||
{
|
||||
m_Guild = g;
|
||||
Guild = g;
|
||||
m_GuildName = guildName;
|
||||
m_GuildAbbrev = abbrev;
|
||||
|
||||
|
|
@ -315,10 +313,10 @@ namespace Server.Items
|
|||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
if ( m_Guild != null && !m_Guild.Disbanded )
|
||||
if ( Guild != null && !Guild.Disbanded )
|
||||
{
|
||||
m_GuildName = m_Guild.Name;
|
||||
m_GuildAbbrev = m_Guild.Abbreviation;
|
||||
m_GuildName = Guild.Name;
|
||||
m_GuildAbbrev = Guild.Abbreviation;
|
||||
}
|
||||
|
||||
writer.Write( (int)1 ); // version
|
||||
|
|
@ -326,7 +324,7 @@ namespace Server.Items
|
|||
writer.Write( m_GuildName );
|
||||
writer.Write( m_GuildAbbrev );
|
||||
|
||||
writer.Write( m_Guild );
|
||||
writer.Write( Guild );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -342,7 +340,7 @@ namespace Server.Items
|
|||
m_GuildName = reader.ReadString();
|
||||
m_GuildAbbrev = reader.ReadString();
|
||||
|
||||
m_Guild = reader.ReadGuild() as Guild;
|
||||
Guild = reader.ReadGuild() as Guild;
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -353,15 +351,15 @@ namespace Server.Items
|
|||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_Guild != null && !m_Guild.Disbanded )
|
||||
if ( Guild != null && !Guild.Disbanded )
|
||||
{
|
||||
string name;
|
||||
string abbr;
|
||||
|
||||
if ( (name = m_Guild.Name) == null || (name = name.Trim()).Length <= 0 )
|
||||
if ( (name = Guild.Name) == null || (name = name.Trim()).Length <= 0 )
|
||||
name = "(unnamed)";
|
||||
|
||||
if ( (abbr = m_Guild.Abbreviation) == null || (abbr = abbr.Trim()).Length <= 0 )
|
||||
if ( (abbr = Guild.Abbreviation) == null || (abbr = abbr.Trim()).Length <= 0 )
|
||||
abbr = "";
|
||||
|
||||
//list.Add( 1060802, Utility.FixHtml( name ) ); // Guild name: ~1_val~
|
||||
|
|
@ -408,7 +406,7 @@ namespace Server.Items
|
|||
{
|
||||
if ( house != null && house.IsOwner( from ) )
|
||||
{
|
||||
Item addon = new Guildstone( m_Guild, m_GuildName, m_GuildAbbrev );
|
||||
Item addon = new Guildstone( Guild, m_GuildName, m_GuildAbbrev );
|
||||
|
||||
addon.MoveToWorld( loc, from.Map );
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue