ModernUO/dev-docs/claude-skills/migrate-from-runuo/migrate-property-lists.md
Kamron Batman 4f9bc1d9f6
feat: Adds AI skills to migrate from RunUO (#2366)
## Summary

Adds comprehensive RunUO → ModernUO migration documentation and Claude AI skills to help shard owners and script authors convert RunUO 2.7 code to ModernUO.

- **10 migration skills** (`dev-docs/claude-skills/migrate-from-runuo/`) — system-by-system conversion guides (foundation, serialization, timers, gumps, packets, property lists, commands/events, persistence, items/mobiles, systems/engines)
- **12 reference docs** (`dev-docs/runuo-migration-docs/`) — deep-reference with before/after examples, API mapping tables, edge cases, and gotchas
- **Updated existing skills** — `modernuo-timers`, `modernuo-serialization`, and `modernuo-threading` now document that `Serialize()` runs on background threads and timers are not thread-safe
- **Updated `CLAUDE.md`** — added migration skill lookup table

### Key migration patterns covered
- Manual `Serialize()`/`Deserialize()` → source-generated `[SerializableField]`
- `Packet` class hierarchy → static `SpanWriter`/`SpanReader` methods
- `Timer` subclasses → `TimerExecutionToken` fire-and-forget
- `Gump` → `StaticGump<T>`/`DynamicGump` with builders
- `EventSink.WorldSave` → `GenericPersistence`
- `ObjectPropertyList` → `IPropertyList` with string hole rules
- Universal changes: naming (`m_` → `_`), `[Constructable]` → `[Constructible]`, logging, spatial queries
2026-03-13 00:33:45 -07:00

33 lines
1.3 KiB
Markdown

---
name: migrate-property-lists
description: >
Trigger: when converting RunUO GetProperties(ObjectPropertyList) to ModernUO GetProperties(IPropertyList). Critical string literal rule.
Covers: IPropertyList interface, string hole rule, cliloc arguments.
---
# RunUO -> ModernUO Property List Migration
## When This Activates
- Converting `GetProperties(ObjectPropertyList list)` overrides
- Updating tooltip/property list code
## Conversion Steps
1. Change signature: `GetProperties(ObjectPropertyList list)` -> `GetProperties(IPropertyList list)`
2. Convert string args to interpolation: `list.Add(num, val.ToString())` -> `list.Add(num, $"{val}")`
3. Apply string hole rule: `$"Text\t{val}"` -> `$"{"Text"}\t{val}"`
4. Tab-separated: `string.Format("{0}\t{1}", a, b)` -> `$"{a}\t{b}"`
5. Cliloc as argument: `"#" + cliloc` -> `$"{cliloc:#}"`
## Critical Rule: String Literals Must Be Holes
Only `\t` should be a bare literal. All text must be inside `{}` holes:
```csharp
// BAD: "Map" is a delimiter
list.Add(1060658, $"Map\t{value}");
// GOOD: "Map" is an argument
list.Add(1060658, $"{"Map"}\t{value}");
```
## See Also
- `dev-docs/runuo-migration-docs/06-property-lists.md` -- detailed migration reference
- `dev-docs/property-lists.md` -- complete ModernUO property list system
- `dev-docs/claude-skills/modernuo-property-lists.md` -- ModernUO property list skill