![]() |
Core Rules
WoTC AD&D 2nd Edition -- Drakein API Reference
|
Public interface for one CPart record (Parts.dat / PartsU.dat). More...
#include "API.h"Classes | |
| class | CoreRules::IPart |
| One CPart record (a Weapon / Armor / NWP / Magic Item / Kit / etc.). More... | |
| struct | CoreRules::IPart::ImageLoc |
| Resolved image-file location for a part. More... | |
Namespaces | |
| namespace | CoreRules |
Functions | |
| IPart * | CoreRules::CreatePart () |
| void | CoreRules::DestroyPart (IPart *p) |
Public interface for one CPart record (Parts.dat / PartsU.dat).
CPart is the most field-rich record in CoreRules. All 21 part-type arrays in Parts.dat share this single record format; each part type uses a DIFFERENT SUBSET of the fields. Fields outside a type's subset sit at default values and are still serialized for round-trip.
Type identification is by array position — which of Parts.dat's 21 per-Part_Type arrays the record lives in — NOT by an embedded record-type field on CPart itself.
The interface groups fields by SEMANTIC USAGE rather than disk-layout order. Most groups apply to a subset of part types – the group docstring notes the relevant types. See CoreRules_DataFiles.md section 4 (per-type field selection guide) for which fields each Part_Type uses.