Clean up: Bugs, LINQ, constructors, default values, and null checks (#18)

This commit is contained in:
Kamron Batman 2019-03-11 14:29:59 -07:00 • committed by GitHub
parent e748af4430
commit 513e54f70e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1094 changed files with 15913 additions and 21892 deletions

View file

@ -9,12 +9,12 @@ namespace Server.Engines.Plants
private bool m_ShowType;
[Constructible]
public Seed() : this(PlantTypeInfo.RandomFirstGeneration(), PlantHueInfo.RandomFirstGeneration(), false)
public Seed() : this(PlantTypeInfo.RandomFirstGeneration(), PlantHueInfo.RandomFirstGeneration())
{
}
[Constructible]
public Seed(PlantType plantType, PlantHue plantHue, bool showType) : base(0xDCF)
public Seed(PlantType plantType, PlantHue plantHue, bool showType = false) : base(0xDCF)
{
Weight = 1.0;
Stackable = Core.SA;
@ -75,17 +75,17 @@ namespace Server.Engines.Plants
public static Seed RandomBonsaiSeed(double increaseRatio)
{
return new Seed(PlantTypeInfo.RandomBonsai(increaseRatio), PlantHue.Plain, false);
return new Seed(PlantTypeInfo.RandomBonsai(increaseRatio), PlantHue.Plain);
}
public static Seed RandomPeculiarSeed(int group)
{
switch (group)
{
case 1: return new Seed(PlantTypeInfo.RandomPeculiarGroupOne(), PlantHue.Plain, false);
case 2: return new Seed(PlantTypeInfo.RandomPeculiarGroupTwo(), PlantHue.Plain, false);
case 3: return new Seed(PlantTypeInfo.RandomPeculiarGroupThree(), PlantHue.Plain, false);
default: return new Seed(PlantTypeInfo.RandomPeculiarGroupFour(), PlantHue.Plain, false);
case 1: return new Seed(PlantTypeInfo.RandomPeculiarGroupOne(), PlantHue.Plain);
case 2: return new Seed(PlantTypeInfo.RandomPeculiarGroupTwo(), PlantHue.Plain);
case 3: return new Seed(PlantTypeInfo.RandomPeculiarGroupThree(), PlantHue.Plain);
default: return new Seed(PlantTypeInfo.RandomPeculiarGroupFour(), PlantHue.Plain);
}
}
@ -125,14 +125,12 @@ namespace Server.Engines.Plants
public override void AddNameProperty(ObjectPropertyList list)
{
string args;
list.Add(GetLabel(out args), args);
list.Add(GetLabel(out string args), args);
}
public override void OnSingleClick(Mobile from)
{
string args;
LabelTo(from, GetLabel(out args), args);
LabelTo(from, GetLabel(out string args), args);
}
public override void OnDoubleClick(Mobile from)
@ -224,4 +222,4 @@ namespace Server.Engines.Plants
}
}
}
}
}