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
|
|
@ -24,15 +24,11 @@ namespace Server.Menus.ItemLists
|
|||
{
|
||||
public class ItemListEntry
|
||||
{
|
||||
private string m_Name;
|
||||
private int m_ItemID;
|
||||
private int m_Hue;
|
||||
public string Name { get; }
|
||||
|
||||
public string Name => m_Name;
|
||||
public int ItemID { get; }
|
||||
|
||||
public int ItemID => m_ItemID;
|
||||
|
||||
public int Hue => m_Hue;
|
||||
public int Hue { get; }
|
||||
|
||||
public ItemListEntry( string name, int itemID ) : this( name, itemID, 0 )
|
||||
{
|
||||
|
|
@ -40,36 +36,29 @@ namespace Server.Menus.ItemLists
|
|||
|
||||
public ItemListEntry( string name, int itemID, int hue )
|
||||
{
|
||||
m_Name = name;
|
||||
m_ItemID = itemID;
|
||||
m_Hue = hue;
|
||||
Name = name;
|
||||
ItemID = itemID;
|
||||
Hue = hue;
|
||||
}
|
||||
}
|
||||
|
||||
public class ItemListMenu : IMenu
|
||||
{
|
||||
private string m_Question;
|
||||
private ItemListEntry[] m_Entries;
|
||||
|
||||
private int m_Serial;
|
||||
private static int m_NextSerial;
|
||||
|
||||
int IMenu.Serial => m_Serial;
|
||||
|
||||
int IMenu.EntryLength => m_Entries.Length;
|
||||
int IMenu.EntryLength => Entries.Length;
|
||||
|
||||
public string Question => m_Question;
|
||||
public string Question { get; }
|
||||
|
||||
public ItemListEntry[] Entries
|
||||
{
|
||||
get => m_Entries;
|
||||
set => m_Entries = value;
|
||||
}
|
||||
public ItemListEntry[] Entries { get; set; }
|
||||
|
||||
public ItemListMenu( string question, ItemListEntry[] entries )
|
||||
{
|
||||
m_Question = question;
|
||||
m_Entries = entries;
|
||||
Question = question;
|
||||
Entries = entries;
|
||||
|
||||
do
|
||||
{
|
||||
|
|
|
|||
|
|
@ -24,28 +24,21 @@ namespace Server.Menus.Questions
|
|||
{
|
||||
public class QuestionMenu : IMenu
|
||||
{
|
||||
private string m_Question;
|
||||
private string[] m_Answers;
|
||||
|
||||
private int m_Serial;
|
||||
private static int m_NextSerial;
|
||||
|
||||
int IMenu.Serial => m_Serial;
|
||||
|
||||
int IMenu.EntryLength => m_Answers.Length;
|
||||
int IMenu.EntryLength => Answers.Length;
|
||||
|
||||
public string Question
|
||||
{
|
||||
get => m_Question;
|
||||
set => m_Question = value;
|
||||
}
|
||||
public string Question { get; set; }
|
||||
|
||||
public string[] Answers => m_Answers;
|
||||
public string[] Answers { get; }
|
||||
|
||||
public QuestionMenu( string question, string[] answers )
|
||||
{
|
||||
m_Question = question;
|
||||
m_Answers = answers;
|
||||
Question = question;
|
||||
Answers = answers;
|
||||
|
||||
do
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue