Files
abysmal-isle/Scripts/Services/Craft/Core/CraftItemCol.cs
Unstable Kitsune b918192e4e Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
2023-11-28 23:20:26 -05:00

58 lines
1.3 KiB
C#

using System;
namespace Server.Engines.Craft
{
public class CraftItemCol : System.Collections.CollectionBase
{
public CraftItemCol()
{
}
public int Add(CraftItem craftItem)
{
return this.List.Add(craftItem);
}
public void Remove(int index)
{
if (index > this.Count - 1 || index < 0)
{
}
else
{
this.List.RemoveAt(index);
}
}
public CraftItem GetAt(int index)
{
return (CraftItem)this.List[index];
}
public CraftItem SearchForSubclass(Type type)
{
for (int i = 0; i < this.List.Count; i++)
{
CraftItem craftItem = (CraftItem)this.List[i];
if (craftItem.ItemType == type || type.IsSubclassOf(craftItem.ItemType))
return craftItem;
}
return null;
}
public CraftItem SearchFor(Type type)
{
for (int i = 0; i < this.List.Count; i++)
{
CraftItem craftItem = (CraftItem)this.List[i];
if (craftItem.ItemType == type)
{
return craftItem;
}
}
return null;
}
}
}