Fixes formatting (#200)
This commit is contained in:
parent
1f651992d7
commit
86b7b3aed1
209 changed files with 51326 additions and 50397 deletions
|
|
@ -1,33 +1,33 @@
|
|||
/***************************************************************************
|
||||
* IMenu.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Menus
|
||||
{
|
||||
public interface IMenu
|
||||
{
|
||||
int Serial { get; }
|
||||
int EntryLength { get; }
|
||||
void SendTo(NetState state);
|
||||
void OnCancel(NetState state);
|
||||
void OnResponse(NetState state, int index);
|
||||
}
|
||||
}
|
||||
/***************************************************************************
|
||||
* IMenu.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Menus
|
||||
{
|
||||
public interface IMenu
|
||||
{
|
||||
int Serial { get; }
|
||||
int EntryLength { get; }
|
||||
void SendTo(NetState state);
|
||||
void OnCancel(NetState state);
|
||||
void OnResponse(NetState state, int index);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,81 +1,81 @@
|
|||
/***************************************************************************
|
||||
* ItemListMenu.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Menus.ItemLists
|
||||
{
|
||||
public class ItemListEntry
|
||||
{
|
||||
public ItemListEntry(string name, int itemID, int hue = 0)
|
||||
{
|
||||
Name = name?.Trim() ?? "";
|
||||
ItemID = itemID;
|
||||
Hue = hue;
|
||||
}
|
||||
|
||||
public string Name { get; }
|
||||
|
||||
public int ItemID { get; }
|
||||
|
||||
public int Hue { get; }
|
||||
}
|
||||
|
||||
public class ItemListMenu : IMenu
|
||||
{
|
||||
private static int m_NextSerial;
|
||||
|
||||
public ItemListMenu(string question, ItemListEntry[] entries)
|
||||
{
|
||||
Question = question.Trim();
|
||||
Entries = entries;
|
||||
|
||||
do
|
||||
{
|
||||
Serial = m_NextSerial++;
|
||||
Serial &= 0x7FFFFFFF;
|
||||
} while (Serial == 0);
|
||||
|
||||
Serial = (int)((uint)Serial | 0x80000000);
|
||||
}
|
||||
|
||||
public string Question { get; }
|
||||
|
||||
public ItemListEntry[] Entries { get; set; }
|
||||
|
||||
public int Serial { get; }
|
||||
|
||||
public int EntryLength => Entries.Length;
|
||||
|
||||
public virtual void OnCancel(NetState state)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnResponse(NetState state, int index)
|
||||
{
|
||||
}
|
||||
|
||||
public void SendTo(NetState state)
|
||||
{
|
||||
state.AddMenu(this);
|
||||
state.Send(new DisplayItemListMenu(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
/***************************************************************************
|
||||
* ItemListMenu.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Menus.ItemLists
|
||||
{
|
||||
public class ItemListEntry
|
||||
{
|
||||
public ItemListEntry(string name, int itemID, int hue = 0)
|
||||
{
|
||||
Name = name?.Trim() ?? "";
|
||||
ItemID = itemID;
|
||||
Hue = hue;
|
||||
}
|
||||
|
||||
public string Name { get; }
|
||||
|
||||
public int ItemID { get; }
|
||||
|
||||
public int Hue { get; }
|
||||
}
|
||||
|
||||
public class ItemListMenu : IMenu
|
||||
{
|
||||
private static int m_NextSerial;
|
||||
|
||||
public ItemListMenu(string question, ItemListEntry[] entries)
|
||||
{
|
||||
Question = question.Trim();
|
||||
Entries = entries;
|
||||
|
||||
do
|
||||
{
|
||||
Serial = m_NextSerial++;
|
||||
Serial &= 0x7FFFFFFF;
|
||||
} while (Serial == 0);
|
||||
|
||||
Serial = (int)((uint)Serial | 0x80000000);
|
||||
}
|
||||
|
||||
public string Question { get; }
|
||||
|
||||
public ItemListEntry[] Entries { get; set; }
|
||||
|
||||
public int Serial { get; }
|
||||
|
||||
public int EntryLength => Entries.Length;
|
||||
|
||||
public virtual void OnCancel(NetState state)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnResponse(NetState state, int index)
|
||||
{
|
||||
}
|
||||
|
||||
public void SendTo(NetState state)
|
||||
{
|
||||
state.AddMenu(this);
|
||||
state.Send(new DisplayItemListMenu(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,63 +1,63 @@
|
|||
/***************************************************************************
|
||||
* QuestionMenu.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Menus.Questions
|
||||
{
|
||||
public class QuestionMenu : IMenu
|
||||
{
|
||||
private static int m_NextSerial;
|
||||
|
||||
public QuestionMenu(string question, string[] answers)
|
||||
{
|
||||
Question = question?.Trim() ?? "";
|
||||
Answers = answers;
|
||||
|
||||
do
|
||||
{
|
||||
Serial = ++m_NextSerial;
|
||||
Serial &= 0x7FFFFFFF;
|
||||
} while (Serial == 0);
|
||||
}
|
||||
|
||||
public string Question { get; }
|
||||
|
||||
public string[] Answers { get; }
|
||||
|
||||
public int Serial { get; }
|
||||
|
||||
public int EntryLength => Answers.Length;
|
||||
|
||||
public virtual void OnCancel(NetState state)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnResponse(NetState state, int index)
|
||||
{
|
||||
}
|
||||
|
||||
public void SendTo(NetState state)
|
||||
{
|
||||
state.AddMenu(this);
|
||||
state.Send(new DisplayQuestionMenu(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
/***************************************************************************
|
||||
* QuestionMenu.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Menus.Questions
|
||||
{
|
||||
public class QuestionMenu : IMenu
|
||||
{
|
||||
private static int m_NextSerial;
|
||||
|
||||
public QuestionMenu(string question, string[] answers)
|
||||
{
|
||||
Question = question?.Trim() ?? "";
|
||||
Answers = answers;
|
||||
|
||||
do
|
||||
{
|
||||
Serial = ++m_NextSerial;
|
||||
Serial &= 0x7FFFFFFF;
|
||||
} while (Serial == 0);
|
||||
}
|
||||
|
||||
public string Question { get; }
|
||||
|
||||
public string[] Answers { get; }
|
||||
|
||||
public int Serial { get; }
|
||||
|
||||
public int EntryLength => Answers.Length;
|
||||
|
||||
public virtual void OnCancel(NetState state)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnResponse(NetState state, int index)
|
||||
{
|
||||
}
|
||||
|
||||
public void SendTo(NetState state)
|
||||
{
|
||||
state.AddMenu(this);
|
||||
state.Send(new DisplayQuestionMenu(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue