Reorganizes Project (#41)

This commit is contained in:
Kamron Batman 2019-08-02 18:13:40 -07:00 • committed by GitHub
parent 08bf44af9a
commit 3614a66aee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3499 changed files with 79 additions and 55 deletions

View file

@ -0,0 +1,48 @@
using System;
using Server.Items;
namespace Server.Engines.Plants
{
public class PlantResourceInfo
{
private static PlantResourceInfo[] m_ResourceList =
{
new PlantResourceInfo(PlantType.ElephantEarPlant, PlantHue.BrightRed, typeof(RedLeaves)),
new PlantResourceInfo(PlantType.PonytailPalm, PlantHue.BrightRed, typeof(RedLeaves)),
new PlantResourceInfo(PlantType.CenturyPlant, PlantHue.BrightRed, typeof(RedLeaves)),
new PlantResourceInfo(PlantType.Poppies, PlantHue.BrightOrange, typeof(OrangePetals)),
new PlantResourceInfo(PlantType.Bulrushes, PlantHue.BrightOrange, typeof(OrangePetals)),
new PlantResourceInfo(PlantType.PampasGrass, PlantHue.BrightOrange, typeof(OrangePetals)),
new PlantResourceInfo(PlantType.SnakePlant, PlantHue.BrightGreen, typeof(GreenThorns)),
new PlantResourceInfo(PlantType.BarrelCactus, PlantHue.BrightGreen, typeof(GreenThorns)),
new PlantResourceInfo(PlantType.CocoaTree, PlantHue.Plain, typeof(CocoaPulp))
};
private PlantResourceInfo(PlantType plantType, PlantHue plantHue, Type resourceType)
{
PlantType = plantType;
PlantHue = plantHue;
ResourceType = resourceType;
}
public PlantType PlantType{ get; }
public PlantHue PlantHue{ get; }
public Type ResourceType{ get; }
public static PlantResourceInfo GetInfo(PlantType plantType, PlantHue plantHue)
{
foreach (PlantResourceInfo info in m_ResourceList)
if (info.PlantType == plantType && info.PlantHue == plantHue)
return info;
return null;
}
public Item CreateResource()
{
return (Item)Activator.CreateInstance(ResourceType);
}
}
}