From c546b2ec7035ac7fb6f96d420675af820f52c388 Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Wed, 23 Nov 2022 13:04:30 -0800 Subject: [PATCH] fix: Codegens potted plants (#1270) --- .../Items/PlantsFlowers/Potted/EmptyPots.cs | 63 ++---- .../PlantsFlowers/Potted/PottedCactus.cs | 187 ++++-------------- .../PlantsFlowers/Potted/PottedPlants.cs | 94 +++------ .../Items/PlantsFlowers/Potted/PottedTrees.cs | 63 ++---- .../Server.Items.LargeEmptyPot.v0.json | 4 + .../Server.Items.PottedCactus.v0.json | 4 + .../Server.Items.PottedCactus1.v0.json | 4 + .../Server.Items.PottedCactus2.v0.json | 4 + .../Server.Items.PottedCactus3.v0.json | 4 + .../Server.Items.PottedCactus4.v0.json | 4 + .../Server.Items.PottedCactus5.v0.json | 4 + .../Server.Items.PottedPlant.v0.json | 4 + .../Server.Items.PottedPlant1.v0.json | 4 + .../Server.Items.PottedPlant2.v0.json | 4 + .../Server.Items.PottedTree.v0.json | 4 + .../Server.Items.PottedTree1.v0.json | 4 + .../Server.Items.SmallEmptyPot.v0.json | 4 + 17 files changed, 147 insertions(+), 312 deletions(-) create mode 100644 Projects/UOContent/Migrations/Server.Items.LargeEmptyPot.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.PottedCactus.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.PottedCactus1.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.PottedCactus2.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.PottedCactus3.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.PottedCactus4.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.PottedCactus5.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.PottedPlant.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.PottedPlant1.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.PottedPlant2.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.PottedTree.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.PottedTree1.v0.json create mode 100644 Projects/UOContent/Migrations/Server.Items.SmallEmptyPot.v0.json diff --git a/Projects/UOContent/Items/PlantsFlowers/Potted/EmptyPots.cs b/Projects/UOContent/Items/PlantsFlowers/Potted/EmptyPots.cs index 739317fb9..14a6c6e87 100644 --- a/Projects/UOContent/Items/PlantsFlowers/Potted/EmptyPots.cs +++ b/Projects/UOContent/Items/PlantsFlowers/Potted/EmptyPots.cs @@ -1,50 +1,17 @@ -namespace Server.Items +using ModernUO.Serialization; + +namespace Server.Items; + +[SerializationGenerator(0, false)] +public partial class SmallEmptyPot : Item { - public class SmallEmptyPot : Item - { - [Constructible] - public SmallEmptyPot() : base(0x11C6) => Weight = 100; - - public SmallEmptyPot(Serial serial) : base(serial) - { - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - } - } - - public class LargeEmptyPot : Item - { - [Constructible] - public LargeEmptyPot() : base(0x11C7) => Weight = 6; - - public LargeEmptyPot(Serial serial) : base(serial) - { - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - } - } + [Constructible] + public SmallEmptyPot() : base(0x11C6) => Weight = 100; +} + +[SerializationGenerator(0, false)] +public partial class LargeEmptyPot : Item +{ + [Constructible] + public LargeEmptyPot() : base(0x11C7) => Weight = 6; } diff --git a/Projects/UOContent/Items/PlantsFlowers/Potted/PottedCactus.cs b/Projects/UOContent/Items/PlantsFlowers/Potted/PottedCactus.cs index 96ffaa2f2..4c0f9c91e 100644 --- a/Projects/UOContent/Items/PlantsFlowers/Potted/PottedCactus.cs +++ b/Projects/UOContent/Items/PlantsFlowers/Potted/PottedCactus.cs @@ -1,146 +1,45 @@ -namespace Server.Items +using ModernUO.Serialization; + +namespace Server.Items; + +[SerializationGenerator(0, false)] +public partial class PottedCactus : Item { - public class PottedCactus : Item - { - [Constructible] - public PottedCactus() : base(0x1E0F) => Weight = 100; - - public PottedCactus(Serial serial) : base(serial) - { - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - } - } - - public class PottedCactus1 : Item - { - [Constructible] - public PottedCactus1() : base(0x1E10) => Weight = 100; - - public PottedCactus1(Serial serial) : base(serial) - { - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - } - } - - public class PottedCactus2 : Item - { - [Constructible] - public PottedCactus2() : base(0x1E11) => Weight = 100; - - public PottedCactus2(Serial serial) : base(serial) - { - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - } - } - - public class PottedCactus3 : Item - { - [Constructible] - public PottedCactus3() : base(0x1E12) => Weight = 100; - - public PottedCactus3(Serial serial) : base(serial) - { - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - } - } - - public class PottedCactus4 : Item - { - [Constructible] - public PottedCactus4() : base(0x1E13) => Weight = 100; - - public PottedCactus4(Serial serial) : base(serial) - { - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - } - } - - public class PottedCactus5 : Item - { - [Constructible] - public PottedCactus5() : base(0x1E14) => Weight = 100; - - public PottedCactus5(Serial serial) : base(serial) - { - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - } - } + [Constructible] + public PottedCactus() : base(0x1E0F) => Weight = 100; +} + +[SerializationGenerator(0, false)] +public partial class PottedCactus1 : Item +{ + [Constructible] + public PottedCactus1() : base(0x1E10) => Weight = 100; +} + +[SerializationGenerator(0, false)] +public partial class PottedCactus2 : Item +{ + [Constructible] + public PottedCactus2() : base(0x1E11) => Weight = 100; +} + +[SerializationGenerator(0, false)] +public partial class PottedCactus3 : Item +{ + [Constructible] + public PottedCactus3() : base(0x1E12) => Weight = 100; +} + +[SerializationGenerator(0, false)] +public partial class PottedCactus4 : Item +{ + [Constructible] + public PottedCactus4() : base(0x1E13) => Weight = 100; +} + +[SerializationGenerator(0, false)] +public partial class PottedCactus5 : Item +{ + [Constructible] + public PottedCactus5() : base(0x1E14) => Weight = 100; } diff --git a/Projects/UOContent/Items/PlantsFlowers/Potted/PottedPlants.cs b/Projects/UOContent/Items/PlantsFlowers/Potted/PottedPlants.cs index 88830bbfb..b6d98773d 100644 --- a/Projects/UOContent/Items/PlantsFlowers/Potted/PottedPlants.cs +++ b/Projects/UOContent/Items/PlantsFlowers/Potted/PottedPlants.cs @@ -1,74 +1,24 @@ -namespace Server.Items +using ModernUO.Serialization; + +namespace Server.Items; + +[SerializationGenerator(0, false)] +public partial class PottedPlant : Item { - public class PottedPlant : Item - { - [Constructible] - public PottedPlant() : base(0x11CA) => Weight = 100; - - public PottedPlant(Serial serial) : base(serial) - { - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - } - } - - public class PottedPlant1 : Item - { - [Constructible] - public PottedPlant1() : base(0x11CB) => Weight = 100; - - public PottedPlant1(Serial serial) : base(serial) - { - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - } - } - - public class PottedPlant2 : Item - { - [Constructible] - public PottedPlant2() : base(0x11CC) => Weight = 100; - - public PottedPlant2(Serial serial) : base(serial) - { - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - } - } + [Constructible] + public PottedPlant() : base(0x11CA) => Weight = 100; +} + +[SerializationGenerator(0, false)] +public partial class PottedPlant1 : Item +{ + [Constructible] + public PottedPlant1() : base(0x11CB) => Weight = 100; +} + +[SerializationGenerator(0, false)] +public partial class PottedPlant2 : Item +{ + [Constructible] + public PottedPlant2() : base(0x11CC) => Weight = 100; } diff --git a/Projects/UOContent/Items/PlantsFlowers/Potted/PottedTrees.cs b/Projects/UOContent/Items/PlantsFlowers/Potted/PottedTrees.cs index 1e37c2e92..b04240614 100644 --- a/Projects/UOContent/Items/PlantsFlowers/Potted/PottedTrees.cs +++ b/Projects/UOContent/Items/PlantsFlowers/Potted/PottedTrees.cs @@ -1,50 +1,17 @@ -namespace Server.Items +using ModernUO.Serialization; + +namespace Server.Items; + +[SerializationGenerator(0, false)] +public partial class PottedTree : Item { - public class PottedTree : Item - { - [Constructible] - public PottedTree() : base(0x11C8) => Weight = 100; - - public PottedTree(Serial serial) : base(serial) - { - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - } - } - - public class PottedTree1 : Item - { - [Constructible] - public PottedTree1() : base(0x11C9) => Weight = 100; - - public PottedTree1(Serial serial) : base(serial) - { - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - } - } + [Constructible] + public PottedTree() : base(0x11C8) => Weight = 100; +} + +[SerializationGenerator(0, false)] +public partial class PottedTree1 : Item +{ + [Constructible] + public PottedTree1() : base(0x11C9) => Weight = 100; } diff --git a/Projects/UOContent/Migrations/Server.Items.LargeEmptyPot.v0.json b/Projects/UOContent/Migrations/Server.Items.LargeEmptyPot.v0.json new file mode 100644 index 000000000..1e9570925 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.LargeEmptyPot.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.LargeEmptyPot" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.PottedCactus.v0.json b/Projects/UOContent/Migrations/Server.Items.PottedCactus.v0.json new file mode 100644 index 000000000..1d2b53e53 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.PottedCactus.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.PottedCactus" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.PottedCactus1.v0.json b/Projects/UOContent/Migrations/Server.Items.PottedCactus1.v0.json new file mode 100644 index 000000000..b4f08b39a --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.PottedCactus1.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.PottedCactus1" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.PottedCactus2.v0.json b/Projects/UOContent/Migrations/Server.Items.PottedCactus2.v0.json new file mode 100644 index 000000000..4f5719ac3 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.PottedCactus2.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.PottedCactus2" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.PottedCactus3.v0.json b/Projects/UOContent/Migrations/Server.Items.PottedCactus3.v0.json new file mode 100644 index 000000000..208c5e35d --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.PottedCactus3.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.PottedCactus3" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.PottedCactus4.v0.json b/Projects/UOContent/Migrations/Server.Items.PottedCactus4.v0.json new file mode 100644 index 000000000..a2ef6683b --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.PottedCactus4.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.PottedCactus4" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.PottedCactus5.v0.json b/Projects/UOContent/Migrations/Server.Items.PottedCactus5.v0.json new file mode 100644 index 000000000..4bfffc982 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.PottedCactus5.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.PottedCactus5" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.PottedPlant.v0.json b/Projects/UOContent/Migrations/Server.Items.PottedPlant.v0.json new file mode 100644 index 000000000..d519748e9 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.PottedPlant.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.PottedPlant" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.PottedPlant1.v0.json b/Projects/UOContent/Migrations/Server.Items.PottedPlant1.v0.json new file mode 100644 index 000000000..38019b1de --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.PottedPlant1.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.PottedPlant1" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.PottedPlant2.v0.json b/Projects/UOContent/Migrations/Server.Items.PottedPlant2.v0.json new file mode 100644 index 000000000..834890149 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.PottedPlant2.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.PottedPlant2" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.PottedTree.v0.json b/Projects/UOContent/Migrations/Server.Items.PottedTree.v0.json new file mode 100644 index 000000000..c126b2589 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.PottedTree.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.PottedTree" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.PottedTree1.v0.json b/Projects/UOContent/Migrations/Server.Items.PottedTree1.v0.json new file mode 100644 index 000000000..410e132a7 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.PottedTree1.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.PottedTree1" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.SmallEmptyPot.v0.json b/Projects/UOContent/Migrations/Server.Items.SmallEmptyPot.v0.json new file mode 100644 index 000000000..37e32d6bb --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.SmallEmptyPot.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.SmallEmptyPot" +} \ No newline at end of file