Formatting FIxes (#58)

This commit is contained in:
Kamron Batman 2019-10-04 23:08:13 -07:00 committed by GitHub
parent 57fb9fb525
commit 096d39609e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1318 changed files with 11633 additions and 22129 deletions

View file

@ -66,10 +66,7 @@ namespace Server.Items
Weight = 5.0;
}
public override bool OnDragDrop(Mobile from, Item dropped)
{
return dropped is BasePiece piece && piece.Board == this && base.OnDragDrop(from, dropped);
}
public override bool OnDragDrop(Mobile from, Item dropped) => dropped is BasePiece piece && piece.Board == this && base.OnDragDrop(from, dropped);
public override bool OnDragDropInto(Mobile from, Item dropped, Point3D point)
{
@ -103,15 +100,11 @@ namespace Server.Items
SetSecureLevelEntry.AddTo(from, this, list);
}
public static bool ValidateDefault(Mobile from, BaseBoard board)
{
// Fixed this because it implies you can use it from your bank, if you can access your bank
// while in your house. (!(board.RootParent is Mobile) || board.RootParent == from)
return !board.Deleted && (from.AccessLevel >= AccessLevel.GameMaster || from.Alive &&
(board.IsChildOf(from.Backpack) || !(board.RootParent is Mobile) &&
board.Map == from.Map && from.InRange(board.GetWorldLocation(), 1) &&
BaseHouse.FindHouseAt(board)?.IsOwner(from) == true));
}
public static bool ValidateDefault(Mobile from, BaseBoard board) =>
!board.Deleted && (from.AccessLevel >= AccessLevel.GameMaster || from.Alive &&
(board.IsChildOf(from.Backpack) || !(board.RootParent is Mobile) &&
board.Map == from.Map && from.InRange(board.GetWorldLocation(), 1) &&
BaseHouse.FindHouseAt(board)?.IsOwner(from) == true));
public class DefaultEntry : ContextMenuEntry
{

View file

@ -2,10 +2,7 @@ namespace Server.Items
{
public class BasePiece : Item
{
public BasePiece(int itemID, BaseBoard board) : base(itemID)
{
Board = board;
}
public BasePiece(int itemID, BaseBoard board) : base(itemID) => Board = board;
public BasePiece(Serial serial) : base(serial)
{
@ -72,24 +69,12 @@ namespace Server.Items
return true;
}
public override bool DropToMobile(Mobile from, Mobile target, Point3D p)
{
return false;
}
public override bool DropToMobile(Mobile from, Mobile target, Point3D p) => false;
public override bool DropToItem(Mobile from, Item target, Point3D p)
{
return target == Board && p.X != -1 && p.Y != -1 && base.DropToItem(from, target, p);
}
public override bool DropToItem(Mobile from, Item target, Point3D p) => target == Board && p.X != -1 && p.Y != -1 && base.DropToItem(from, target, p);
public override bool DropToWorld(Mobile from, Point3D p)
{
return false;
}
public override bool DropToWorld(Mobile from, Point3D p) => false;
public override int GetLiftSound(Mobile from)
{
return -1;
}
public override int GetLiftSound(Mobile from) => -1;
}
}

View file

@ -5,10 +5,7 @@ namespace Server.Items
public class Dices : Item, ITelekinesisable
{
[Constructible]
public Dices() : base(0xFA7)
{
Weight = 1.0;
}
public Dices() : base(0xFA7) => Weight = 1.0;
public Dices(Serial serial) : base(serial)
{

View file

@ -280,10 +280,7 @@ namespace Server.Engines.Mahjong
{
private MahjongGame m_Game;
public ResetGameEntry(MahjongGame game) : base(6162)
{
m_Game = game;
}
public ResetGameEntry(MahjongGame game) : base(6162) => m_Game = game;
public override void OnClick()
{

View file

@ -15,16 +15,11 @@ namespace Server.Engines.Mahjong
Height = height;
}
public bool IsValid()
{
return Position.X >= 0 && Position.Y >= 0 && Position.X + Width <= 670 && Position.Y + Height <= 670;
}
public bool IsValid() => Position.X >= 0 && Position.Y >= 0 && Position.X + Width <= 670 && Position.Y + Height <= 670;
public bool IsOverlapping(MahjongPieceDim dim)
{
return Position.X < dim.Position.X + dim.Width && Position.Y < dim.Position.Y + dim.Height &&
Position.X + Width > dim.Position.X && Position.Y + Height > dim.Position.Y;
}
public bool IsOverlapping(MahjongPieceDim dim) =>
Position.X < dim.Position.X + dim.Width && Position.Y < dim.Position.Y + dim.Height &&
Position.X + Width > dim.Position.X && Position.Y + Height > dim.Position.Y;
public int GetHandArea()
{

View file

@ -89,10 +89,7 @@ namespace Server.Engines.Mahjong
return IsInGamePlayer(index);
}
public bool IsSpectator(Mobile mobile)
{
return m_Spectators.Contains(mobile);
}
public bool IsSpectator(Mobile mobile) => m_Spectators.Contains(mobile);
public int GetScore(int index)
{

View file

@ -23,10 +23,7 @@ namespace Server.Engines.Mahjong
public MahjongPieceDim Dimensions => GetDimensions(Position);
public static MahjongPieceDim GetDimensions(Point2D position)
{
return new MahjongPieceDim(position, 20, 20);
}
public static MahjongPieceDim GetDimensions(Point2D position) => new MahjongPieceDim(position, 20, 20);
public void Move(Point2D position)
{