mirror of https://github.com/OpenMW/openmw.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.3 KiB
C++
64 lines
1.3 KiB
C++
12 years ago
|
#ifndef OPENMW_ESM_CONT_H
|
||
|
#define OPENMW_ESM_CONT_H
|
||
15 years ago
|
|
||
12 years ago
|
#include <string>
|
||
|
#include <vector>
|
||
|
|
||
3 years ago
|
#include "components/esm/esmcommon.hpp"
|
||
15 years ago
|
|
||
14 years ago
|
namespace ESM
|
||
|
{
|
||
15 years ago
|
|
||
12 years ago
|
class ESMReader;
|
||
|
class ESMWriter;
|
||
|
|
||
15 years ago
|
/*
|
||
|
* Container definition
|
||
|
*/
|
||
|
|
||
|
struct ContItem
|
||
|
{
|
||
12 years ago
|
int mCount;
|
||
5 years ago
|
std::string mItem;
|
||
15 years ago
|
};
|
||
|
|
||
10 years ago
|
/// InventoryList, NPCO subrecord
|
||
15 years ago
|
struct InventoryList
|
||
|
{
|
||
12 years ago
|
std::vector<ContItem> mList;
|
||
15 years ago
|
|
||
10 years ago
|
/// Load one item, assumes subrecord name is already read
|
||
|
void add(ESMReader &esm);
|
||
|
|
||
11 years ago
|
void save(ESMWriter &esm) const;
|
||
15 years ago
|
};
|
||
|
|
||
12 years ago
|
struct Container
|
||
15 years ago
|
{
|
||
11 years ago
|
static unsigned int sRecordId;
|
||
10 years ago
|
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
|
||
3 years ago
|
static std::string_view getRecordType() { return "Container"; }
|
||
11 years ago
|
|
||
14 years ago
|
enum Flags
|
||
15 years ago
|
{
|
||
14 years ago
|
Organic = 1, // Objects cannot be placed in this container
|
||
|
Respawn = 2, // Respawns after 4 months
|
||
|
Unknown = 8
|
||
15 years ago
|
};
|
||
|
|
||
4 years ago
|
unsigned int mRecordFlags;
|
||
12 years ago
|
std::string mId, mName, mModel, mScript;
|
||
15 years ago
|
|
||
12 years ago
|
float mWeight; // Not sure, might be max total weight allowed?
|
||
|
int mFlags;
|
||
|
InventoryList mInventory;
|
||
15 years ago
|
|
||
10 years ago
|
void load(ESMReader &esm, bool &isDeleted);
|
||
|
void save(ESMWriter &esm, bool isDeleted = false) const;
|
||
12 years ago
|
|
||
|
void blank();
|
||
|
///< Set record to default state (does not touch the ID).
|
||
15 years ago
|
};
|
||
|
}
|
||
|
#endif
|