![]() |
Core Rules
WoTC AD&D 2nd Edition -- Drakein API Reference
|
One roster entry (one row of Chars/index.chr). More...
#include <ICharacterMiniOb.h>
Public Types | |
| enum | DisplayDetailIndex { ddi_CharacterType = 0 , ddi_PlayerName = 1 , ddi_Party = 2 , ddi_Race = 3 , ddi_Class = 4 , ddi_Level = 5 , ddi_Kit = 6 , ddi_Count = 7 } |
| Display-detail slot positions cached on the MiniOb. More... | |
Public Member Functions | |
| virtual | ~ICharacterMiniOb ()=default |
| virtual const char * | GetCharacterName () const =0 |
| Character's display name. Empty for a fresh, unedited record. | |
| virtual const char * | GetFileName () const =0 |
| Per-character .dat filename (hex-stem form). | |
| virtual const char * | GetRace () const =0 |
| Character's race name. | |
| virtual const char * | GetParty () const =0 |
| Character's party name (group affiliation). | |
| virtual bool | IsNPC () const =0 |
| true if this MiniOb represents an NPC (DM-side roster). | |
| virtual const char * | GetDisplayDetail (DisplayDetailIndex idx) const =0 |
| Read a cached display field by slot. | |
| virtual ICharacterRecord * | GetRecord ()=0 |
| Get the full heavy character record. | |
| virtual bool | Save ()=0 |
| Save this single character to disk (.chr + Drakein.dat record). | |
| virtual ICharacterMiniOb * | Clone () const =0 |
| Deep copy of this MiniOb via Serialize round-trip. | |
One roster entry (one row of Chars/index.chr).
Read-only from a consumer's POV; mutate via GetRecord() instead.
Display-detail slot positions cached on the MiniOb.
Each slot maps to a roster-row column shown in the character tree. ddi_Level is text-formatted (e.g. "5/5" for a multi-class).
|
virtualdefault |
|
pure virtual |
Deep copy of this MiniOb via Serialize round-trip.
|
pure virtual |
Character's display name. Empty for a fresh, unedited record.
|
pure virtual |
Read a cached display field by slot.
The cache is populated/refreshed automatically by ICharacterRecord setters when fields they derive from change (e.g. SetClassDisplay() refreshes ddi_Class).
| idx | Display-detail slot to read. |
|
pure virtual |
Per-character .dat filename (hex-stem form).
Internal state – no setter. Empty until the first save mints it.
|
pure virtual |
Character's party name (group affiliation).
|
pure virtual |
Character's race name.
|
pure virtual |
Get the full heavy character record.
Lazy-loads on first call.
Always non-null: a missing or unreadable per-character file produces a fresh empty record (the "new character" path – the first save will mint a filename). Repeated calls do not re-load.
The record is owned by this MiniOb (ultimately by Character_Index); do NOT delete it. All character data lives behind this pointer – there is no other way to reach a character's fields.
|
pure virtual |
true if this MiniOb represents an NPC (DM-side roster).
|
pure virtual |
Save this single character to disk (.chr + Drakein.dat record).
Per-character incremental save. Writes the heavy record (.chr) and – if loaded and modified – its extension (Drakein.dat record) at the aligned hex stem. Also commits this character's row in index.chr via a read-merge-write pass (other in-memory MiniObs' dirty state is left untouched).
Independent of SaveDatabases() so a consumer can persist one character without committing other pending edits.