Fixes code according to modern code style. Fixes a few expression bugs.
This commit is contained in:
parent
89eea25e5f
commit
970fd563b2
3324 changed files with 441118 additions and 433755 deletions
|
|
@ -3,47 +3,46 @@ 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 ) )
|
||||
};
|
||||
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))
|
||||
};
|
||||
|
||||
public static PlantResourceInfo GetInfo( PlantType plantType, PlantHue plantHue )
|
||||
{
|
||||
foreach ( PlantResourceInfo info in m_ResourceList )
|
||||
{
|
||||
if ( info.PlantType == plantType && info.PlantHue == plantHue )
|
||||
return info;
|
||||
}
|
||||
private PlantResourceInfo(PlantType plantType, PlantHue plantHue, Type resourceType)
|
||||
{
|
||||
PlantType = plantType;
|
||||
PlantHue = plantHue;
|
||||
ResourceType = resourceType;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
public PlantType PlantType{ get; }
|
||||
|
||||
public PlantType PlantType { get; }
|
||||
public PlantHue PlantHue{ get; }
|
||||
|
||||
public PlantHue PlantHue { get; }
|
||||
public Type ResourceType{ 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;
|
||||
|
||||
private PlantResourceInfo( PlantType plantType, PlantHue plantHue, Type resourceType )
|
||||
{
|
||||
PlantType = plantType;
|
||||
PlantHue = plantHue;
|
||||
ResourceType = resourceType;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Item CreateResource()
|
||||
{
|
||||
return (Item)Activator.CreateInstance( ResourceType );
|
||||
}
|
||||
}
|
||||
}
|
||||
public Item CreateResource()
|
||||
{
|
||||
return (Item)Activator.CreateInstance(ResourceType);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue