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
|
|
@ -7,16 +7,14 @@ namespace Server
|
|||
{
|
||||
public class NameList
|
||||
{
|
||||
private string m_Type;
|
||||
private string[] m_List;
|
||||
public string Type { get; }
|
||||
|
||||
public string Type => m_Type;
|
||||
public string[] List => m_List;
|
||||
public string[] List { get; }
|
||||
|
||||
public bool ContainsName( string name )
|
||||
{
|
||||
for ( int i = 0; i < m_List.Length; i++ )
|
||||
if ( name == m_List[i] )
|
||||
for ( int i = 0; i < List.Length; i++ )
|
||||
if ( name == List[i] )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
@ -24,17 +22,17 @@ namespace Server
|
|||
|
||||
public NameList( string type, XmlElement xml )
|
||||
{
|
||||
m_Type = type;
|
||||
m_List = xml.InnerText.Split( ',' );
|
||||
Type = type;
|
||||
List = xml.InnerText.Split( ',' );
|
||||
|
||||
for ( int i = 0; i < m_List.Length; ++i )
|
||||
m_List[i] = Utility.Intern( m_List[i].Trim() );
|
||||
for ( int i = 0; i < List.Length; ++i )
|
||||
List[i] = Utility.Intern( List[i].Trim() );
|
||||
}
|
||||
|
||||
public string GetRandomName()
|
||||
{
|
||||
if ( m_List.Length > 0 )
|
||||
return m_List[Utility.Random( m_List.Length )];
|
||||
if ( List.Length > 0 )
|
||||
return List[Utility.Random( List.Length )];
|
||||
|
||||
return "";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue