ModernUO/Projects/UOContent/Engines/Plants/PlantResources.cs
Kamron Batman 26dfde19ee
fix: Consolidates Color/Center html (#1762)
### Summary
- Fixes bad color in virtual check gump
- Consolidates the Color/Center html strings for all gumps
2024-05-07 23:56:32 -07:00

49 lines
1.7 KiB
C#

using System;
using Server.Items;
namespace Server.Engines.Plants
{
public class PlantResourceInfo
{
private static readonly PlantResourceInfo[] m_ResourceList =
{
new(PlantType.ElephantEarPlant, PlantHue.BrightRed, typeof(RedLeaves)),
new(PlantType.PonytailPalm, PlantHue.BrightRed, typeof(RedLeaves)),
new(PlantType.CenturyPlant, PlantHue.BrightRed, typeof(RedLeaves)),
new(PlantType.Poppies, PlantHue.BrightOrange, typeof(OrangePetals)),
new(PlantType.Bulrushes, PlantHue.BrightOrange, typeof(OrangePetals)),
new(PlantType.PampasGrass, PlantHue.BrightOrange, typeof(OrangePetals)),
new(PlantType.SnakePlant, PlantHue.BrightGreen, typeof(GreenThorns)),
new(PlantType.BarrelCactus, PlantHue.BrightGreen, typeof(GreenThorns)),
new(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 (var info in m_ResourceList)
{
if (info.PlantType == plantType && info.PlantHue == plantHue)
{
return info;
}
}
return null;
}
public Item CreateResource() => ResourceType.CreateInstance<Item>();
}
}