fix: Optimizes TextDefinition to eliminate allocations. Removes TextDefinition ctor. (#1221)

### BREAKING CHANGE ###
The constructor for `TextDefinition` has been removed. Instead use `TextDefinition.Of()` or cast the integer/string to TextDefinition.
This commit is contained in:
Kamron Batman 2022-10-30 16:53:23 -07:00 • committed by GitHub
parent 213b7025af
commit 910e06767b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 790 additions and 722 deletions

View file

@ -122,11 +122,11 @@ public partial class SoulstoneFragmentToken : PromotionalToken
{
}
public override TextDefinition ItemGumpName => 1070999; // <center>Soulstone Fragment</center>
public override TextDefinition ItemName => 1071000; // soulstone fragment
public override TextDefinition ItemGumpName { get; } = 1070999; // <center>Soulstone Fragment</center>
public override TextDefinition ItemName { get; } = 1071000; // soulstone fragment
// A soulstone fragment has been created in your bank box.
public override TextDefinition ItemReceiveMessage => 1070976;
public override TextDefinition ItemReceiveMessage { get; } = 1070976;
public override Item CreateItemFor(Mobile from) =>
from?.Account != null ? new SoulstoneFragment(from.Account.ToString()) : null;