-
Notifications
You must be signed in to change notification settings - Fork 4
/
tibiaresource.h
59 lines (50 loc) · 1.35 KB
/
tibiaresource.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
#ifndef TIBIARESOURCE_H
#define TIBIARESOURCE_H
#include <QSharedPointer>
#include <QHash>
#include <QFile>
class TibiaSprite;
class TibiaResource
{
public:
TibiaResource( quint8 resourceType, quint32 identifier, quint16 frame = 0, QFile *file = NULL );
~TibiaResource( void );
quint8 getType( void ) const {
return m_type;
};
quint32 getIdentifier( void ) const {
return m_id;
};
quint16 getFrame( void ) const {
return m_frame;
};
QFile *getFile( void ) const {
return m_file;
};
void reset( void );
void use( void );
void free( void );
void setType( quint8 type ) {
m_type = type;
};
void setIdentifier( const quint32 id ) {
m_id = id;
};
void setFrame( const quint16 frame ) {
m_frame = frame;
};
void setFile( QFile *file, bool load = true );
void unhook( void );
void resetCache( void );
TibiaSprite getTibiaSprite( void );
private:
quint8 m_type;
quint32 m_id;
quint16 m_frame;
QFile *m_file;
};
typedef QSharedPointer<TibiaResource> SharedResource;
QDataStream& operator<< ( QDataStream& stream, const SharedResource& sharedResource );
QDataStream& operator>> ( QDataStream& stream, SharedResource& sharedResource );
typedef QHash<quint32, SharedResource> ResourceHash;
#endif // TIBIARESOURCE_H