ModernUO/Projects/UOContent/Holiday Stuff/Halloween/2011/Items/BasePaintedMask.cs
Kamron Batman f2d44e0283
fix(codegen): Reverts & Disables codegen (for now) (#625)
After speaking with the C# devs, it is clear that code gen is not ready.
I can get around this by doing the following:
1. Creating a library
2. Splitting out the schema writing from the source generator
3. Moving the schema loading to `AdditionalFiles`
4. Writing a new post-build application using Roslyn to write the schema files after building.
2021-05-27 19:50:22 -07:00

60 lines
1.5 KiB
C#

// using System.Collections.Generic;
namespace Server.Items.Holiday
{
[TypeAlias("Server.Items.ClownMask", "Server.Items.DaemonMask", "Server.Items.PlagueMask")]
public class BasePaintedMask : Item
{
private static readonly string[] m_Staffers =
{
"Ryan",
"Mark",
"Krrios",
"Zippy",
"Athena",
"Eos",
"Xavier"
};
private string m_Staffer;
public BasePaintedMask(int itemid) : this(m_Staffers.RandomElement(), itemid)
{
}
public BasePaintedMask(string staffer, int itemid) : base(itemid + Utility.Random(2))
{
m_Staffer = staffer;
Utility.Intern(m_Staffer);
}
public BasePaintedMask(Serial serial) : base(serial)
{
}
public override string DefaultName => m_Staffer != null ? $"{MaskName} hand painted by {m_Staffer}" : MaskName;
public virtual string MaskName => "A Mask";
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(1); // version
writer.Write(m_Staffer);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
if (version == 1)
{
m_Staffer = Utility.Intern(reader.ReadString());
}
}
}
}