#W# Initial Commit: Avatars Conquest
This commit is contained in:
commit
8eae46895e
7512 changed files with 416187 additions and 0 deletions
56
Scripts/Engines/Craft/Core/CraftContext.cs
Normal file
56
Scripts/Engines/Craft/Core/CraftContext.cs
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public enum CraftMarkOption
|
||||
{
|
||||
MarkItem,
|
||||
DoNotMark,
|
||||
PromptForMark
|
||||
}
|
||||
|
||||
public class CraftContext
|
||||
{
|
||||
private List<CraftItem> m_Items;
|
||||
private int m_LastResourceIndex;
|
||||
private int m_LastGroupIndex;
|
||||
private bool m_DoNotColor;
|
||||
private CraftMarkOption m_MarkOption;
|
||||
|
||||
public List<CraftItem> Items { get { return m_Items; } }
|
||||
public int LastResourceIndex{ get{ return m_LastResourceIndex; } set{ m_LastResourceIndex = value; } }
|
||||
public int LastGroupIndex{ get{ return m_LastGroupIndex; } set{ m_LastGroupIndex = value; } }
|
||||
public bool DoNotColor{ get{ return m_DoNotColor; } set{ m_DoNotColor = value; } }
|
||||
public CraftMarkOption MarkOption{ get{ return m_MarkOption; } set{ m_MarkOption = value; } }
|
||||
|
||||
public CraftContext()
|
||||
{
|
||||
m_Items = new List<CraftItem>();
|
||||
m_LastResourceIndex = -1;
|
||||
m_LastGroupIndex = -1;
|
||||
}
|
||||
|
||||
public CraftItem LastMade
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( m_Items.Count > 0 )
|
||||
return m_Items[0];
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnMade( CraftItem item )
|
||||
{
|
||||
m_Items.Remove( item );
|
||||
|
||||
if ( m_Items.Count == 10 )
|
||||
m_Items.RemoveAt( 9 );
|
||||
|
||||
m_Items.Insert( 0, item );
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue