Changes properties to use automatic property initializers

This commit is contained in:
Kamron Batman 2018-09-14 15:23:29 -07:00
parent f0a48ad431
commit 06fa31a7bf
623 changed files with 13072 additions and 19304 deletions

View file

@ -4,29 +4,25 @@ namespace Server.Engines.VeteranRewards
{
public class RewardEntry
{
private RewardList m_List;
private RewardCategory m_Category;
private Type m_ItemType;
private Expansion m_RequiredExpansion;
private int m_Name;
private string m_NameString;
private object[] m_Args;
public RewardList List { get; set; }
public RewardList List{ get => m_List;
set => m_List = value;
}
public RewardCategory Category => m_Category;
public Type ItemType => m_ItemType;
public Expansion RequiredExpansion => m_RequiredExpansion;
public int Name => m_Name;
public string NameString => m_NameString;
public object[] Args => m_Args;
public RewardCategory Category { get; }
public Type ItemType { get; }
public Expansion RequiredExpansion { get; }
public int Name { get; }
public string NameString { get; }
public object[] Args { get; }
public Item Construct()
{
try
{
Item item = Activator.CreateInstance( m_ItemType, m_Args ) as Item;
Item item = Activator.CreateInstance( ItemType, Args ) as Item;
if ( item is IRewardItem rewardItem )
rewardItem.IsRewardItem = true;
@ -42,41 +38,41 @@ namespace Server.Engines.VeteranRewards
public RewardEntry( RewardCategory category, int name, Type itemType, params object[] args )
{
m_Category = category;
m_ItemType = itemType;
m_RequiredExpansion = Expansion.None;
m_Name = name;
m_Args = args;
Category = category;
ItemType = itemType;
RequiredExpansion = Expansion.None;
Name = name;
Args = args;
category.Entries.Add( this );
}
public RewardEntry( RewardCategory category, string name, Type itemType, params object[] args )
{
m_Category = category;
m_ItemType = itemType;
m_RequiredExpansion = Expansion.None;
m_NameString = name;
m_Args = args;
Category = category;
ItemType = itemType;
RequiredExpansion = Expansion.None;
NameString = name;
Args = args;
category.Entries.Add( this );
}
public RewardEntry( RewardCategory category, int name, Type itemType, Expansion requiredExpansion, params object[] args )
{
m_Category = category;
m_ItemType = itemType;
m_RequiredExpansion = requiredExpansion;
m_Name = name;
m_Args = args;
Category = category;
ItemType = itemType;
RequiredExpansion = requiredExpansion;
Name = name;
Args = args;
category.Entries.Add( this );
}
public RewardEntry( RewardCategory category, string name, Type itemType, Expansion requiredExpansion, params object[] args )
{
m_Category = category;
m_ItemType = itemType;
m_RequiredExpansion = requiredExpansion;
m_NameString = name;
m_Args = args;
Category = category;
ItemType = itemType;
RequiredExpansion = requiredExpansion;
NameString = name;
Args = args;
category.Entries.Add( this );
}
}