Changes properties to use automatic property initializers

This commit is contained in:
Kamron Batman 2018-09-14 15:23:29 -07:00
parent f0a48ad431
commit 06fa31a7bf
623 changed files with 13072 additions and 19304 deletions

View file

@ -2,41 +2,37 @@ namespace Server.Items
{
public class BookContent
{
private string m_Title;
private string m_Author;
public string Title { get; }
private BookPageInfo[] m_Pages;
public string Author { get; }
public string Title => m_Title;
public string Author => m_Author;
public BookPageInfo[] Pages => m_Pages;
public BookPageInfo[] Pages { get; }
public BookContent( string title, string author, params BookPageInfo[] pages )
{
m_Title = title;
m_Author = author;
m_Pages = pages;
Title = title;
Author = author;
Pages = pages;
}
public BookPageInfo[] Copy()
{
BookPageInfo[] copy = new BookPageInfo[m_Pages.Length];
BookPageInfo[] copy = new BookPageInfo[Pages.Length];
for ( int i = 0; i < copy.Length; ++i )
copy[i] = new BookPageInfo( m_Pages[i].Lines );
copy[i] = new BookPageInfo( Pages[i].Lines );
return copy;
}
public bool IsMatch( BookPageInfo[] cmp )
{
if ( cmp.Length != m_Pages.Length )
if ( cmp.Length != Pages.Length )
return false;
for ( int i = 0; i < cmp.Length; ++i )
{
string[] a = m_Pages[i].Lines;
string[] a = Pages[i].Lines;
string[] b = cmp[i].Lines;
if ( a.Length != b.Length )