ModernUO/Projects/UOContent/Items
Kamron Batman ecbee17690
fix: Optimizes OPL using string interpolation (#1041)
## Breaking Changes (New API)
ObjectPropertyList supports the following API:
```cs
list.Add(500000);
list.Add(500001, stringArgument);
list.Add("Some text");
list.Add($"Some text with {argument}");
list.Add(500002, $"{arg1}\t{arg2}");
```

## Notes
1. All API uses that require a formatter like this:
    ```cs
    list.Add(500002, "{0}\t{1}", arg1, arg2);
    ```
    Should be changed to use string interpolation, for example:
    ```cs
    list.Add(500002, $"{arg1}\t{arg2}");
    ```
2. The following paradigm should no longer be used:
    ```cs
    list.Add(1061170, prop.ToString()); // strength requirement ~1_val~
    ```
    The new string interpolation API will avoid having to convert the argument to a string before writing it to the packet. Instead use the following:
    ```cs
    list.Add(1061170, $"{prop}"); // strength requirement ~1_val~
    ```

### Benchmarks
```cs
|                         Method |     Mean |   Error |  StdDev |  Gen 0 | Allocated |
|------------------------------- |---------:|--------:|--------:|-------:|----------:|
|                BenchmarkOldOPL | 241.0 ns | 0.56 ns | 0.47 ns | 0.0105 |      88 B |
| BenchmarkStringInterpolatedOPL | 199.9 ns | 2.44 ns | 2.39 ns |      - |         - |
```

### Changes
- [X] Removes crash in STArray.Return when array is null.
- [X] Fixes NPE in OPL when entity is null. Serial in packet will be 0 when entity is null.
- [X] Fixes NPE in AosAttributes when Parent is null.
- [X] Changes OPL to use string interpolation.
- [X] Introduces `IPropertyList` to allow extending PropertyList for other uses.
2022-06-02 10:09:53 -07:00
..
Addons fix: Optimizes OPL using string interpolation (#1041) 2022-06-02 10:09:53 -07:00
Aquarium fix: Optimizes OPL using string interpolation (#1041) 2022-06-02 10:09:53 -07:00
Armor fix: Optimizes OPL using string interpolation (#1041) 2022-06-02 10:09:53 -07:00
Body Parts fix: Fixes missing invalidate properties for default name (#1012) 2022-05-04 14:40:49 -07:00
Books fix: Optimizes OPL using string interpolation (#1041) 2022-06-02 10:09:53 -07:00
Bulletin Boards fix: Updates serialization to use v2.0 (#998) 2022-04-17 08:02:15 -07:00
Champion Artifacts fix: Updates serialization to use v2.0 (#998) 2022-04-17 08:02:15 -07:00
Clothing fix: Optimizes OPL using string interpolation (#1041) 2022-06-02 10:09:53 -07:00
Construction fix: Optimizes OPL using string interpolation (#1041) 2022-06-02 10:09:53 -07:00
Containers fix: Optimizes OPL using string interpolation (#1041) 2022-06-02 10:09:53 -07:00
Decoration Artifacts fix: Optimizes OPL using string interpolation (#1041) 2022-06-02 10:09:53 -07:00
Deeds fix: Optimizes OPL using string interpolation (#1041) 2022-06-02 10:09:53 -07:00
Facial Formats UO Content (#201) 2020-08-27 18:30:38 -07:00
Farming fix: Codegens farmables (#1001) 2022-04-17 17:10:45 -07:00
Food fix: Optimizes OPL using string interpolation (#1041) 2022-06-02 10:09:53 -07:00
Games fix: Optimizes OPL using string interpolation (#1041) 2022-06-02 10:09:53 -07:00
Gems Formats UO Content (#201) 2020-08-27 18:30:38 -07:00
Guilds fix: Optimizes OPL using string interpolation (#1041) 2022-06-02 10:09:53 -07:00
Jewels fix: Optimizes OPL using string interpolation (#1041) 2022-06-02 10:09:53 -07:00
Lights fix: Optimizes OPL using string interpolation (#1041) 2022-06-02 10:09:53 -07:00
Maps fix: Optimizes OPL using string interpolation (#1041) 2022-06-02 10:09:53 -07:00
Minor Artifacts fix: Fixes quiver damage type modifier (#792) 2021-09-18 11:28:42 -07:00
Misc fix: Optimizes OPL using string interpolation (#1041) 2022-06-02 10:09:53 -07:00
New Haven Quest Rewards Removes literal variables (#257) 2020-09-18 18:41:26 -07:00
PlantsFlowers/Potted Formats UO Content (#201) 2020-08-27 18:30:38 -07:00
Quivers fix: Optimizes OPL using string interpolation (#1041) 2022-06-02 10:09:53 -07:00
Resources fix: Optimizes OPL using string interpolation (#1041) 2022-06-02 10:09:53 -07:00
Shields fix: Updates serialization to use v2.0 (#998) 2022-04-17 08:02:15 -07:00
Skill Items fix: Optimizes OPL using string interpolation (#1041) 2022-06-02 10:09:53 -07:00
Special fix: Optimizes OPL using string interpolation (#1041) 2022-06-02 10:09:53 -07:00
Suits chore: Cleans up pattern checks. (#892) 2021-12-24 15:53:59 -08:00
Talismans fix: Optimizes OPL using string interpolation (#1041) 2022-06-02 10:09:53 -07:00
Traps fix: Adds Poison to codegen (#1002) 2022-04-18 00:05:44 -07:00
TreasureChests fix: Updates serialization to use v2.0 (#998) 2022-04-17 08:02:15 -07:00
Wands fix: Optimizes OPL using string interpolation (#1041) 2022-06-02 10:09:53 -07:00
Weapons fix: Optimizes OPL using string interpolation (#1041) 2022-06-02 10:09:53 -07:00