Changes properties to use automatic property initializers
This commit is contained in:
parent
f0a48ad431
commit
06fa31a7bf
623 changed files with 13072 additions and 19304 deletions
|
|
@ -11,44 +11,32 @@ namespace Server.Engines.Craft
|
|||
|
||||
public class CraftContext
|
||||
{
|
||||
private List<CraftItem> m_Items;
|
||||
private int m_LastResourceIndex;
|
||||
private int m_LastResourceIndex2;
|
||||
private int m_LastGroupIndex;
|
||||
private bool m_DoNotColor;
|
||||
private CraftMarkOption m_MarkOption;
|
||||
public List<CraftItem> Items { get; }
|
||||
|
||||
public List<CraftItem> Items => m_Items;
|
||||
public int LastResourceIndex{ get => m_LastResourceIndex;
|
||||
set => m_LastResourceIndex = value;
|
||||
}
|
||||
public int LastResourceIndex2{ get => m_LastResourceIndex2;
|
||||
set => m_LastResourceIndex2 = value;
|
||||
}
|
||||
public int LastGroupIndex{ get => m_LastGroupIndex;
|
||||
set => m_LastGroupIndex = value;
|
||||
}
|
||||
public bool DoNotColor{ get => m_DoNotColor;
|
||||
set => m_DoNotColor = value;
|
||||
}
|
||||
public CraftMarkOption MarkOption{ get => m_MarkOption;
|
||||
set => m_MarkOption = value;
|
||||
}
|
||||
public int LastResourceIndex { get; set; }
|
||||
|
||||
public int LastResourceIndex2 { get; set; }
|
||||
|
||||
public int LastGroupIndex { get; set; }
|
||||
|
||||
public bool DoNotColor { get; set; }
|
||||
|
||||
public CraftMarkOption MarkOption { get; set; }
|
||||
|
||||
public CraftContext()
|
||||
{
|
||||
m_Items = new List<CraftItem>();
|
||||
m_LastResourceIndex = -1;
|
||||
m_LastResourceIndex2 = -1;
|
||||
m_LastGroupIndex = -1;
|
||||
Items = new List<CraftItem>();
|
||||
LastResourceIndex = -1;
|
||||
LastResourceIndex2 = -1;
|
||||
LastGroupIndex = -1;
|
||||
}
|
||||
|
||||
public CraftItem LastMade
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( m_Items.Count > 0 )
|
||||
return m_Items[0];
|
||||
if ( Items.Count > 0 )
|
||||
return Items[0];
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
@ -56,12 +44,12 @@ namespace Server.Engines.Craft
|
|||
|
||||
public void OnMade( CraftItem item )
|
||||
{
|
||||
m_Items.Remove( item );
|
||||
Items.Remove( item );
|
||||
|
||||
if ( m_Items.Count == 10 )
|
||||
m_Items.RemoveAt( 9 );
|
||||
if ( Items.Count == 10 )
|
||||
Items.RemoveAt( 9 );
|
||||
|
||||
m_Items.Insert( 0, item );
|
||||
Items.Insert( 0, item );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue