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

One roster entry (one row of Chars/index.chr). More...

#include "API.h"

Classes

class  CoreRules::ICharacterMiniOb
 One roster entry (one row of Chars/index.chr). More...

Namespaces

namespace  CoreRules

Functions

ICharacterMiniObCoreRules::CreateCharacterMiniOb ()
 Factory for a standalone MiniOb (not in any roster).
void CoreRules::DestroyCharacterMiniOb (ICharacterMiniOb *p)
 Release a MiniOb created by CreateCharacterMiniOb.

Detailed Description

One roster entry (one row of Chars/index.chr).

A MiniOb is the lightweight handle for a heavy character record that lives in a separate per-character .dat file. This interface surfaces the cached roster fields (name, file, race, party, NPC flag, display details) plus the dirty/clone/save protocol.

Read-only contract (consumer perspective)
Every cached field on the MiniOb is a copy of state that lives canonically on the heavy ICharacterRecord. Consumers therefore see the MiniOb as read-only: there are NO setters here. To change a character's name, race, party, NPC flag, portrait, etc., go through the record:
ICharacterMiniOb* mini = Character_Index->Find("Frodo");
ICharacterRecord* rec = mini->GetRecord();
rec->SetParty("Fellowship"); // canonical write
// mini->GetParty() now reflects the new value -- the record
// setter eagerly refreshes the owning MiniOb's cache.
virtual ICharacterMiniOb * Find(const char *name)=0
virtual ICharacterRecord * GetRecord()=0
Get the full heavy character record.
virtual void SetParty(const char *v)=0
Set the party. Refreshes MiniOb's cached party + ddi_Party.

Portrait fields (directory + filename) live ONLY on ICharacterRecord; they are not cached on the MiniOb and have no accessors here.

The "file name" is internal state managed by Load/Save; there is no SetFileName().