Clean up: Bugs, LINQ, constructors, default values, and null checks (#18)

This commit is contained in:
Kamron Batman 2019-03-11 14:29:59 -07:00 • committed by GitHub
parent e748af4430
commit 513e54f70e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1094 changed files with 15913 additions and 21892 deletions

View file

@ -10,18 +10,13 @@ namespace Server.Engines.MLQuests.Items
[Constructible]
public MLQuestTeleporter()
: this(Point3D.Zero, null, null, null)
: this(Point3D.Zero)
{
}
[Constructible]
public MLQuestTeleporter(Point3D pointDest, Map mapDest)
: this(pointDest, mapDest, null, null)
{
}
[Constructible]
public MLQuestTeleporter(Point3D pointDest, Map mapDest, Type questType, TextDefinition message)
public MLQuestTeleporter(
Point3D pointDest, Map mapDest = null, Type questType = null, TextDefinition message = null)
: base(pointDest, mapDest)
{
m_QuestType = questType;
@ -110,18 +105,13 @@ namespace Server.Engines.MLQuests.Items
[Constructible]
public TicketTeleporter()
: this(Point3D.Zero, null, null, null)
: this(Point3D.Zero)
{
}
[Constructible]
public TicketTeleporter(Point3D pointDest, Map mapDest)
: this(pointDest, mapDest, null, null)
{
}
[Constructible]
public TicketTeleporter(Point3D pointDest, Map mapDest, Type ticketType, TextDefinition message)
public TicketTeleporter(
Point3D pointDest, Map mapDest = null, Type ticketType = null, TextDefinition message = null)
: base(pointDest, mapDest)
{
m_TicketType = ticketType;
@ -154,7 +144,7 @@ namespace Server.Engines.MLQuests.Items
if (m_TicketType == null)
return true;
Container pack = m.Backpack;
Item ticket = pack?.FindItemByType(m_TicketType, false) ?? m.Items.Find(item => m_TicketType.IsInstanceOfType(item));
@ -201,4 +191,4 @@ namespace Server.Engines.MLQuests.Items
Message = TextDefinition.Deserialize(reader);
}
}
}
}