Formatting FIxes (#58)
This commit is contained in:
parent
57fb9fb525
commit
096d39609e
1318 changed files with 11633 additions and 22129 deletions
|
|
@ -24,10 +24,7 @@ namespace Server.Items
|
|||
{
|
||||
public abstract class BaseMulti : Item
|
||||
{
|
||||
public BaseMulti(int itemID) : base(itemID)
|
||||
{
|
||||
Movable = false;
|
||||
}
|
||||
public BaseMulti(int itemID) : base(itemID) => Movable = false;
|
||||
|
||||
public BaseMulti(Serial serial) : base(serial)
|
||||
{
|
||||
|
|
@ -90,30 +87,15 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
|
||||
public override int GetMaxUpdateRange()
|
||||
{
|
||||
return 22;
|
||||
}
|
||||
public override int GetMaxUpdateRange() => 22;
|
||||
|
||||
public override int GetUpdateRange(Mobile m)
|
||||
{
|
||||
return 22;
|
||||
}
|
||||
public override int GetUpdateRange(Mobile m) => 22;
|
||||
|
||||
public virtual bool Contains(Point2D p)
|
||||
{
|
||||
return Contains(p.m_X, p.m_Y);
|
||||
}
|
||||
public virtual bool Contains(Point2D p) => Contains(p.m_X, p.m_Y);
|
||||
|
||||
public virtual bool Contains(Point3D p)
|
||||
{
|
||||
return Contains(p.m_X, p.m_Y);
|
||||
}
|
||||
public virtual bool Contains(Point3D p) => Contains(p.m_X, p.m_Y);
|
||||
|
||||
public virtual bool Contains(IPoint3D p)
|
||||
{
|
||||
return Contains(p.X, p.Y);
|
||||
}
|
||||
public virtual bool Contains(IPoint3D p) => Contains(p.X, p.Y);
|
||||
|
||||
public virtual bool Contains(int x, int y)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -190,15 +190,9 @@ namespace Server.Items
|
|||
return base.CheckItemUse(from, item);
|
||||
}
|
||||
|
||||
public bool CheckHold(Mobile m, Item item, bool message)
|
||||
{
|
||||
return CheckHold(m, item, message, true, 0, 0);
|
||||
}
|
||||
public bool CheckHold(Mobile m, Item item, bool message) => CheckHold(m, item, message, true, 0, 0);
|
||||
|
||||
public bool CheckHold(Mobile m, Item item, bool message, bool checkItems)
|
||||
{
|
||||
return CheckHold(m, item, message, checkItems, 0, 0);
|
||||
}
|
||||
public bool CheckHold(Mobile m, Item item, bool message, bool checkItems) => CheckHold(m, item, message, checkItems, 0, 0);
|
||||
|
||||
public virtual bool CheckHold(Mobile m, Item item, bool message, bool checkItems, int plusItems, int plusWeight)
|
||||
{
|
||||
|
|
@ -294,10 +288,7 @@ namespace Server.Items
|
|||
flags |= toSet;
|
||||
}
|
||||
|
||||
private static bool GetSaveFlag(SaveFlag flags, SaveFlag toGet)
|
||||
{
|
||||
return (flags & toGet) != 0;
|
||||
}
|
||||
private static bool GetSaveFlag(SaveFlag flags, SaveFlag toGet) => (flags & toGet) != 0;
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
|
|
@ -454,10 +445,7 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
|
||||
public virtual bool OnStackAttempt(Mobile from, Item stack, Item dropped)
|
||||
{
|
||||
return CheckHold(from, dropped, true, false) && stack.StackWith(from, dropped);
|
||||
}
|
||||
public virtual bool OnStackAttempt(Mobile from, Item stack, Item dropped) => CheckHold(from, dropped, true, false) && stack.StackWith(from, dropped);
|
||||
|
||||
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||
{
|
||||
|
|
@ -471,10 +459,7 @@ namespace Server.Items
|
|||
return false;
|
||||
}
|
||||
|
||||
public virtual bool TryDropItem(Mobile from, Item dropped, bool sendFullMessage)
|
||||
{
|
||||
return TryDropItem(from, dropped, sendFullMessage, false);
|
||||
}
|
||||
public virtual bool TryDropItem(Mobile from, Item dropped, bool sendFullMessage) => TryDropItem(from, dropped, sendFullMessage, false);
|
||||
|
||||
public virtual bool TryDropItem(Mobile from, Item dropped, bool sendFullMessage, bool playSound)
|
||||
{
|
||||
|
|
@ -622,12 +607,10 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
|
||||
public virtual bool CheckContentDisplay(Mobile from)
|
||||
{
|
||||
return DisplaysContent && RootParent == null ||
|
||||
RootParent is Item || RootParent == from ||
|
||||
from.AccessLevel > AccessLevel.Player;
|
||||
}
|
||||
public virtual bool CheckContentDisplay(Mobile from) =>
|
||||
DisplaysContent && RootParent == null ||
|
||||
RootParent is Item || RootParent == from ||
|
||||
from.AccessLevel > AccessLevel.Player;
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
|
|
@ -757,15 +740,9 @@ namespace Server.Items
|
|||
{
|
||||
private CheckItemGroup m_Grouper;
|
||||
|
||||
public GroupComparer(CheckItemGroup grouper)
|
||||
{
|
||||
m_Grouper = grouper;
|
||||
}
|
||||
public GroupComparer(CheckItemGroup grouper) => m_Grouper = grouper;
|
||||
|
||||
public int Compare(Item a, Item b)
|
||||
{
|
||||
return m_Grouper(a, b);
|
||||
}
|
||||
public int Compare(Item a, Item b) => m_Grouper(a, b);
|
||||
}
|
||||
|
||||
[Flags]
|
||||
|
|
@ -1503,10 +1480,7 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
|
||||
public Item FindItemByType(Type type, bool recurse = true)
|
||||
{
|
||||
return RecurseFindItemByType(this, type, recurse);
|
||||
}
|
||||
public Item FindItemByType(Type type, bool recurse = true) => RecurseFindItemByType(this, type, recurse);
|
||||
|
||||
private static Item RecurseFindItemByType(Item current, Type type, bool recurse)
|
||||
{
|
||||
|
|
@ -1534,10 +1508,7 @@ namespace Server.Items
|
|||
return null;
|
||||
}
|
||||
|
||||
public Item FindItemByType(Type[] types, bool recurse = true)
|
||||
{
|
||||
return RecurseFindItemByType(this, types, recurse);
|
||||
}
|
||||
public Item FindItemByType(Type[] types, bool recurse = true) => RecurseFindItemByType(this, types, recurse);
|
||||
|
||||
private static Item RecurseFindItemByType(Item current, Type[] types, bool recurse)
|
||||
{
|
||||
|
|
@ -1568,10 +1539,7 @@ namespace Server.Items
|
|||
|
||||
#region Generic FindItem[s] by Type
|
||||
|
||||
public List<T> FindItemsByType<T>(Predicate<T> predicate) where T : Item
|
||||
{
|
||||
return FindItemsByType(true, predicate);
|
||||
}
|
||||
public List<T> FindItemsByType<T>(Predicate<T> predicate) where T : Item => FindItemsByType(true, predicate);
|
||||
|
||||
public List<T> FindItemsByType<T>(bool recurse = true, Predicate<T> predicate = null) where T : Item
|
||||
{
|
||||
|
|
@ -1604,10 +1572,7 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
|
||||
public T FindItemByType<T>(bool recurse = true) where T : Item
|
||||
{
|
||||
return RecurseFindItemByType<T>(this, recurse);
|
||||
}
|
||||
public T FindItemByType<T>(bool recurse = true) where T : Item => RecurseFindItemByType<T>(this, recurse);
|
||||
|
||||
private static T RecurseFindItemByType<T>(Item current, bool recurse = true, Predicate<T> predicate = null) where T : Item
|
||||
{
|
||||
|
|
|
|||
|
|
@ -109,26 +109,15 @@ namespace Server.Items
|
|||
{
|
||||
}
|
||||
|
||||
public override DeathMoveResult OnParentDeath(Mobile parent)
|
||||
{
|
||||
return DeathMoveResult.RemainEquipped;
|
||||
}
|
||||
public override DeathMoveResult OnParentDeath(Mobile parent) => DeathMoveResult.RemainEquipped;
|
||||
|
||||
public override bool IsAccessibleTo(Mobile check)
|
||||
{
|
||||
return (check == Owner && Opened || check.AccessLevel >= AccessLevel.GameMaster) && base.IsAccessibleTo(check);
|
||||
}
|
||||
public override bool IsAccessibleTo(Mobile check) => (check == Owner && Opened || check.AccessLevel >= AccessLevel.GameMaster) && base.IsAccessibleTo(check);
|
||||
|
||||
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||
{
|
||||
return (from == Owner && Opened || from.AccessLevel >= AccessLevel.GameMaster) && base.OnDragDrop(from, dropped);
|
||||
}
|
||||
public override bool OnDragDrop(Mobile from, Item dropped) => (from == Owner && Opened || from.AccessLevel >= AccessLevel.GameMaster) && base.OnDragDrop(from, dropped);
|
||||
|
||||
public override bool OnDragDropInto(Mobile from, Item item, Point3D p)
|
||||
{
|
||||
return (from == Owner && Opened || from.AccessLevel >= AccessLevel.GameMaster) &&
|
||||
base.OnDragDropInto(from, item, p);
|
||||
}
|
||||
public override bool OnDragDropInto(Mobile from, Item item, Point3D p) =>
|
||||
(from == Owner && Opened || from.AccessLevel >= AccessLevel.GameMaster) &&
|
||||
base.OnDragDropInto(from, item, p);
|
||||
|
||||
public override int GetTotal(TotalType type)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -53,10 +53,7 @@ namespace Server.Items
|
|||
return false;
|
||||
}
|
||||
|
||||
public override bool IsAccessibleTo(Mobile check)
|
||||
{
|
||||
return IsChildOf(check) && Trade?.Valid == true && base.IsAccessibleTo(check);
|
||||
}
|
||||
public override bool IsAccessibleTo(Mobile check) => IsChildOf(check) && Trade?.Valid == true && base.IsAccessibleTo(check);
|
||||
|
||||
public override void OnItemAdded(Item item)
|
||||
{
|
||||
|
|
@ -96,12 +93,10 @@ namespace Server.Items
|
|||
Trade.Update();
|
||||
}
|
||||
|
||||
public override bool IsChildVisibleTo(Mobile m, Item child)
|
||||
{
|
||||
return child is VirtualCheck
|
||||
public override bool IsChildVisibleTo(Mobile m, Item child) =>
|
||||
child is VirtualCheck
|
||||
? AccountGold.Enabled && m.NetState?.NewSecureTrading != true
|
||||
: base.IsChildVisibleTo(m, child);
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -77,10 +77,7 @@ namespace Server
|
|||
}
|
||||
|
||||
// TOOD: Can we make this higher for newer clients?
|
||||
public static uint FakeSerial(Mobile parent)
|
||||
{
|
||||
return 0x7FFFFFFF - 0x400 - parent.Serial * 4;
|
||||
}
|
||||
public static uint FakeSerial(Mobile parent) => 0x7FFFFFFF - 0x400 - parent.Serial * 4;
|
||||
}
|
||||
|
||||
public class FacialHairInfo : BaseHairInfo
|
||||
|
|
@ -101,10 +98,7 @@ namespace Server
|
|||
}
|
||||
|
||||
// TOOD: Can we make this higher for newer clients?
|
||||
public static uint FakeSerial(Mobile parent)
|
||||
{
|
||||
return 0x7FFFFFFF - 0x400 - 1 - parent.Serial * 4;
|
||||
}
|
||||
public static uint FakeSerial(Mobile parent) => 0x7FFFFFFF - 0x400 - 1 - parent.Serial * 4;
|
||||
}
|
||||
|
||||
public sealed class HairEquipUpdate : Packet
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue