# SourcifyCoreUEWrapper Module Rules

- **UE headers only in `.cpp` files** — SCW implementation headers (`SCW_*.h`) must forward-declare UE types, never `#include` them. The actual UE header goes in the `.cpp`.
- **Always virtual inheritance** on ISCW interfaces — `public virtual ISCW_Parent`, both in ISCW and SCW class declarations. `#pragma warning(disable: 4250)` suppresses expected MSVC dominance warnings.
- **Never `std::make_shared`** for SCW objects — always construct with `{ new SCW_Xxx { ptr }, SCW_Base::Deleter{} }`.
- **Cast chain ordering matters** — In `WrapInternal()`, most-derived types must appear before their bases. Wrong ordering silently wraps derived objects as their base type. Run `Tools/SCWHelper/SCWCastHelper.py` to regenerate cast chains after adding types.
- **Use `SCWHelper.py`** to scaffold new wrapper types — but note it does NOT generate `WrapInternal` cast entries, `Unwrap` methods, or actual wrapped method bodies.
- **ISCW interfaces use only ISCW/std types** — never expose raw UE types (`UObject*`, `FString`, etc.) in ISCW headers. Use `wstring`, `int32_t`, `ISCW_*Ptr`.
- **Alphabetical ordering** — Includes, `Wrap()` declarations, and forward declarations in `SourcifyCoreUEWrapperModule.h` are kept alphabetically sorted.
