-
Notifications
You must be signed in to change notification settings - Fork 4
/
externalfile.h
50 lines (43 loc) · 1.36 KB
/
externalfile.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef EXTERNALFILE_H
#define EXTERNALFILE_H
#include <QDataStream>
#include "tibiafile.h"
#include "itemfile.h"
class ExternalFile : public TibiaModule
{
Q_OBJECT
public:
ExternalFile( QObject *parent = NULL );
ExternalFile( quint16 version, const QString& name, const ItemData& item, QObject *parent = NULL );
virtual ~ExternalFile( void );
bool isSuccess( void ) const {
return m_success;
};
virtual bool isLoaded( void ) const {
return m_loaded;
};
virtual void unload( void );
virtual bool load( const QString& ) {
return false;
};
virtual bool save( const QString& );
virtual bool idle( const QString&, bool );
virtual TibiaSprite getSprite( qint32, qint32 );
static bool readItem( QDataStream& in, ItemData& itemData, DatFormat *datFormat, TibiaModule *tibiaModule, qint32 index, quint32& address, QString& error );
static bool saveItem( QDataStream& out, const ItemData& itemData, DatFormat *datFormat );
void setItemData( const ItemData& item );
ItemData getItemData( void );
void setVersion( quint16 version ) {
m_version = version;
};
private:
DatFormat *m_datFormat;
bool m_success;
bool m_loaded;
bool m_mustIdle;
quint16 m_version;
quint32 m_address;
ItemData m_internalItemData;
mutable QMutex mutex;
};
#endif // EXTERNALFILE_H