fix(cleanup): Consolidate the duplicate code in Properties, PropsGump, and PropsConfig (#540)

This commit is contained in:
Kamron Batman 2021-04-14 22:58:56 -07:00 • committed by GitHub
parent 98ce65083a
commit dd2933a9ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 335 additions and 761 deletions

View file

@ -14,11 +14,12 @@
*************************************************************************/
using System.Collections.Generic;
using Server.Commands;
using Server.Commands.Generic;
using Server.Gumps;
using Server.Targeting;
using static Server.Types;
namespace Server.Engines.Spawners
{
public class SpawnPropsCommand : BaseCommand
@ -53,15 +54,14 @@ namespace Server.Engines.Spawners
private class InternalTarget : Target
{
private List<object> _list;
private readonly List<object> _list;
public InternalTarget(List<object> list) : base(-1, false, TargetFlags.None) =>
_list = list;
public InternalTarget(List<object> list) : base(-1, false, TargetFlags.None) => _list = list;
protected override void OnTarget(Mobile from, object targeted)
{
var type = targeted.GetType();
if (!Add.IsEntity(type))
if (!IsEntity(type))
{
from.SendMessage("No type with that name was found.");
}