-
Notifications
You must be signed in to change notification settings - Fork 4
/
libraryfile.h
74 lines (61 loc) · 1.63 KB
/
libraryfile.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef LIBRARYFILE_H
#define LIBRARYFILE_H
#include <QDataStream>
#include "tibiafile.h"
#include "itemfile.h"
typedef QHash<quint32, quint32> AddressHash;
typedef QHash<quint32, ItemData> ItemHash;
class UserThread;
class LibraryFile : public TibiaModule
{
Q_OBJECT
public:
LibraryFile( QObject *parent = NULL );
LibraryFile( DatFormat *format, const ItemList& items, QObject *parent = NULL );
virtual ~LibraryFile( void );
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 save( const QString& ) {
return false;
};
virtual bool idle( const QString&, bool );
virtual TibiaSprite getSprite( qint32, qint32 );
ItemData getItemData( qint32 index );
void setItemData( qint32 index, const ItemData& item );
quint32 getCount( void ) const {
return m_count;
};
void setVersion( quint16 version ) {
m_version = version;
};
quint16 getVersion( void ) const {
return m_version;
};
quint32 getItemsSize( void ) const {
return m_items.size();
};
bool mustIdle( void ) const {
return m_mustIdle;
};
UserThread *getThread() const {
return m_thread;
};
private:
UserThread *m_thread;
DatFormat *m_datFormat;
bool m_loaded;
bool m_mustIdle;
quint16 m_version;
quint32 m_count;
ItemHash m_internalItems;
ItemList m_items;
AddressHash m_spriteHash;
mutable QMutex mutex;
};
#endif // EXTERNALFILE_H