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

@ -10,6 +10,8 @@ using Server.Mobiles;
using Server.Utilities;
using CPA = Server.CommandPropertyAttribute;
using static Server.Attributes;
namespace Server.Engines.Spawners
{
public abstract class BaseSpawner : Item, ISpawner
@ -529,7 +531,7 @@ namespace Server.Engines.Spawners
return null;
}
var attr = Properties.GetCPA(thisProp);
var attr = GetCPA(thisProp);
if (attr == null || attr.WriteLevel > AccessLevel.Developer || !thisProp.CanWrite || attr.ReadOnly)
{
@ -600,7 +602,7 @@ namespace Server.Engines.Spawners
if (paramargs.Length == 0)
{
entity = type.CreateInstance<IEntity>(
ci => Add.IsConstructible(ci, AccessLevel.Developer)
ci => IsConstructible(ci, AccessLevel.Developer)
);
}
else
@ -611,7 +613,7 @@ namespace Server.Engines.Spawners
{
var ctor = ctors[i];
if (Add.IsConstructible(ctor, AccessLevel.Developer))
if (IsConstructible(ctor, AccessLevel.Developer))
{
var paramList = ctor.GetParameters();