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
|
|
@ -649,42 +649,32 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
}
|
||||
|
||||
private string m_Title, m_Description;
|
||||
private string[] m_Options;
|
||||
public string Title { get; }
|
||||
|
||||
private int m_Offset, m_TotalLength;
|
||||
public string Description { get; }
|
||||
|
||||
private Ruleset[] m_Defaults;
|
||||
private Ruleset[] m_Flavors;
|
||||
public string[] Options { get; }
|
||||
|
||||
private RulesetLayout m_Parent;
|
||||
private RulesetLayout[] m_Children;
|
||||
public int Offset { get; private set; }
|
||||
|
||||
public string Title => m_Title;
|
||||
public string Description => m_Description;
|
||||
public string[] Options => m_Options;
|
||||
public int TotalLength { get; private set; }
|
||||
|
||||
public int Offset => m_Offset;
|
||||
public int TotalLength => m_TotalLength;
|
||||
public RulesetLayout Parent { get; private set; }
|
||||
|
||||
public RulesetLayout Parent => m_Parent;
|
||||
public RulesetLayout[] Children => m_Children;
|
||||
public RulesetLayout[] Children { get; }
|
||||
|
||||
public Ruleset[] Defaults{ get => m_Defaults;
|
||||
set => m_Defaults = value;
|
||||
}
|
||||
public Ruleset[] Flavors{ get => m_Flavors;
|
||||
set => m_Flavors = value;
|
||||
}
|
||||
public Ruleset[] Defaults { get; set; }
|
||||
|
||||
public Ruleset[] Flavors { get; set; }
|
||||
|
||||
public RulesetLayout FindByTitle( string title )
|
||||
{
|
||||
if ( m_Title == title )
|
||||
if ( Title == title )
|
||||
return this;
|
||||
|
||||
for ( int i = 0; i < m_Children.Length; ++i )
|
||||
for ( int i = 0; i < Children.Length; ++i )
|
||||
{
|
||||
RulesetLayout layout = m_Children[i].FindByTitle( title );
|
||||
RulesetLayout layout = Children[i].FindByTitle( title );
|
||||
|
||||
if ( layout != null )
|
||||
return layout;
|
||||
|
|
@ -695,12 +685,12 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public string FindByIndex( int index )
|
||||
{
|
||||
if ( index >= m_Offset && index < (m_Offset + m_Options.Length) )
|
||||
return m_Description + ": " + m_Options[index - m_Offset];
|
||||
if ( index >= Offset && index < (Offset + Options.Length) )
|
||||
return Description + ": " + Options[index - Offset];
|
||||
|
||||
for ( int i = 0; i < m_Children.Length; ++i )
|
||||
for ( int i = 0; i < Children.Length; ++i )
|
||||
{
|
||||
string opt = m_Children[i].FindByIndex( index );
|
||||
string opt = Children[i].FindByIndex( index );
|
||||
|
||||
if ( opt != null )
|
||||
return opt;
|
||||
|
|
@ -711,7 +701,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public RulesetLayout FindByOption( string title, string option, ref int index )
|
||||
{
|
||||
if ( title == null || m_Title == title )
|
||||
if ( title == null || Title == title )
|
||||
{
|
||||
index = GetOptionIndex( option );
|
||||
|
||||
|
|
@ -721,9 +711,9 @@ namespace Server.Engines.ConPVP
|
|||
title = null;
|
||||
}
|
||||
|
||||
for ( int i = 0; i < m_Children.Length; ++i )
|
||||
for ( int i = 0; i < Children.Length; ++i )
|
||||
{
|
||||
RulesetLayout layout = m_Children[i].FindByOption( title, option, ref index );
|
||||
RulesetLayout layout = Children[i].FindByOption( title, option, ref index );
|
||||
|
||||
if ( layout != null )
|
||||
return layout;
|
||||
|
|
@ -734,7 +724,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public int GetOptionIndex( string option )
|
||||
{
|
||||
return Array.IndexOf( m_Options, option );
|
||||
return Array.IndexOf( Options, option );
|
||||
}
|
||||
|
||||
public void ComputeOffsets()
|
||||
|
|
@ -746,15 +736,15 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
private int RecurseComputeOffsets( ref int offset )
|
||||
{
|
||||
m_Offset = offset;
|
||||
Offset = offset;
|
||||
|
||||
offset += m_Options.Length;
|
||||
m_TotalLength += m_Options.Length;
|
||||
offset += Options.Length;
|
||||
TotalLength += Options.Length;
|
||||
|
||||
for ( int i = 0; i < m_Children.Length; ++i )
|
||||
m_TotalLength += m_Children[i].RecurseComputeOffsets( ref offset );
|
||||
for ( int i = 0; i < Children.Length; ++i )
|
||||
TotalLength += Children[i].RecurseComputeOffsets( ref offset );
|
||||
|
||||
return m_TotalLength;
|
||||
return TotalLength;
|
||||
}
|
||||
|
||||
public RulesetLayout( string title, string[] options ) : this( title, title, new RulesetLayout[0], options )
|
||||
|
|
@ -779,13 +769,13 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public RulesetLayout( string title, string description, RulesetLayout[] children, string[] options )
|
||||
{
|
||||
m_Title = title;
|
||||
m_Description = description;
|
||||
m_Children = children;
|
||||
m_Options = options;
|
||||
Title = title;
|
||||
Description = description;
|
||||
Children = children;
|
||||
Options = options;
|
||||
|
||||
for ( int i = 0; i < children.Length; ++i )
|
||||
children[i].m_Parent = this;
|
||||
children[i].Parent = this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue