mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:23:52 +00:00
added assign function to Record class
This commit is contained in:
parent
1b84aeb5b9
commit
13e7abd7df
1 changed files with 11 additions and 0 deletions
|
@ -22,6 +22,9 @@ namespace CSMWorld
|
|||
|
||||
virtual RecordBase *clone() const = 0;
|
||||
|
||||
virtual void assign (const RecordBase& record) = 0;
|
||||
///< Will throw an exception if the types don't match.
|
||||
|
||||
bool isDeleted() const;
|
||||
|
||||
bool isErased() const;
|
||||
|
@ -37,6 +40,8 @@ namespace CSMWorld
|
|||
|
||||
virtual RecordBase *clone() const;
|
||||
|
||||
virtual void assign (const RecordBase& record);
|
||||
|
||||
const ESXRecordT& get() const;
|
||||
///< Throws an exception, if the record is deleted.
|
||||
|
||||
|
@ -56,6 +61,12 @@ namespace CSMWorld
|
|||
return new Record<ESXRecordT> (*this);
|
||||
}
|
||||
|
||||
template <typename ESXRecordT>
|
||||
void Record<ESXRecordT>::assign (const RecordBase& record)
|
||||
{
|
||||
*this = dynamic_cast<const Record<ESXRecordT>& > (record);
|
||||
}
|
||||
|
||||
template <typename ESXRecordT>
|
||||
const ESXRecordT& Record<ESXRecordT>::get() const
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue