Record Store
The world model is split in two parts: An immutable part and a mutable part. The record store represents the immutable part.
The esm/esp file format contains a list of records, where each record is composed of a type ID and additional data. Our world model does mirror this structure.
For each type of record we have a struct in the ESM namespace: http://zinnschlag.github.com/openmw/namespaceESM.html
For each type of record we also have a separate list (there are some variations depending on the record type):
- http://zinnschlag.github.com/openmw/structESMS_1_1RecListT.html
- http://zinnschlag.github.com/openmw/structESMS_1_1LTexList.html
- http://zinnschlag.github.com/openmw/structESMS_1_1LandList.html
- http://zinnschlag.github.com/openmw/structESMS_1_1CellList.html
- http://zinnschlag.github.com/openmw/structESMS_1_1ScriptListT.html
- http://zinnschlag.github.com/openmw/structESMS_1_1IndexListT.html
The record store is composed of these lists.
The class implementing the record store is named ESMStore (in the ESMS namespace), which is partially a misnomer. Currently this class is filled with the records from only one esm. But later multiple esms and esps will be merged into it.
A const reference to the current ESMStore can be obtained from the MWWorld::World class instance.
There are some record types that are handled differently:
Cell
A cell record consists of some header-type data fields and a collection of references. Of these only the header data is stored in the record store. The collection of references is mutable and as such needs to be treated separately.