You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.0 KiB

#ifndef DATMANAGER_H
#define DATMANAGER_H
#include <framework/global.h>
#include "thing.h"
class DatManager
{
public:
bool load(const std::string& filename);
void unload();
void parseThingAttributes(std::stringstream& fin, ThingAttributes& thingAttributes);
void parseThingAttributesOpt(std::stringstream& fin, ThingAttributes& thingAttributes, uint8 opt);
ThingAttributes& getItemAttributes(uint16 id) { return m_itemsAttributes[id - 100]; }
ThingAttributes& getCreatureAttributes(uint16 id) { return m_creaturesAttributes[id]; }
ThingAttributes& getEffectAttributes(uint16 id) { return m_effectsAttributes[id]; }
ThingAttributes& getShotAttributes(uint16 id) { return m_shotsAttributes[id]; }
uint32 getSignature() { return m_signature; }
private:
uint32 m_signature;
std::vector<ThingAttributes> m_itemsAttributes;
std::vector<ThingAttributes> m_creaturesAttributes;
std::vector<ThingAttributes> m_effectsAttributes;
std::vector<ThingAttributes> m_shotsAttributes;
};
extern DatManager g_dat;
#endif