Adds style cop (#109)
This commit is contained in:
parent
3e715bcb60
commit
556a17aba8
1725 changed files with 33831 additions and 38046 deletions
|
|
@ -24,10 +24,10 @@ namespace Server.Menus
|
|||
{
|
||||
public interface IMenu
|
||||
{
|
||||
int Serial{ get; }
|
||||
int EntryLength{ get; }
|
||||
int Serial { get; }
|
||||
int EntryLength { get; }
|
||||
void SendTo(NetState state);
|
||||
void OnCancel(NetState state);
|
||||
void OnResponse(NetState state, int index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,17 +31,16 @@ namespace Server.Menus.ItemLists
|
|||
Hue = hue;
|
||||
}
|
||||
|
||||
public string Name{ get; }
|
||||
public string Name { get; }
|
||||
|
||||
public int ItemID{ get; }
|
||||
public int ItemID { get; }
|
||||
|
||||
public int Hue{ get; }
|
||||
public int Hue { get; }
|
||||
}
|
||||
|
||||
public class ItemListMenu : IMenu
|
||||
{
|
||||
private static int m_NextSerial;
|
||||
private readonly int m_Serial;
|
||||
|
||||
public ItemListMenu(string question, ItemListEntry[] entries)
|
||||
{
|
||||
|
|
@ -50,20 +49,20 @@ namespace Server.Menus.ItemLists
|
|||
|
||||
do
|
||||
{
|
||||
m_Serial = m_NextSerial++;
|
||||
m_Serial &= 0x7FFFFFFF;
|
||||
} while (m_Serial == 0);
|
||||
Serial = m_NextSerial++;
|
||||
Serial &= 0x7FFFFFFF;
|
||||
} while (Serial == 0);
|
||||
|
||||
m_Serial = (int)((uint)m_Serial | 0x80000000);
|
||||
Serial = (int)((uint)Serial | 0x80000000);
|
||||
}
|
||||
|
||||
public string Question{ get; }
|
||||
public string Question { get; }
|
||||
|
||||
public ItemListEntry[] Entries{ get; set; }
|
||||
public ItemListEntry[] Entries { get; set; }
|
||||
|
||||
int IMenu.Serial => m_Serial;
|
||||
public int Serial { get; }
|
||||
|
||||
int IMenu.EntryLength => Entries.Length;
|
||||
public int EntryLength => Entries.Length;
|
||||
|
||||
public virtual void OnCancel(NetState state)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ namespace Server.Menus.Questions
|
|||
public class QuestionMenu : IMenu
|
||||
{
|
||||
private static int m_NextSerial;
|
||||
private readonly int m_Serial;
|
||||
|
||||
public QuestionMenu(string question, string[] answers)
|
||||
{
|
||||
|
|
@ -34,18 +33,18 @@ namespace Server.Menus.Questions
|
|||
|
||||
do
|
||||
{
|
||||
m_Serial = ++m_NextSerial;
|
||||
m_Serial &= 0x7FFFFFFF;
|
||||
} while (m_Serial == 0);
|
||||
Serial = ++m_NextSerial;
|
||||
Serial &= 0x7FFFFFFF;
|
||||
} while (Serial == 0);
|
||||
}
|
||||
|
||||
public string Question{ get; set; }
|
||||
public string Question { get; set; }
|
||||
|
||||
public string[] Answers{ get; }
|
||||
public string[] Answers { get; }
|
||||
|
||||
int IMenu.Serial => m_Serial;
|
||||
public int Serial { get; }
|
||||
|
||||
int IMenu.EntryLength => Answers.Length;
|
||||
public int EntryLength => Answers.Length;
|
||||
|
||||
public virtual void OnCancel(NetState state)
|
||||
{
|
||||
|
|
@ -61,4 +60,4 @@ namespace Server.Menus.Questions
|
|||
state.Send(new DisplayQuestionMenu(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue