Fixes code according to modern code style. Fixes a few expression bugs.
This commit is contained in:
parent
89eea25e5f
commit
970fd563b2
3324 changed files with 441118 additions and 433755 deletions
|
|
@ -1,56 +1,49 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class BookContent
|
||||
{
|
||||
public string Title { get; }
|
||||
public class BookContent
|
||||
{
|
||||
public BookContent(string title, string author, params BookPageInfo[] pages)
|
||||
{
|
||||
Title = title;
|
||||
Author = author;
|
||||
Pages = pages;
|
||||
}
|
||||
|
||||
public string Author { get; }
|
||||
public string Title{ get; }
|
||||
|
||||
public BookPageInfo[] Pages { get; }
|
||||
public string Author{ get; }
|
||||
|
||||
public BookContent( string title, string author, params BookPageInfo[] pages )
|
||||
{
|
||||
Title = title;
|
||||
Author = author;
|
||||
Pages = pages;
|
||||
}
|
||||
public BookPageInfo[] Pages{ get; }
|
||||
|
||||
public BookPageInfo[] Copy()
|
||||
{
|
||||
BookPageInfo[] copy = new BookPageInfo[Pages.Length];
|
||||
public BookPageInfo[] Copy()
|
||||
{
|
||||
BookPageInfo[] copy = new BookPageInfo[Pages.Length];
|
||||
|
||||
for ( int i = 0; i < copy.Length; ++i )
|
||||
copy[i] = new BookPageInfo( Pages[i].Lines );
|
||||
for (int i = 0; i < copy.Length; ++i)
|
||||
copy[i] = new BookPageInfo(Pages[i].Lines);
|
||||
|
||||
return copy;
|
||||
}
|
||||
return copy;
|
||||
}
|
||||
|
||||
public bool IsMatch( BookPageInfo[] cmp )
|
||||
{
|
||||
if ( cmp.Length != Pages.Length )
|
||||
return false;
|
||||
public bool IsMatch(BookPageInfo[] cmp)
|
||||
{
|
||||
if (cmp.Length != Pages.Length)
|
||||
return false;
|
||||
|
||||
for ( int i = 0; i < cmp.Length; ++i )
|
||||
{
|
||||
string[] a = Pages[i].Lines;
|
||||
string[] b = cmp[i].Lines;
|
||||
for (int i = 0; i < cmp.Length; ++i)
|
||||
{
|
||||
string[] a = Pages[i].Lines;
|
||||
string[] b = cmp[i].Lines;
|
||||
|
||||
if ( a.Length != b.Length )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (a.Length != b.Length) return false;
|
||||
|
||||
if ( a != b )
|
||||
{
|
||||
for ( int j = 0; j < a.Length; ++j )
|
||||
{
|
||||
if ( a[j] != b[j] )
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (a != b)
|
||||
for (int j = 0; j < a.Length; ++j)
|
||||
if (a[j] != b[j])
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue