Core Rules
WoTC AD&D 2nd Edition -- Drakein API Reference
Loading...
Searching...
No Matches
ICharacterRecord.h File Reference

One full character sheet – the canonical public face of a character. More...

#include "API.h"

Classes

struct  CoreRules::Char_Strength_Attr
 Derived Strength stats for the character's current Strength (Core Rules) or Stamina + Muscle sub-abilities (Skills & Powers). More...
struct  CoreRules::Char_Dexterity_Attr
 Derived Dexterity stats. More...
struct  CoreRules::Char_Constitution_Attr
 Derived Constitution stats. More...
struct  CoreRules::Char_Intelligence_Attr
 Derived Intelligence stats. More...
struct  CoreRules::Char_Wisdom_Attr
 Derived Wisdom stats. More...
struct  CoreRules::Char_Charisma_Attr
 Derived Charisma stats. More...
class  CoreRules::ICharacterRecord
 Heavy per-character record (one row backing a Chars/*.dat file). More...

Namespaces

namespace  CoreRules

Detailed Description

One full character sheet – the canonical public face of a character.

Everything a consumer needs to read or mutate about a character flows through this interface – including fields that internally live on the per-character extension or adventure side. From a consumer's point of view, the extension does not exist: its fields (date of birth, eye color, current hit points, handedness, family link, adventures, ...) appear directly on ICharacterRecord and the internal storage split is an implementation detail.

Adventures remain accessible as ICharacter_Adventure* children (fat type with ~49 virtuals, not worth flattening), but the only way to reach one is via ICharacterRecord::GetAdventure(i). ICharacter_Extension does NOT appear in the public API at all.

Acquisition
ICharacterMiniOb* mini = Character_Index->Find("Frodo");
ICharacterRecord* rec = mini ? mini->GetRecord() : nullptr;
// rec is non-null iff the per-character .dat opens cleanly;
// a lazy load happens on the first GetRecord() call.
virtual ICharacterMiniOb * Find(const char *name)=0
virtual ICharacterRecord * GetRecord()=0
Get the full heavy character record.
Lifetime
The record is owned by the MiniOb (and ultimately by Character_Index). Do NOT delete it. When the index is torn down by ReleaseDatabases / process exit, every record goes with it.
Dirty tracking
Composite – mutating any field here (whether it lives in the core record or in the internal extension) marks the record dirty, which in turn marks its owning MiniOb dirty (triggering an index.chr rewrite at next SaveDatabases plus the per-character .dat / Drakein.dat record rewrite on Save() / SaveCharacter).