Code cleanup (#188)

This commit is contained in:
Kamron Batman 2020-08-01 08:40:06 -07:00 • committed by GitHub
parent df53c16620
commit 010fd9402a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
185 changed files with 1052 additions and 1271 deletions

View file

@ -1,9 +1,9 @@
using System;
using System.Collections;
using System.Collections.Generic;
namespace Server.Engines.Craft
{
public class CraftSubResCol : CollectionBase
public class CraftSubResCol : List<CraftSubRes>
{
public CraftSubResCol() => Init = false;
@ -15,33 +15,17 @@ namespace Server.Engines.Craft
public int NameNumber { get; set; }
public void Add(CraftSubRes craftSubRes)
{
List.Add(craftSubRes);
}
public void Remove(int index)
{
if (index > Count - 1 || index < 0)
{
}
else
{
List.RemoveAt(index);
}
}
public CraftSubRes GetAt(int index) => (CraftSubRes)List[index];
public CraftSubRes GetAt(int index) => this[index];
public CraftSubRes SearchFor(Type type)
{
for (int i = 0; i < List.Count; i++)
for (int i = 0; i < Count; i++)
{
CraftSubRes craftSubRes = (CraftSubRes)List[i];
CraftSubRes craftSubRes = this[i];
if (craftSubRes.ItemType == type) return craftSubRes;
}
return null;
}
}
}
}