Core Rules
WoTC AD&D 2nd Edition -- Drakein API Reference
Loading...
Searching...
No Matches
CoreRules::IPropertyRecord Class Referenceabstract

#include <IPropertyRecord.h>

Public Types

using record_type = IPropertyOb

Public Member Functions

virtual ~IPropertyRecord ()=default
virtual int GetCount () const =0
virtual IPropertyObGetAt (int index)=0
virtual IPropertyObFindById (long id)=0
 Find a single property by its m_id.
virtual int GetOwnerCount (int owner_kind, long owner_id) const =0
 Number of properties whose m_owner_kind / m_owner_id match the given pair.
virtual IPropertyObGetOwnedAt (int owner_kind, long owner_id, int index)=0
 The i-th property matching the given owner.
virtual int GetPartyOwnerCount (const char *party_name) const =0
 Number of properties owned by the named party.
virtual IPropertyObGetPartyOwnedAt (const char *party_name, int index)=0
 The i-th property owned by the named party.
virtual long Add (IPropertyOb *property)=0
 Add a property to the catalog.
virtual bool Remove (int index)=0
 Remove a property by index. Frees the pointer.
virtual bool RemoveById (long id)=0
 Remove a property by id. Frees the pointer.
virtual void Clear ()=0
 Drop all properties (frees pointers).
virtual bool IsDirty () const =0
 True if SaveDatabases should write Drakein.dat (this catalog's slot).

Member Typedef Documentation

◆ record_type

Constructor & Destructor Documentation

◆ ~IPropertyRecord()

virtual CoreRules::IPropertyRecord::~IPropertyRecord ( )
virtualdefault

Member Function Documentation

◆ Add()

virtual long CoreRules::IPropertyRecord::Add ( IPropertyOb * property)
pure virtual

Add a property to the catalog.

Assigns property->SetId() from the next monotonic id. Catalog takes ownership of the pointer.

Returns
The assigned id, or 0 on failure.

◆ Clear()

virtual void CoreRules::IPropertyRecord::Clear ( )
pure virtual

Drop all properties (frees pointers).

◆ FindById()

virtual IPropertyOb * CoreRules::IPropertyRecord::FindById ( long id)
pure virtual

Find a single property by its m_id.

Returns
The matching property, or nullptr when no property has that id (including the id == 0 "unassigned" sentinel).

◆ GetAt()

virtual IPropertyOb * CoreRules::IPropertyRecord::GetAt ( int index)
pure virtual

◆ GetCount()

virtual int CoreRules::IPropertyRecord::GetCount ( ) const
pure virtual

◆ GetOwnedAt()

virtual IPropertyOb * CoreRules::IPropertyRecord::GetOwnedAt ( int owner_kind,
long owner_id,
int index )
pure virtual

The i-th property matching the given owner.

Index is zero-based and dense over the matching subset. Returns nullptr when index is out of range.

◆ GetOwnerCount()

virtual int CoreRules::IPropertyRecord::GetOwnerCount ( int owner_kind,
long owner_id ) const
pure virtual

Number of properties whose m_owner_kind / m_owner_id match the given pair.

◆ GetPartyOwnedAt()

virtual IPropertyOb * CoreRules::IPropertyRecord::GetPartyOwnedAt ( const char * party_name,
int index )
pure virtual

The i-th property owned by the named party.

◆ GetPartyOwnerCount()

virtual int CoreRules::IPropertyRecord::GetPartyOwnerCount ( const char * party_name) const
pure virtual

Number of properties owned by the named party.

Parameters
party_namemust be non-null; empty matches no properties.

◆ IsDirty()

virtual bool CoreRules::IPropertyRecord::IsDirty ( ) const
pure virtual

True if SaveDatabases should write Drakein.dat (this catalog's slot).

Aggregates per-record IsDirty + slot- list mutations (add / remove) + next_id changes since the last successful save.

◆ Remove()

virtual bool CoreRules::IPropertyRecord::Remove ( int index)
pure virtual

Remove a property by index. Frees the pointer.

◆ RemoveById()

virtual bool CoreRules::IPropertyRecord::RemoveById ( long id)
pure virtual

Remove a property by id. Frees the pointer.


The documentation for this class was generated from the following file: